# HG changeset patch # User Eric Blake # Date 1264686365 25200 # Node ID 7217c0b5595d87cd8189bc5acc3158672448b561 # Parent baafee3ff85b4629cc3547be377c97621c636972 regex: fix build failure * lib/regex_internal.h (__GNUC_PREREQ): Define for non-glibc platforms. Signed-off-by: Eric Blake diff --git a/ChangeLog b/ChangeLog --- 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 --- a/lib/regex_internal.h +++ b/lib/regex_internal.h @@ -851,6 +851,15 @@ } #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__ \