From e296359d39962cfd1f8b15877ada83d95878fdd7 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Thu, 28 Jan 2010 06:46:05 -0700 Subject: [PATCH] regex: fix build failure * lib/regex_internal.h (__GNUC_PREREQ): Define for non-glibc platforms. Signed-off-by: Eric Blake --- ChangeLog | 6 ++++++ lib/regex_internal.h | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/ChangeLog b/ChangeLog index c3cb30046b..3843078301 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-01-28 Eric Blake + + regex: fix build failure + * lib/regex_internal.h (__GNUC_PREREQ): Define for non-glibc + platforms. + 2010-01-28 Jim Meyering regex: do not ignore memory allocation failure diff --git a/lib/regex_internal.h b/lib/regex_internal.h index 704d1cc9d6..e1b4c61b36 100644 --- a/lib/regex_internal.h +++ b/lib/regex_internal.h @@ -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__ \ -- 2.30.2