From: David Lutterkort Date: Tue, 3 Mar 2009 01:51:11 +0000 (+0100) Subject: Fix compilation error on non-glibc systems. X-Git-Tag: v0.1~6233 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=87bbc7a54407183623f0bcee3b5cb35c34b95e93;p=gnulib.git Fix compilation error on non-glibc systems. --- diff --git a/ChangeLog b/ChangeLog index 944f4ab89..b3e2b3bb8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-03-02 David Lutterkort + + * lib/safe-alloc.h (__GNUC_PREREQ): New macro. + Reported by Tom G. Christensen . + 2009-03-02 Bruno Haible * doc/gnulib.texi (Exported Symbols of Shared Libraries): New section. diff --git a/lib/safe-alloc.h b/lib/safe-alloc.h index 3fa3f2eed..f07ee916c 100644 --- a/lib/safe-alloc.h +++ b/lib/safe-alloc.h @@ -26,6 +26,15 @@ # include +#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__))