X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flib%2Fdebug.h;h=76c3f77b732f8aa807847fb9be13a7af91c2bb8d;hb=0a60e906e608f4505584281acfe6c699d04ef00b;hp=947dff204f17fab746107a8def7b097d23a3db52;hpb=94fedb7acb238d6a5cb29c5f17af70ac1f24eb40;p=pintos-anon diff --git a/src/lib/debug.h b/src/lib/debug.h index 947dff2..76c3f77 100644 --- a/src/lib/debug.h +++ b/src/lib/debug.h @@ -37,10 +37,8 @@ void debug_backtrace (void); #undef NOT_REACHED #ifndef NDEBUG -#define ASSERT(CONDITION) \ - if (CONDITION) { } else { \ - PANIC ("assertion `%s' failed.", #CONDITION); \ - } +#define ASSERT(CONDITION) \ + ((void) ((CONDITION) || PANIC ("assertion `%s' failed.", #CONDITION))) #define NOT_REACHED() PANIC ("executed an unreachable statement"); #else #define ASSERT(CONDITION) ((void) 0)