# HG changeset patch # User Paul Eggert # Date 1127622016 0 # Node ID ac6a92dc851dd78e2c65586f9656f54b5dc09c5b # Parent 26aeca19bf5ebfdbd9f0eb78f23949c473d7e701 * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure): Remove. (__attribute): Define to empty unless GCC 3.1 or later. This works around a core dump on OpenBSD 3.4, which has GCC 2.95.3, which dumps core when given __attribute__(()). It also simplifies other tests, since we really don't want to bother with worrying about which ancient version of GCC supported what. Original problem reported by Yoann Vandoorselaere, with part of the fix suggested by Derek Price. diff --git a/lib/ChangeLog b/lib/ChangeLog --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,8 +1,14 @@ 2005-09-24 Paul Eggert - * regex_internal.h (__attribute): Define to nothing for GCC 2. + * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure): + Remove. + (__attribute): Define to empty unless GCC 3.1 or later. This works around a core dump on OpenBSD 3.4, which has GCC - 2.95.3, which dumps core when given __attribute__(()). + 2.95.3, which dumps core when given __attribute__(()). It also + simplifies other tests, since we really don't want to bother with + worrying about which ancient version of GCC supported what. + Original problem reported by Yoann Vandoorselaere, with part of + the fix suggested by Derek Price. 2005-09-24 Jim Meyering diff --git a/lib/regex_internal.h b/lib/regex_internal.h --- a/lib/regex_internal.h +++ b/lib/regex_internal.h @@ -88,25 +88,10 @@ # define RE_ENABLE_I18N #endif -#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, 1) -# define always_inline -#endif - #if __GNUC__ >= 3 # define BE(expr, val) __builtin_expect (expr, val) #else # define BE(expr, val) (expr) -# define inline -# define pure #endif /* Number of single byte character. */ @@ -131,7 +116,7 @@ # define attribute_hidden #endif /* not _LIBC */ -#if __GNUC__ >= 3 +#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) # define __attribute(arg) __attribute__ (arg) #else # define __attribute(arg)