|
|
@@ -30,14 +30,12 @@ OTHER DEALINGS IN THE SOFTWARE.
|
|
|
#pragma once
|
|
|
|
|
|
#ifdef CROWN_DEBUG
|
|
|
- #define ce_assert(condition, message, ...)\
|
|
|
- \
|
|
|
- do\
|
|
|
- {\
|
|
|
- os::printf("Assertion failed: %s\n\t" message, #condition, __VA_ARGS__);\
|
|
|
- os::printf("\n");
|
|
|
- abort();\
|
|
|
- } while (0)
|
|
|
+
|
|
|
+ #define ce_error(file, line, message, ...) do { os::printf(message, __VA_ARGS__);\
|
|
|
+ os::printf("\n\tIn %s:%d\n", file, line); abort(); } while(0)
|
|
|
+
|
|
|
+ #define ce_assert(condition, message, ...) do { if ((!condition)) { ce_error(__FILE__, __LINE__,\
|
|
|
+ "Assertion failed: %s\n\t" message, #condition, __VA_ARGS__); } } while(0)
|
|
|
#else
|
|
|
#define ce_assert(condition, message, ...) ((void)0)
|
|
|
#endif
|