diff options
author | Joseph Myers <jsm@polyomino.org.uk> | 2004-08-05 01:38:31 +0100 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2004-08-05 01:38:31 +0100 |
commit | 852910694f6d4480afd733a62fd6b93de62b51e6 (patch) | |
tree | 06690c205a19e52eb65cb0ac2b6391e8c47bc57c /gcc/testsuite/gcc.dg/format | |
parent | 5a05b7c5dad390be66339c575ea4623dfb55cf57 (diff) | |
download | gcc-852910694f6d4480afd733a62fd6b93de62b51e6.zip gcc-852910694f6d4480afd733a62fd6b93de62b51e6.tar.gz gcc-852910694f6d4480afd733a62fd6b93de62b51e6.tar.bz2 |
c-common.c (c_stddef_cpp_builtins): Define __INTMAX_TYPE__ and __UINTMAX_TYPE__.
* c-common.c (c_stddef_cpp_builtins): Define __INTMAX_TYPE__ and
__UINTMAX_TYPE__.
* c-cppbuiltin.c (builtin_define_stdint_macros): New. Define
__INTMAX_MAX__.
(c_cpp_builtins): Call it.
* doc/cpp.texi: Update.
testsuite:
* gcc.c-torture/execute/builtins/abs-2.c,
gcc.c-torture/execute/builtins/abs-3.c,
gcc.c-torture/execute/builtins/lib/abs.c, gcc.dg/format/format.h,
gcc.dg/torture/builtin-attr-1.c: Use predefined macros for
intmax_t, uintmax_t and their limits.
* gcc.dg/intmax_t-1.c: New test.
From-SVN: r85588
Diffstat (limited to 'gcc/testsuite/gcc.dg/format')
-rw-r--r-- | gcc/testsuite/gcc.dg/format/format.h | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/gcc/testsuite/gcc.dg/format/format.h b/gcc/testsuite/gcc.dg/format/format.h index 230d141..0ded1e0 100644 --- a/gcc/testsuite/gcc.dg/format/format.h +++ b/gcc/testsuite/gcc.dg/format/format.h @@ -28,31 +28,8 @@ __extension__ typedef unsigned long long int ullong; typedef llong quad_t; typedef ullong u_quad_t; -/* This next definition is a kludge. When GCC has a <stdint.h> it - should be used. -*/ -/* (T *) if E is zero, (void *) otherwise. */ -#define type_if_not(T, E) __typeof__(0 ? (T *)0 : (void *)(E)) - -/* (T *) if E is nonzero, (void *) otherwise. */ -#define type_if(T, E) type_if_not(T, !(E)) - -/* Combine pointer types, all but one (void *). */ -#define type_comb2(T1, T2) __typeof__(0 ? (T1)0 : (T2)0) -#define type_comb3(T1, T2, T3) type_comb2(T1, type_comb2(T2, T3)) - -#define maybe_int_ptr type_if(int, sizeof(int) == sizeof(llong)) -#define maybe_uint_ptr type_if(unsigned int, sizeof(unsigned int) == sizeof(ullong)) -#define maybe_long_ptr type_if(long, sizeof(long) == sizeof(llong) && sizeof(long) > sizeof(int)) -#define maybe_ulong_ptr type_if(unsigned long, sizeof(unsigned long) == sizeof(ullong) && sizeof(unsigned long) > sizeof(unsigned int)) -#define maybe_long_long_ptr type_if(llong, sizeof(llong) > sizeof(long)) -#define maybe_ulong_long_ptr type_if(ullong, sizeof(ullong) > sizeof(unsigned long)) - -#define intmax_type_ptr type_comb3(maybe_int_ptr, maybe_long_ptr, maybe_long_long_ptr) -#define uintmax_type_ptr type_comb3(maybe_uint_ptr, maybe_ulong_ptr, maybe_ulong_long_ptr) - -typedef __typeof__(*((intmax_type_ptr)0)) intmax_t; -typedef __typeof__(*((uintmax_type_ptr)0)) uintmax_t; +__extension__ typedef __INTMAX_TYPE__ intmax_t; +__extension__ typedef __UINTMAX_TYPE__ uintmax_t; #if __STDC_VERSION__ < 199901L #define restrict /* "restrict" not in old C standard. */ |