]> granicus.if.org Git - libexpat/commitdiff
Fix __func__ for -std=c89 with GCC 5.4.0 (fixes #12)
authorSebastian Pipping <sebastian@pipping.org>
Wed, 8 Mar 2017 21:20:42 +0000 (22:20 +0100)
committerSebastian Pipping <sebastian@pipping.org>
Wed, 8 Mar 2017 21:25:37 +0000 (22:25 +0100)
GCC 5.4.0 does not define __STDC_VERSION__ when -std=c89 is passed.

expat/tests/minicheck.h

index 9b06f51a88a7a9a6f7738aefb187f32d6208edbe..319c981dd10f8b9899f0ab4f525ac934c96a0b74 100644 (file)
@@ -27,7 +27,8 @@ extern "C" {
 #endif
 
 /* ISO C90 does not support '__func__' predefined identifier */
-#if defined(__STDC_VERSION__) && (__STDC_VERSION__ < 199901)
+#if (defined(__STDC_VERSION__) && (__STDC_VERSION__ < 199901)) || \
+    (defined(__GNUC__) && !defined(__STDC_VERSION__))
 # define __func__ "(unknown)"
 #endif