]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Do not assume '#define ... defined ...' behavior.
authorBruno Haible <bruno@clisp.org>
Sun, 15 Jul 2012 13:40:50 +0000 (15:40 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 15 Jul 2012 13:40:50 +0000 (15:40 +0200)
gnulib-local/ChangeLog
gnulib-local/lib/gettext.h

index a0240555fbb2e7a755ed7064fa980724b2caf3da..cb4c736c1f0d0b0152941299398c6e1f41af0ce6 100644 (file)
@@ -1,3 +1,12 @@
+2012-07-11  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Do not assume '#define ... defined ...' behavior.
+       * lib/gettext.h (_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS):
+       Do not use '#define FOO ... defined BAR ...', as the C standard says
+       it's not portable to expect that this works after macro expansion.
+       Problem reported for gzip by Steven M. Schweda in
+       <http://lists.gnu.org/archive/html/bug-gzip/2012-07/msg00000.html>.
+
 2012-06-03  Jim Meyering  <jim@meyering.net>
 
        * lib/tparm.c: Spelling fixes.
index fbbbce18b209174e672f93ad06ac6f0225d984ca..9d4055d1229cfdacff4535ab9454df0345ae1e4a 100644 (file)
@@ -182,9 +182,12 @@ npgettext_aux (const char *domain,
 
 #include <string.h>
 
-#define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \
-  (((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__) \
-   /* || __STDC_VERSION__ >= 199901L */ )
+#if (((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__) \
+     /* || __STDC_VERSION__ >= 199901L */ )
+# define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 1
+#else
+# define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 0
+#endif
 
 #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
 #include <stdlib.h>