From f5eea43249e40d8566c8524a3f8634c87b70c9e4 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Mon, 3 Feb 2014 13:41:35 -0500 Subject: [PATCH] Fix: C++: incomplete extern C guard transition 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 --- include/lttng/tracepoint-event.h | 8 -------- include/lttng/ust-error.h | 8 ++++++++ include/lttng/ust-events.h | 8 ++++++++ 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/include/lttng/tracepoint-event.h b/include/lttng/tracepoint-event.h index 4630788c..c1ca31c8 100644 --- a/include/lttng/tracepoint-event.h +++ b/include/lttng/tracepoint-event.h @@ -22,10 +22,6 @@ #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 */ diff --git a/include/lttng/ust-error.h b/include/lttng/ust-error.h index 05cc3bee..cbcb5ebd 100644 --- a/include/lttng/ust-error.h +++ b/include/lttng/ust-error.h @@ -30,6 +30,10 @@ #include #include +#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 */ diff --git a/include/lttng/ust-events.h b/include/lttng/ust-events.h index 6effc42b..21ee0231 100644 --- a/include/lttng/ust-events.h +++ b/include/lttng/ust-events.h @@ -35,6 +35,10 @@ #include #include +#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 */ -- 2.34.1