mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-20 07:38:54 +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 db2367e878
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:
@@ -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
|
||||||
|
Reference in New Issue
Block a user