summaryrefslogtreecommitdiff
path: root/lib/safe-alloc.h
diff options
context:
space:
mode:
authorDavid Lutterkort <lutter@redhat.com>2009-03-03 02:51:11 +0100
committerBruno Haible <bruno@clisp.org>2009-03-03 02:51:11 +0100
commit87bbc7a54407183623f0bcee3b5cb35c34b95e93 (patch)
treed0dafefc63ae02bbefdda3fbdfa280d36f798868 /lib/safe-alloc.h
parentf824e4c73011002d79e2faa7e8e3b0cbf1fd96b6 (diff)
downloadgnulib-87bbc7a54407183623f0bcee3b5cb35c34b95e93.tar.gz
Fix compilation error on non-glibc systems.
Diffstat (limited to 'lib/safe-alloc.h')
-rw-r--r--lib/safe-alloc.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/safe-alloc.h b/lib/safe-alloc.h
index 3fa3f2eed8..f07ee916c7 100644
--- a/lib/safe-alloc.h
+++ b/lib/safe-alloc.h
@@ -26,6 +26,15 @@
# 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__))