Skip to content

Commit 4b2a9c2

Browse files
fix assert to print the error
1 parent d102d81 commit 4b2a9c2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

basic/assertion/include/assert.hxx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#pragma once
22
#include <cstdlib>
33

4-
#define assert(b)\
5-
if(!(b)) std::exit(EXIT_FAILURE);
4+
#define assert(b) \
5+
if (!(b)) { \
6+
printf("Error : %s\n", #b); \
7+
exit(EXIT_FAILURE); \
8+
}

0 commit comments

Comments
 (0)