Commit b6662deb authored by Dominik Charousset's avatar Dominik Charousset

Avoid ambiguities in CAF_ASSERT

parent 57257de9
...@@ -191,7 +191,7 @@ ...@@ -191,7 +191,7 @@
# define CAF_ASSERT(stmt) \ # define CAF_ASSERT(stmt) \
if (static_cast<bool>(stmt) == false) { \ if (static_cast<bool>(stmt) == false) { \
printf("%s:%u: requirement failed '%s'\n", __FILE__, __LINE__, #stmt); \ printf("%s:%u: requirement failed '%s'\n", __FILE__, __LINE__, #stmt); \
abort(); \ ::abort(); \
} static_cast<void>(0) } static_cast<void>(0)
#else // defined(CAF_LINUX) || defined(CAF_MACOS) #else // defined(CAF_LINUX) || defined(CAF_MACOS)
# include <execinfo.h> # include <execinfo.h>
...@@ -201,18 +201,18 @@ ...@@ -201,18 +201,18 @@
void* array[20]; \ void* array[20]; \
auto caf_bt_size = ::backtrace(array, 20); \ auto caf_bt_size = ::backtrace(array, 20); \
::backtrace_symbols_fd(array, caf_bt_size, 2); \ ::backtrace_symbols_fd(array, caf_bt_size, 2); \
abort(); \ ::abort(); \
} static_cast<void>(0) } static_cast<void>(0)
#endif #endif
// Convenience macros. // Convenience macros.
#define CAF_IGNORE_UNUSED(x) static_cast<void>(x); #define CAF_IGNORE_UNUSED(x) static_cast<void>(x)
#define CAF_CRITICAL(error) \ #define CAF_CRITICAL(error) \
do { \ do { \
fprintf(stderr, "[FATAL] %s:%u: critical error: '%s'\n", \ fprintf(stderr, "[FATAL] %s:%u: critical error: '%s'\n", \
__FILE__, __LINE__, error); \ __FILE__, __LINE__, error); \
abort(); \ ::abort(); \
} while (false) } while (false)
#ifdef CAF_NO_EXCEPTIONS #ifdef CAF_NO_EXCEPTIONS
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment