[lttng-dev] [PATCH] tracef: add extern "C" wrapper
Mathieu Desnoyers
mathieu.desnoyers at efficios.com
Tue May 13 09:41:48 EDT 2014
Sorry, I missed your patch and already committed a different
fix. Please let me know if my fix has any issue.
We usually encompass the entire header file (except #include)
with extern C by the way.
Thanks,
Mathieu
----- Original Message -----
> From: "Gerlando Falauto" <gerlando.falauto at keymile.com>
> To: lttng-dev at lists.lttng.org
> Cc: "Gerlando Falauto" <gerlando.falauto at keymile.com>
> Sent: Tuesday, May 13, 2014 5:33:46 AM
> Subject: [lttng-dev] [PATCH] tracef: add extern "C" wrapper
>
> Add an extern "C" wrapper so that tracef.h can be included
> (and the tracef() function can be used) from C++ files, too.
>
> Signed-off-by: Gerlando Falauto <gerlando.falauto at keymile.com>
> ---
> include/lttng/tracef.h | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/include/lttng/tracef.h b/include/lttng/tracef.h
> index 16a984b..45d0587 100644
> --- a/include/lttng/tracef.h
> +++ b/include/lttng/tracef.h
> @@ -25,9 +25,17 @@
>
> #include <lttng/lttng-ust-tracef.h>
>
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
> +
> extern
> void _lttng_ust_tracef(const char *fmt, ...);
>
> +#ifdef __cplusplus
> +}
> +#endif
> +
> #define tracef(fmt, ...) \
> do { \
> STAP_PROBEV(tracepoint_lttng_ust_tracef, event, ## __VA_ARGS__); \
> --
> 1.8.0.1
>
>
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>
--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
More information about the lttng-dev
mailing list