regex: fix build failure
authorEric Blake <ebb9@byu.net>
Thu, 28 Jan 2010 13:46:05 +0000 (06:46 -0700)
committerEric Blake <ebb9@byu.net>
Thu, 28 Jan 2010 13:46:48 +0000 (06:46 -0700)
* lib/regex_internal.h (__GNUC_PREREQ): Define for non-glibc
platforms.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
lib/regex_internal.h

index c3cb300..3843078 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-01-28  Eric Blake  <ebb9@byu.net>
+
+       regex: fix build failure
+       * lib/regex_internal.h (__GNUC_PREREQ): Define for non-glibc
+       platforms.
+
 2010-01-28  Jim Meyering  <meyering@redhat.com>
 
        regex: do not ignore memory allocation failure
index 704d1cc..e1b4c61 100644 (file)
@@ -851,6 +851,15 @@ re_string_elem_size_at (const re_string_t *pstr, Idx idx)
 }
 #endif /* RE_ENABLE_I18N */
 
+#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
+
 #if __GNUC_PREREQ (3,4)
 # undef __attribute_warn_unused_result__
 # define __attribute_warn_unused_result__ \