From 97ebbaa08e88b19d5f8c40f3339c607ae01d66d2 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Thu, 10 Dec 2020 19:19:35 -0500 Subject: [PATCH] src/common/{common,safe}.h: wrap code in C++ guards Signed-off-by: Philippe Proulx Change-Id: Ifcb907d159b67e6f27a5191553824fe2ed25ef5d Reviewed-on: https://review.lttng.org/c/babeltrace/+/4534 Reviewed-by: Simon Marchi --- src/common/common.h | 8 ++++++++ src/common/safe.h | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/src/common/common.h b/src/common/common.h index a04f2be6..c8b9bb8b 100644 --- a/src/common/common.h +++ b/src/common/common.h @@ -28,6 +28,10 @@ #include "common/macros.h" #include "common/safe.h" +#ifdef __cplusplus +extern "C" { +#endif + #define BT_COMMON_COLOR_RESET "\033[0m" #define BT_COMMON_COLOR_BOLD "\033[1m" #define BT_COMMON_COLOR_FG_DEFAULT "\033[39m" @@ -849,4 +853,8 @@ void bt_common_g_string_append_c(GString *str, char c) str->str[len + 1] = '\0'; } +#ifdef __cplusplus +} +#endif + #endif /* BABELTRACE_COMMON_INTERNAL_H */ diff --git a/src/common/safe.h b/src/common/safe.h index 6999730c..cb962c48 100644 --- a/src/common/safe.h +++ b/src/common/safe.h @@ -7,6 +7,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + static inline bool bt_safe_to_mul_int64(int64_t a, int64_t b) { @@ -38,3 +42,7 @@ bool bt_safe_to_add_uint64(uint64_t a, uint64_t b) { return a <= UINT64_MAX - b; } + +#ifdef __cplusplus +} +#endif -- 2.34.1