X-Git-Url: https://git.efficios.com/?a=blobdiff_plain;f=src%2Fcommon%2Fmacros.h;h=13ba2d3628c1abf4b36239838be6e00146224da5;hb=e0f8968a1182ea437ee4db0abc4043ba1dc286a2;hp=903219b8779d228aae93efae7a03fc56cba61129;hpb=0f286fd6b070f5f3de2f6d95865a547574f5cb3e;p=babeltrace.git diff --git a/src/common/macros.h b/src/common/macros.h index 903219b8..13ba2d36 100644 --- a/src/common/macros.h +++ b/src/common/macros.h @@ -29,6 +29,15 @@ extern "C" { #define BT_EXPORT __attribute__((visibility("default"))) #endif +/* + * BT_NOEXCEPT: defined to `noexcept` if compiling as C++, else empty. + */ +#if defined(__cplusplus) +#define BT_NOEXCEPT noexcept +#else +#define BT_NOEXCEPT +#endif + /* Enable `txt` if developer mode is enabled. */ #ifdef BT_DEV_MODE #define BT_IF_DEV_MODE(txt) txt