src/common.h

changeset 237
ec77f6e9a19f
parent 232
4e44c92e21dd
child 243
a7c72c847634
equal deleted inserted replaced
236:b58d35dc5d52 237:ec77f6e9a19f
95 95
96 #ifdef null 96 #ifdef null
97 #undef null 97 #undef null
98 #endif // null 98 #endif // null
99 99
100 #ifdef __GNUC__
101 #define FUNCNAME __PRETTY_FUNCTION__
102 #else
103 #define FUNCNAME __func__
104 #endif // __GNUC__
105
106 // Replace assert with a version that shows a GUI dialog if possible
107 #ifdef assert
108 #undef assert
109 #endif // assert
110
111 void assertionFailure (const char* file, const ulong line, const char* funcname, const char* expr);
112 void fatalError (const char* file, const ulong line, const char* funcname, str errmsg);
113 #define assert(N) \
114 (N) ? ((void)(0)) : assertionFailure(__FILE__, __LINE__, FUNCNAME, #N)
115
116 #define fatal(MSG) \
117 fatalError (__FILE__, __LINE__, FUNCNAME, MSG)
118
100 // Null pointer 119 // Null pointer
101 static const std::nullptr_t null = nullptr; 120 static const std::nullptr_t null = nullptr;
102 121
103 // Main and edge color identifiers 122 // Main and edge color identifiers
104 static const short maincolor = 16; 123 static const short maincolor = 16;

mercurial