Fix compilation error on non-glibc systems.
authorDavid Lutterkort <lutter@redhat.com>
Tue, 3 Mar 2009 01:51:11 +0000 (02:51 +0100)
committerBruno Haible <bruno@clisp.org>
Tue, 3 Mar 2009 01:51:11 +0000 (02:51 +0100)
ChangeLog
lib/safe-alloc.h

index 944f4ab..b3e2b3b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-03-02  David Lutterkort  <lutter@redhat.com>
+
+       * lib/safe-alloc.h (__GNUC_PREREQ): New macro.
+       Reported by Tom G. Christensen <tgc@jupiterrise.com>.
+
 2009-03-02  Bruno Haible  <bruno@clisp.org>
 
        * doc/gnulib.texi (Exported Symbols of Shared Libraries): New section.
index 3fa3f2e..f07ee91 100644 (file)
 
 # include <stdlib.h>
 
+#ifndef __GNUC_PREREQ
+# if defined __GNUC__ && defined __GNUC_MINOR__
+#  define __GNUC_PREREQ(maj, min)                                       \
+  ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
+# else
+#  define __GNUC_PREREQ(maj, min) 0
+# endif
+#endif
+
 # ifndef ATTRIBUTE_RETURN_CHECK
 #  if __GNUC_PREREQ (3, 4)
 #   define ATTRIBUTE_RETURN_CHECK __attribute__((__warn_unused_result__))