Merge branch 'static-assert' into 'master'
Implement static_assert See merge request redox-os/relibc!1355
This commit is contained in:
@@ -12,6 +12,10 @@ trailer = """
|
||||
#undef assert
|
||||
#endif
|
||||
|
||||
#if __STDC_VERSION__ >= 201112L && !defined(__cplusplus)
|
||||
#define static_assert _Static_assert
|
||||
#endif
|
||||
|
||||
#ifdef NDEBUG
|
||||
# define assert(cond) (void) 0
|
||||
#else
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
int main(void) {
|
||||
assert(1 == 1);
|
||||
assert(1 + 1 == 2);
|
||||
static_assert(3 == 3);
|
||||
puts("yay!");
|
||||
|
||||
if (assert(0 == 0), 1) {
|
||||
|
||||
Reference in New Issue
Block a user