Skip to content

Commit 6a12299

Browse files
committed
Fix remaining tests of __GNUC_MINOR__ to use __GNUC_PREREQ instead
1 parent 66f5661 commit 6a12299

File tree

9 files changed

+14
-15
lines changed

9 files changed

+14
-15
lines changed

argp/argp-fmtstream.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@
3131

3232
#ifndef __attribute__
3333
/* This feature is available in gcc versions 2.5 and later. */
34-
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
34+
# if !__GNUC_PREREQ(2,5) || __STRICT_ANSI__
3535
# define __attribute__(Spec) /* empty */
3636
# endif
3737
/* The __-protected variants of `format' and `printf' attributes
3838
are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
39-
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) || __STRICT_ANSI__
39+
# if !__GNUC_PREREQ(2,7) || __STRICT_ANSI__
4040
# define __format__ format
4141
# define __printf__ printf
4242
# endif

include/argp.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@
4242

4343
#ifndef __attribute__
4444
/* This feature is available in gcc versions 2.5 and later. */
45-
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
45+
# if !__GNUC_PREREQ(2,5) || __STRICT_ANSI__
4646
# define __attribute__(Spec) /* empty */
4747
# endif
4848
/* The __-protected variants of `format' and `printf' attributes
4949
are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
50-
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) || __STRICT_ANSI__
50+
# if !__GNUC_PREREQ(2,7) || __STRICT_ANSI__
5151
# define __format__ format
5252
# define __printf__ printf
5353
# endif
@@ -56,7 +56,7 @@
5656
/* GCC 2.95 and later have "__restrict"; C99 compilers have
5757
"restrict", and "configure" may have defined "restrict". */
5858
#ifndef __restrict
59-
# if ! (2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__))
59+
# if !__GNUC_PREREQ(2,95)
6060
# if defined restrict || 199901L <= __STDC_VERSION__
6161
# define __restrict restrict
6262
# else

include/assert.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,7 @@ __END_DECLS
9696
/* Version 2.4 and later of GCC define a magical variable `__PRETTY_FUNCTION__'
9797
which contains the name of the function currently being defined.
9898
This is broken in G++ before version 2.6. */
99-
# if (!defined __GNUC__ || __GNUC__ < 2 || \
100-
(__GNUC__ == 2 && __GNUC_MINOR__ < (defined __cplusplus ? 6 : 4)))
99+
# if (!(defined(__cplusplus) ? __GNUC_PREREQ(2,6) : __GNUC_PREREQ(2,4)))
101100
# define __ASSERT_FUNCTION ((const char *) 0)
102101
# else
103102
# define __ASSERT_FUNCTION __PRETTY_FUNCTION__

include/error.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323

2424
#ifndef __attribute__
2525
/* This feature is available in gcc versions 2.5 and later. */
26-
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
26+
# if !__GNUC_PREREQ(2,5) || __STRICT_ANSI__
2727
# define __attribute__(Spec) /* empty */
2828
# endif
2929
/* The __-protected variants of `format' and `printf' attributes
3030
are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
31-
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
31+
# if !__GNUC_PREREQ(2,7) || __STRICT_ANSI__
3232
# define __format__ format
3333
# define __printf__ printf
3434
# endif

include/obstack.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ extern int obstack_exit_failure;
346346
/* NextStep 2.0 cc is really gcc 1.93 but it defines __GNUC__ = 2 and
347347
does not implement __extension__. But that compiler doesn't define
348348
__GNUC_MINOR__. */
349-
# if __GNUC__ < 2 || (__NeXT__ && !__GNUC_MINOR__)
349+
# if !__GNUC_PREREQ(2,0)
350350
# define __extension__
351351
# endif
352352

include/sys/types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ typedef unsigned int uint;
131131

132132
/* These size-specific names are used by some of the inet code. */
133133

134-
#if !defined __GNUC__ || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
134+
#if !__GNUC_PREREQ(2,7)
135135

136136
/* These types are defined by the ISO C 9x header <inttypes.h>. */
137137
# ifndef __int8_t_defined

mintlib/libc-symbols.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@
175175

176176
/* Currently disabled since not supported by gcc for MiNT. FIXME!!! */
177177
#if (0 && !defined __ASSEMBLER__ && \
178-
(__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)))
178+
(__GNUC_PREREQ(2,7)))
179179
/* GCC 2.7 and later has special syntax for weak symbols and aliases.
180180
Using that is better when possible, because the compiler and assembler
181181
are better clued in to what we are doing. */

stdlib/longlong.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ extern USItype __udiv_qrnnd ();
656656
#endif /* __m88000__ */
657657

658658
#if defined (__mips__) && W_TYPE_SIZE == 32
659-
#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7
659+
#if __GNUC_PREREQ(2,7)
660660
#define umul_ppmm(w1, w0, u, v) \
661661
__asm__ ("multu %2,%3" \
662662
: "=l" ((USItype)(w0)), \
@@ -678,7 +678,7 @@ extern USItype __udiv_qrnnd ();
678678
#endif /* __mips__ */
679679

680680
#if (defined (__mips) && __mips >= 3) && W_TYPE_SIZE == 64
681-
#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7
681+
#if __GNUC_PREREQ(2,7)
682682
#define umul_ppmm(w1, w0, u, v) \
683683
__asm__ ("dmultu %2,%3" \
684684
: "=l" ((UDItype)(w0)), \

stdlib/strtol.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@
130130
# define STRTOL_LONG_MIN LONG_LONG_MIN
131131
# define STRTOL_LONG_MAX LONG_LONG_MAX
132132
# define STRTOL_ULONG_MAX ULONG_LONG_MAX
133-
# if __GNUC__ == 2 && __GNUC_MINOR__ < 7
133+
# if defined(__GNUC__) && !__GNUC_PREREQ(2,7)
134134
/* Work around gcc bug with using this constant. */
135135
static const unsigned long long int maxquad = ULONG_LONG_MAX;
136136
# undef STRTOL_ULONG_MAX

0 commit comments

Comments
 (0)