From: Philippe Proulx Date: Mon, 7 Dec 2020 19:21:47 +0000 (-0500) Subject: src/common/{assert,macros}.h: wrap code in C++ guards X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=826b4673c08ce7dbb9da3426bf4f2131ae41a092 src/common/{assert,macros}.h: wrap code in C++ guards Not strictly needed for `macros.h`, but adding it just in case. Signed-off-by: Philippe Proulx Change-Id: I6d13ab5a062c6c5b1ecaa996c119a149d2487f0b Reviewed-on: https://review.lttng.org/c/babeltrace/+/4504 Reviewed-by: Simon Marchi Tested-by: jenkins --- diff --git a/src/common/assert.h b/src/common/assert.h index 77c35e2e..dd9b9127 100644 --- a/src/common/assert.h +++ b/src/common/assert.h @@ -13,6 +13,10 @@ #include "common/macros.h" +#ifdef __cplusplus +extern "C" { +#endif + BT_HIDDEN extern void bt_common_assert_failed(const char *file, int line, const char *func, const char *assertion) @@ -56,4 +60,8 @@ extern void bt_common_assert_failed(const char *file, int line, # define BT_ASSERT_DBG_FUNC __attribute__((unused)) #endif /* BT_DEBUG_MODE */ +#ifdef __cplusplus +} +#endif + #endif /* BABELTRACE_ASSERT_INTERNAL_H */ diff --git a/src/common/macros.h b/src/common/macros.h index 718a3050..9014afc2 100644 --- a/src/common/macros.h +++ b/src/common/macros.h @@ -7,6 +7,10 @@ #ifndef _BABELTRACE_INTERNAL_H #define _BABELTRACE_INTERNAL_H +#ifdef __cplusplus +extern "C" { +#endif + #define bt_max_t(type, a, b) \ ((type) (a) > (type) (b) ? (type) (a) : (type) (b)) @@ -71,4 +75,8 @@ ((void) sizeof((void) (_expr1), (void) (_expr2), \ (void) (_expr3), (void) (_expr4), (void) (_expr5), 0)) +#ifdef __cplusplus +} +#endif + #endif