From: Philippe Proulx Date: Wed, 9 Nov 2016 17:29:06 +0000 (-0500) Subject: barectf.h: add __cplusplus check X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=7005bc966d9b167b1b70f95a1e5bf1f873f93e54;p=deliverable%2Fbarectf.git barectf.h: add __cplusplus check Signed-off-by: Philippe Proulx --- diff --git a/barectf/templates.py b/barectf/templates.py index fcc90ef..bf00f27 100644 --- a/barectf/templates.py +++ b/barectf/templates.py @@ -263,6 +263,10 @@ _HEADER_BEGIN = '''#ifndef _{ucprefix}H #include "{bitfield_header_filename}" +#ifdef __cplusplus +extern "C" {{ +#endif + {prefix_def} {default_stream_def} @@ -280,7 +284,12 @@ uint32_t {prefix}packet_buf_size(void *ctx); int {prefix}packet_is_open(void *ctx);''' -_HEADER_END = '#endif /* _{ucprefix}H */' +_HEADER_END = '''#ifdef __cplusplus +}} +#endif + +#endif /* _{ucprefix}H */ +''' _C_SRC = '''/*