bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] * lib/safe-alloc.h (__GNUC_PREREQ): define if not already define


From: David Lutterkort
Subject: [PATCH] * lib/safe-alloc.h (__GNUC_PREREQ): define if not already defined
Date: Mon, 2 Mar 2009 16:36:54 -0800

---
 lib/safe-alloc.h |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/lib/safe-alloc.h b/lib/safe-alloc.h
index 3fa3f2e..f07ee91 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__))
-- 
1.6.0.6





reply via email to

[Prev in Thread] Current Thread [Next in Thread]