summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2006-11-23 01:06:42 +0100
committerJim Meyering <jim@meyering.net>2006-11-23 01:06:42 +0100
commit3ccd02d5b9211acb4cb15177623d25e28f8cfd76 (patch)
tree20c2d78baab129d51eec7e7bc941ac1ca65450d9 /lib
parent5272c6daa181cf148e2dcddc54b0a6bdd3b4294c (diff)
downloadcoreutils-3ccd02d5b9211acb4cb15177623d25e28f8cfd76.tar.xz
* 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.
Diffstat (limited to 'lib')
-rw-r--r--lib/ChangeLog7
-rw-r--r--lib/randread.c6
2 files changed, 11 insertions, 2 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog
index e76b95ddd..e4c565c73 100644
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -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.
diff --git a/lib/randread.c b/lib/randread.c
index b761fa5bd..5462d446c 100644
--- a/lib/randread.c
+++ b/lib/randread.c
@@ -44,8 +44,10 @@
# 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