* randread.c (__attribute__): Don't define if __attribute__ is already defined.
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 23 Nov 2006 00:06:42 +0000 (01:06 +0100)
committerJim Meyering <jim@meyering.net>
Thu, 23 Nov 2006 00:06:42 +0000 (01:06 +0100)
Otherwise, the code won't conform to C99, since
the macro arg is spelled differently by some include file, and the
compilation fails with pedantic GCC.

lib/ChangeLog
lib/randread.c

index e76b95d..e4c565c 100644 (file)
@@ -1,3 +1,10 @@
+2006-11-22  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * randread.c (__attribute__): Don't define if __attribute__ is
+       already defined.  Otherwise, the code won't conform to C99, since
+       the macro arg is spelled differently by some include file, and the
+       compilation fails with pedantic GCC.
+
 2006-11-22  Jim Meyering  <jim@meyering.net>
 
        * .cvsignore, .gitignore: Add fstat.c.
index b761fa5..5462d44 100644 (file)
 # define MIN(a, b) ((a) < (b) ? (a) : (b))
 #endif
 
-#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__
-# define __attribute__(x)
+#ifndef __attribute__
+# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__
+#  define __attribute__(x)
+# endif
 #endif
 
 #ifndef ATTRIBUTE_UNUSED