* regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 25 Sep 2005 04:20:16 +0000 (04:20 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 25 Sep 2005 04:20:16 +0000 (04:20 +0000)
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.

lib/ChangeLog
lib/regex_internal.h

index a1ab6ad..ba902ab 100644 (file)
@@ -1,8 +1,14 @@
 2005-09-24  Paul Eggert  <eggert@cs.ucla.edu>
 
-       * 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  <jim@meyering.net>
 
index 3616473..a36ae4c 100644 (file)
 # 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.  */
 # 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)