mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-08 14:20:07 +00:00
Add ersatz _Static_assert on older C hosts
* misc/sys/cdefs.h (_Static_assert): Define a substitute, if on a pre-C11 C platform that is not known to support _Static_assert.
This commit is contained in:
parent
f96ec27aa9
commit
3999d26ead
@ -1,3 +1,9 @@
|
||||
2015-02-07 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
Add ersatz _Static_assert on older C hosts
|
||||
* misc/sys/cdefs.h (_Static_assert): Define a substitute, if on a
|
||||
pre-C11 C platform that is not known to support _Static_assert.
|
||||
|
||||
2015-02-07 Richard Braun <rbraun@sceen.net>
|
||||
|
||||
* hurd/hurd/signal.h (_hurd_critical_section_lock): Don't unlock
|
||||
|
@ -113,7 +113,6 @@ __END_DECLS
|
||||
|
||||
|
||||
#if defined __USE_ISOC11 && !defined __cplusplus
|
||||
/* Static assertion. Requires support in the compiler. */
|
||||
# undef static_assert
|
||||
# define static_assert _Static_assert
|
||||
#endif
|
||||
|
@ -399,6 +399,14 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if (!defined _Static_assert && !defined __cplusplus \
|
||||
&& (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \
|
||||
&& (!__GNUC_PREREQ (4, 6) || defined __STRICT_ANSI__))
|
||||
# define _Static_assert(expr, diagnostic) \
|
||||
extern int (*__Static_assert_function (void)) \
|
||||
[!!sizeof (struct { int __error_if_negative: (expr) ? 2 : -1; })]
|
||||
#endif
|
||||
|
||||
#include <bits/wordsize.h>
|
||||
|
||||
#if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH
|
||||
|
Loading…
Reference in New Issue
Block a user