Fix: duplicate symbol with clang linker
authorMichael Jeanson <mjeanson@efficios.com>
Tue, 7 May 2019 16:25:05 +0000 (12:25 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 7 May 2019 20:02:58 +0000 (16:02 -0400)
On MacOs with the clang linker, the build fails with:

 duplicate symbol _bt_ctf_value_null in:
     trace-ir/.libs/libtrace-ir.a(trace.o)
     trace-ir/.libs/libtrace-ir.a(trace-class.o)

Make the pointers extern.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Change-Id: I679dc5b647de235a19a958331f7f975c0cb0a08f
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1267
Reviewed-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
include/babeltrace/ctf-writer/values-internal.h
lib/ctf-writer/values.c

index ca87255a327073cfea3e035fc08e7b3841b6ffc8..4cd74e1bd866eceeb94373ec3888518ae8b73284 100644 (file)
@@ -52,7 +52,7 @@ enum bt_ctf_value_status _bt_ctf_value_freeze(struct bt_ctf_value *object);
 # define bt_ctf_value_freeze(_value)
 #endif /* BT_DEV_MODE */
 
-struct bt_ctf_value *bt_ctf_value_null;
+extern struct bt_ctf_value *const bt_ctf_value_null;
 
 enum bt_ctf_value_type {
        /// Null value object.
@@ -190,7 +190,7 @@ enum bt_ctf_value_status bt_ctf_value_map_extend(
 struct bt_ctf_value;
 struct bt_ctf_private_value;
 
-struct bt_ctf_private_value *bt_ctf_private_value_null;
+extern struct bt_ctf_private_value *const bt_ctf_private_value_null;
 
 static inline
 struct bt_ctf_value *bt_ctf_private_value_as_value(
index e67d8b590f5bd7f8b9176c37ad579b1a3ea7b002..dc84b769f26a755656b38c3b6a627b111df1d90e 100644 (file)
@@ -88,8 +88,8 @@ struct bt_ctf_value bt_ctf_value_null_instance = {
        .frozen = BT_TRUE,
 };
 
-struct bt_ctf_value *bt_ctf_value_null = &bt_ctf_value_null_instance;
-struct bt_ctf_private_value *bt_ctf_private_value_null =
+struct bt_ctf_value *const bt_ctf_value_null = &bt_ctf_value_null_instance;
+struct bt_ctf_private_value *const bt_ctf_private_value_null =
        (void *) &bt_ctf_value_null_instance;
 
 struct bt_ctf_value_bool {
This page took 0.025293 seconds and 4 git commands to generate.