mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-06-02 02:40:07 +02:00
gmacros: fix unguarded use of __STDC_VERSION__
According to the C spec, any undefined identifier used in a #if expression is taken to have a numerical value of zero. Commit db2367e8782d7a39fc3e93d13f6a16f10cad04c2 introduced an #i statement which depended on this behaviour. gcc has a -Wundef option which warns about depending on this behaviour, and unfortunately there are projects that are using -Werror=undef in builds that include our headers. Adding a check for defined(__STDC_VERSION__) before using the macro is enough to silence gcc.
This commit is contained in:
parent
1ee2db4a28
commit
7bc6f021d7
@ -53,7 +53,7 @@
|
|||||||
* the warning.
|
* the warning.
|
||||||
*/
|
*/
|
||||||
#define G_CAN_INLINE
|
#define G_CAN_INLINE
|
||||||
#if !(__STDC_VERSION__ > 199900)
|
#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199900)
|
||||||
#undef inline
|
#undef inline
|
||||||
#define inline __inline
|
#define inline __inline
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user