Fix: C++: incomplete extern C guard transition
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 3 Feb 2014 18:41:35 +0000 (13:41 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 3 Feb 2014 18:48:55 +0000 (13:48 -0500)
Recently, commits to fix SDT issues with extern C
(https://bugs.lttng.org/issues/597) brougt in compile errors when the
tracepoint is defined in the same file where the tracepoint provider is
created.

This was due to the presence of extern C guards in tracepoint-event.h, a
header dedicated to tracepoint probe provider compilation. After commits
"Tracepoint probes don't need extern C", it should have gone away. This
is the main fix done by this patch.

This patch also adds missing extern C guards in ust-error.h and
ust-events.h.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/lttng/tracepoint-event.h
include/lttng/ust-error.h
include/lttng/ust-events.h

index 4630788c114625c7de68fdcbed122f69568bb63b..c1ca31c85e11a64d0f5b0b5080e08282a06cec58 100644 (file)
 
 #ifdef TRACEPOINT_CREATE_PROBES
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 #define __tp_stringify1(x)     #x
 #define __tp_stringify(x)      __tp_stringify1(x)
 
@@ -65,10 +61,6 @@ extern "C" {
 #undef TRACEPOINT_INCLUDE_FILE
 #undef TRACEPOINT_INCLUDE
 
-#ifdef __cplusplus
-}
-#endif
-
 #define TRACEPOINT_CREATE_PROBES
 
 #endif /* TRACEPOINT_CREATE_PROBES */
index 05cc3bee65e2dd61a87c3907bda010e444c85680..cbcb5ebd161a9dd85acc421c3e7705a9b1989bf8 100644 (file)
 #include <unistd.h>
 #include <lttng/ust-abi.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /*
  * ustcomm error code.
  */
@@ -57,4 +61,8 @@ enum lttng_ust_error_code {
  */
 extern const char *lttng_ust_strerror(int code);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _LTTNG_UST_ERROR_H */
index 6effc42b047f02712720c1413520d4ccd79d804a..21ee0231fdc7b5e8c52a00d635b6e38732512fd8 100644 (file)
 #include <lttng/ust-endian.h>
 #include <float.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #define LTTNG_UST_UUID_LEN             16
 
 /*
@@ -593,4 +597,8 @@ void lttng_filter_sync_state(struct lttng_bytecode_runtime *runtime);
 struct cds_list_head *lttng_get_probe_list_head(void);
 int lttng_session_active(void);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _LTTNG_UST_EVENTS_H */
This page took 0.026139 seconds and 4 git commands to generate.