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

Lines changed: 1 addition & 1 deletion
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy