/* Version 2.4 and later of GCC define a magical variable `__PRETTY_FUNCTION__'
which contains the name of the function currently being defined.
-# define __ASSERT_FUNCTION __PRETTY_FUNCTION__
This is broken in G++ before version 2.6.
C9x has a similar variable called __func__, but prefer the GCC one since
it demangles C++ function names. */
-# ifdef __GNUC__
-# if __GNUC__ > 2 || (__GNUC__ == 2 \
- && __GNUC_MINOR__ >= (defined __cplusplus ? 6 : 4))
+# if __GNUC_PREREQ (2, (defined __cplusplus ? 6 : 4))
# define __ASSERT_FUNCTION __PRETTY_FUNCTION__
-# else
-# define __ASSERT_FUNCTION ((__const char *) 0)
-# endif
# else
# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
# define __ASSERT_FUNCTION __func__
# define dgettext(domainname, msgid) \
dcgettext (domainname, msgid, LC_MESSAGES)
-# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
+# if __GNUC_PREREQ (2,7)
/* Variable defined in loadmsgcat.c which gets incremented every time a
new catalog is loaded. */
extern int _nl_msg_cat_cntr;
/* We might need to add support for more compilers here. But once ISO
C 9X is out hopefully all maintained compilers will provide the data
types `float complex' and `double complex'. */
-#if (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) || __GNUC__ > 2
+#if __GNUC_PREREQ (2, 7)
# define _Complex __complex__
#endif
do not try this for now and instead concentrate only on GNU CC. Once
we have more information support for other compilers might follow. */
-#if defined __GNUC__ && (__GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ >= 7)
+#if __GNUC_PREREQ (2, 7)
/* We have two kinds of generic macros: to support functions which are
only defined on real valued parameters and those which are defined
/* GCC can always grok prototypes. For C++ programs we add throw()
to help it optimize the function calls. But this works only with
gcc 2.8.x and egcs. */
-# if defined __cplusplus && (__GNUC__ >= 3 || __GNUC_MINOR__ >= 8)
+# if defined __cplusplus && __GNUC_PREREQ (2,8)
# define __THROW throw ()
# else
# define __THROW
/* This macro will be used for functions which might take C++ callback
functions. */
# define __PMT(args) args
+
# define __DOTS , ...
#else /* Not GCC. */
/*
#elif __SOME_OTHER_COMPILER__
-# define __attribute__(xyz)
# define __REDIRECT(name, proto, alias) name proto; \
_Pragma("let " #name " = " #alias)
*/
run in pedantic mode if the uses are carefully marked using the
`__extension__' keyword. But this is not generally available before
version 2.8. */
-#if !defined __GNUC__ || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8)
-
+#if !__GNUC_PREREQ (2,8)
# define __extension__ /* Ignore */
-
#endif
/* __restrict is known in EGCS 1.2 and above. */
-#if !defined __GNUC__ || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 92)
-
+#if !__GNUC_PREREQ (2,92)
# define __restrict /* Ignore */
-
#endif
#endif /* sys/cdefs.h */
/* These size-specific names are used by some of the inet code. */
-#if !defined __GNUC__ || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
+#if !__GNUC_PREREQ (2, 7)
/* These types are defined by the ISO C 9x header <inttypes.h>. */
# ifndef __int8_t_defined
uses with any of the listed types to be allowed without complaint.
G++ 2.7 does not support transparent unions so there we want the
old-style declaration, too. */
-#if (!defined __GNUC__ || __GNUC__ < 2 || defined __cplusplus || \
- (__GNUC__ == 2 && __GNUC_MINOR__ < 7))
+#if defined __cplusplus || !__GNUC_PREREQ (2, 7)
# define __SOCKADDR_ARG struct sockaddr *
# define __CONST_SOCKADDR_ARG __const struct sockaddr *
#else
: memset (s, c, n)))
# endif
-/* GCC optimizes memset(s, 0, n) but not bzero(s, n). */
-#if defined __GNUC__ \
- && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 90))
+/* GCC optimizes memset(s, 0, n) but not bzero(s, n).
+ The optimization is broken before EGCS 1.1. */
+#if __GNUC_PREREQ (2, 91)
# define __bzero(s, n) __builtin_memset (s, '\0', n)
# endif
#undef __MATH_INLINE_copysign
-#if defined __GNUC__ && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8))
+#if __GNUC_PREREQ (2, 8)
__MATH_INLINE float __fabsf (float __x) { return __builtin_fabsf (__x); }
__MATH_INLINE float fabsf (float __x) { return __builtin_fabsf (__x); }
__MATH_INLINE double __fabs (double __x) { return __builtin_fabs (__x); }
/* The gcc, version 2.7 or below, has problems with all this inlining
code. So disable it for this version of the compiler. */
-#if defined __GNUC__ && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 7))
+#if __GNUC_PREREQ (2, 8)
#if ((!defined __NO_MATH_INLINES || defined __LIBC_INTERNAL_MATH_INLINES) \
&& defined __OPTIMIZE__)
__inline_mathop (sqrt, "fsqrt")
__inline_mathop_ (long double, __sqrtl, "fsqrt")
-#if defined __GNUC__ && (__GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ >= 8)
+#if __GNUC_PREREQ (2, 8)
__inline_mathcode_ (double, fabs, __x, return __builtin_fabs (__x))
__inline_mathcode_ (float, fabsf, __x, return __builtin_fabsf (__x))
__inline_mathcode_ (long double, fabsl, __x, return __builtin_fabsl (__x))