Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit ebf6049

Browse files
committed
Fix StaticAssertExpr() under C++
The previous code didn't compile, because static_assert() must end with a semicolon. To fix, wrap it in a block, similar to the C code.
1 parent 2e1d1eb commit ebf6049

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/include/c.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,7 @@ extern void ExceptionalCondition(const char *conditionName,
791791
#define StaticAssertStmt(condition, errmessage) \
792792
static_assert(condition, errmessage)
793793
#define StaticAssertExpr(condition, errmessage) \
794-
StaticAssertStmt(condition, errmessage)
794+
({ static_assert(condition, errmessage); })
795795
#else
796796
#define StaticAssertStmt(condition, errmessage) \
797797
do { struct static_assert_struct { int static_assert_failure : (condition) ? 1 : -1; }; } while(0)

0 commit comments

Comments
 (0)