00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00018 #ifndef LIBCWD_PRIVATE_ASSERT_H
00019 #define LIBCWD_PRIVATE_ASSERT_H
00020
00021 #ifndef LIBCWD_CONFIG_H
00022 #include <libcwd/config.h>
00023 #endif
00024 #ifndef LIBCW_CASSERT
00025 #define LIBCW_CASSERT
00026 #include <cassert>
00027 #endif
00028
00029 namespace libcwd {
00030 namespace _private_ {
00031
00032 void assert_fail(char const* expr, char const* file, int line, char const* function);
00033
00034 }
00035 }
00036
00037
00038 #define LIBCWD_STRING(x) #x
00039
00040 #define LIBCWD_ASSERT(expr) \
00041 (static_cast<void>((expr) ? 0 \
00042 : (::libcwd::_private_::\
00043 assert_fail(LIBCWD_STRING(expr), __FILE__, __LINE__, __PRETTY_FUNCTION__), 0)))
00044
00045 #endif // LIBCWD_PRIVATE_ASSERT_H
00046