From: Brian Norris Date: Wed, 2 May 2012 23:10:51 +0000 (-0700) Subject: common: add ASSERT() X-Git-Tag: pldi2013~469 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=f60dc971069e7d4ceade8a1be52b4d42b69828df;p=model-checker.git common: add ASSERT() --- diff --git a/common.h b/common.h index d4823db..3476f53 100644 --- 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);