include/babeltrace2: add `noexcept` specifier for C++ ≥ 11
[babeltrace.git] / include / babeltrace2 / babeltrace.h
index 82c402adbd2956070eb65c075ce511e7abcdc597..82f625145351f1f5febe9388c75fb8ec0848a0bc 100644 (file)
 #define __BT_ATTR_FORMAT_PRINTF(_string_index, _first_to_check) \
                __attribute__((format(__BT_PRINTF_FORMAT, _string_index, _first_to_check)))
 
+/* Internal: `noexcept` specifier if C++ ≥ 11 */
+#if defined(__cplusplus) && (__cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1900))
+# define __BT_NOEXCEPT noexcept
+#else
+# define __BT_NOEXCEPT
+#endif
+
 #include <babeltrace2/error-reporting.h>
 #include <babeltrace2/graph/component-class-dev.h>
 #include <babeltrace2/graph/component-class.h>
 #undef __BT_LOGGING_LEVEL_ERROR
 #undef __BT_LOGGING_LEVEL_FATAL
 #undef __BT_LOGGING_LEVEL_NONE
+#undef __BT_NOEXCEPT
 
 #endif /* BABELTRACE2_BABELTRACE_H */
This page took 0.02325 seconds and 4 git commands to generate.