Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Second ivl_assert patch

This patch adds a do/while around the conditional
  • Loading branch information...
commit 2d83955182f7bcff33b4adadddaeca35650d5ff6 1 parent 5dd67d8
@caryr caryr authored steveicarus committed
Showing with 8 additions and 6 deletions.
  1. +8 −6 ivl_assert.h
View
14 ivl_assert.h
@@ -23,11 +23,13 @@
# include <cstdlib>
#define ivl_assert(tok, expression) \
- if (! (expression)) { \
- cerr << (tok).get_fileline() << ": assert: " \
- << __FILE__ << ":" << __LINE__ \
- << ": failed assertion " << #expression << endl; \
- abort(); \
- }
+ do { \
+ if (! (expression)) { \
+ cerr << (tok).get_fileline() << ": assert: " \
+ << __FILE__ << ":" << __LINE__ \
+ << ": failed assertion " << #expression << endl; \
+ abort(); \
+ } \
+ } while (0)
#endif
Please sign in to comment.
Something went wrong with that request. Please try again.