projects
/
model-checker.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7708d1c
)
common: add ASSERT()
author
Brian Norris
<banorris@uci.edu>
Wed, 2 May 2012 23:10:51 +0000
(16:10 -0700)
committer
Brian Norris
<banorris@uci.edu>
Wed, 2 May 2012 23:10:51 +0000
(16:10 -0700)
common.h
patch
|
blob
|
history
diff --git
a/common.h
b/common.h
index d4823dbfa5895b13a5f960d3f4ff3c9f5d7c3216..3476f5379b721c167e9eec939c902c17aa175cc7 100644
(file)
--- a/
common.h
+++ b/
common.h
@@
-15,6
+15,15
@@
#define DBG_ENABLED() (0)
#endif
+#define ASSERT(expr) \
+do { \
+ if (!(expr)) { \
+ fprintf(stderr, "Error: assertion failed in %s at line %d\n", __FILE__, __LINE__); \
+ exit(1); \
+ } \
+} while (0);
+
+
void * myMalloc(size_t size);
void myFree(void *ptr);