This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] add support for C11 static_assert macro


Hi,

The following patch adds support for C11 static_assert macro as
described in ISO/IEC 9899:2011 7.2 Diagnostics <assert.h>.

Aurel


Index: newlib/libc/include/assert.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/assert.h,v
retrieving revision 1.3
diff -u -r1.3 assert.h
--- newlib/libc/include/assert.h        17 Jul 2008 20:56:51 -0000
1.3
+++ newlib/libc/include/assert.h        12 Oct 2012 11:19:28 -0000
@@ -41,6 +41,10 @@
 void _EXFUN(__assert_func, (const char *, int, const char *, const char
 *)
            _ATTRIBUTE ((__noreturn__)));
 
+#if __STDC_VERSION__ >= 201112L && !defined __cplusplus
+# define static_assert _Static_assert
+#endif
+
 #ifdef __cplusplus
 }
 #endif


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]