Skip to content

Commit

Permalink
Force implicit conversion to boolean.
Browse files Browse the repository at this point in the history
This unbreaks the use of assertions within C++ code.
  • Loading branch information
EdSchouten committed Jan 1, 2019
1 parent b22cae9 commit 88c3fcc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/include/assert.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@ static __inline void __assert_enabled(const char *__func, const char *__file,
#define assert(expression) __assert_disabled()
#else
#define assert(expression) \
__assert_enabled(__func__, __FILE__, __LINE__, expression, #expression)
__assert_enabled(__func__, __FILE__, __LINE__, !!(expression), #expression)
#endif

0 comments on commit 88c3fcc

Please sign in to comment.