30 #ifndef __SAGITTARIUS_ASSERT_H_
31 #define __SAGITTARIUS_ASSERT_H_
38 #ifndef PYTHON_SCREWED_IT_UP
39 #define REALASSERT(x) assert(x);
41 #if SAGITTARIUS_PLATFORM == SAGITTARIUS_PLATFORM_LINUX
42 #define REALASSERT(x) ((x) ? (void)0 : sg_ast_fail(QUOTE(x), __FILE__, __LINE__, __PRETTY_FUNCTION__))
43 #elif SAGITTARIUS_PLATFORM == SAGITTARIUS_PLATFORM_WIN
44 #define REALASSERT(x) ((x) ? (void)0 : sg_ast_fail(QUOTE(x), __FILE__, __LINE__, __FUNCTION__))
45 #elif SAGITTARIUS_PLATFORM == SAGITTARIUS_PLATFORM_APPLE
46 #define REALASSERT(x) ((x) ? (void)0 : sg_ast_fail(QUOTE(x), __FILE__, __LINE__, __PRETTY_FUNCTION__))
51 #define SAGITTARIUS_ASSERT1( x ) REALASSERT( x )
52 #define SAGITTARIUS_ASSERT2( x, msg ) REALASSERT( (x) && msg ) //thank you gcc
53 #define SAGITTARIUS_IASSERT1( x ) REALASSERT( !(x) )
54 #define SAGITTARIUS_IASSERT2( x, msg ) REALASSERT( !(x) && msg )
55 #define EXPAND(x) x //Workaround for MSVC bug
56 #define GET_ASTM(A1, A2, A3, A4, ...) A4
58 #define SAGITTARIUS_ASSERT( ... ) EXPAND(GET_ASTM(__VA_ARGS__, ***error*** "Too many arguments to assert; file: "__FILE__:__LINE__,\
59 SAGITTARIUS_ASSERT2, SAGITTARIUS_ASSERT1)( __VA_ARGS__ ))
62 #define AST( ... ) SAGITTARIUS_ASSERT( __VA_ARGS__ )
64 #define AT( ... ) SAGITTARIUS_ASSERT( __VA_ARGS__ )
72 #define AN( ... ) SAGITTARIUS_ASSERT( __VA_ARGS__ )
74 #define AZ( ... ) EXPAND(GET_ASTM(__VA_ARGS__, ***error*** "Too many arguments to assert; file: "__FILE__:__LINE__,\
75 SAGITTARIUS_IASSERT2, SAGITTARIUS_IASSERT1)( __VA_ARGS__ ))
81 _GraphfabExport
void sg_ast_fail(
const char* message,
const char* file,
unsigned long line,
const char* func);
Common required definitions.