gcc/gcc/ginclude/stdint-gcc.h

365 lines
9.2 KiB
C
Raw Permalink Normal View History

/* Copyright (C) 2008-2017 Free Software Foundation, Inc.
re PR c/448 (<stdint.h>-related issues (C99 issues)) PR c/448 fixincludes: * inclhack.def (newlib_stdint_1, newlib_stdint_2): New fixes. * fixincl.x: Regenerate. * tests/base/stdint.h: Update. gcc: * Makefile.in (USE_GCC_STDINT): Define. (stmp-int-hdrs): Install stdint.h if applicable. * c-common.c (CHAR16_TYPE): Define in terms of UINT_LEAST16_TYPE if known. (CHAR32_TYPE): Define in terms of UINT_LEAST32_TYPE if known. (SIG_ATOMIC_TYPE, INT8_TYPE, INT16_TYPE, INT32_TYPE, INT64_TYPE, UINT8_TYPE, UINT16_TYPE, UINT32_TYPE, UINT64_TYPE, INT_LEAST8_TYPE, INT_LEAST16_TYPE, INT_LEAST32_TYPE, INT_LEAST64_TYPE, UINT_LEAST8_TYPE, UINT_LEAST16_TYPE, UINT_LEAST32_TYPE, UINT_LEAST64_TYPE, INT_FAST8_TYPE, INT_FAST16_TYPE, INT_FAST32_TYPE, INT_FAST64_TYPE, UINT_FAST8_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE, UINT_FAST64_TYPE, INTPTR_TYPE, UINTPTR_TYPE): Define. (c_common_nodes_and_builtins): Initialize underlying_wchar_type_node. Do not initialize signed_wchar_type_node or unsigned_wchar_type_node. Initialize nodes for new types. (c_stddef_cpp_builtins): Define macros for new types. * c-common.h (CTI_SIGNED_WCHAR_TYPE, CTI_UNSIGNED_WCHAR_TYPE): Remove. (CTI_UNDERLYING_WCHAR_TYPE, CTI_SIG_ATOMIC_TYPE, CTI_INT8_TYPE, CTI_INT16_TYPE, CTI_INT32_TYPE, CTI_INT64_TYPE, CTI_UINT8_TYPE, CTI_UINT16_TYPE, CTI_UINT32_TYPE, CTI_UINT64_TYPE, CTI_INT_LEAST8_TYPE, CTI_INT_LEAST16_TYPE, CTI_INT_LEAST32_TYPE, CTI_INT_LEAST64_TYPE, CTI_UINT_LEAST8_TYPE, CTI_UINT_LEAST16_TYPE, CTI_UINT_LEAST32_TYPE, CTI_UINT_LEAST64_TYPE, CTI_INT_FAST8_TYPE, CTI_INT_FAST16_TYPE, CTI_INT_FAST32_TYPE, CTI_INT_FAST64_TYPE, CTI_UINT_FAST8_TYPE, CTI_UINT_FAST16_TYPE, CTI_UINT_FAST32_TYPE, CTI_UINT_FAST64_TYPE, CTI_INTPTR_TYPE, CTI_UINTPTR_TYPE): Define. (signed_wchar_type_node, unsigned_wchar_type_node): Remove. (underlying_wchar_type_node, sig_atomic_type_node, int8_type_node, int16_type_node, int32_type_node, int64_type_node, uint8_type_node, uint16_type_node, c_uint32_type_node, c_uint64_type_node, int_least8_type_node, int_least16_type_node, int_least32_type_node, int_least64_type_node, uint_least8_type_node, uint_least16_type_node, uint_least32_type_node, uint_least64_type_node, int_fast8_type_node, int_fast16_type_node, int_fast32_type_node, int_fast64_type_node, uint_fast8_type_node, uint_fast16_type_node, uint_fast32_type_node, uint_fast64_type_node, intptr_type_node, uintptr_type_node): Define. * c-cppbuiltin.c (builtin_define_constants, builtin_define_type_minmax): New. (builtin_define_stdint_macros): Define more macros. (c_cpp_builtins): Define more limit macros. (type_suffix): New. (builtin_define_type_max): Define in terms of builtin_define_type_minmax. Remove is_long parameter. All callers changed. * config.gcc (use_gcc_stdint): Define. (tm_file): Add glibc-stdint.h for targets using glibc or uClibc. Add newlib-stdint.h for generic targets. * config/glibc-stdint.h, config/newlib-stdint.h, ginclude/stdint-gcc.h, ginclude/stdint-wrap.h: New. * config/m32c/m32c.h (UINTPTR_TYPE): Define. * config/score/score.h (UINTPTR_TYPE): Define. * config/sol2.h (SIG_ATOMIC_TYPE, INT8_TYPE, INT16_TYPE, INT32_TYPE, INT64_TYPE, UINT8_TYPE, UINT16_TYPE, UINT32_TYPE, UINT64_TYPE, INT_LEAST8_TYPE, INT_LEAST16_TYPE, INT_LEAST32_TYPE, INT_LEAST64_TYPE, UINT_LEAST8_TYPE, UINT_LEAST16_TYPE, UINT_LEAST32_TYPE, UINT_LEAST64_TYPE, INT_FAST8_TYPE, INT_FAST16_TYPE, INT_FAST32_TYPE, INT_FAST64_TYPE, UINT_FAST8_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE, UINT_FAST64_TYPE, INTPTR_TYPE, UINTPTR_TYPE): Define. * config/spu/spu.h (STDINT_LONG32): Define. * configure.ac (use_gcc_stdint): Substitute. * configure: Regenerate. * doc/cpp.texi (__SIG_ATOMIC_TYPE__, __INT8_TYPE__, __INT16_TYPE__, __INT32_TYPE__, __INT64_TYPE__, __UINT8_TYPE__, __UINT16_TYPE__, __UINT32_TYPE__, __UINT64_TYPE__, __INT_LEAST8_TYPE__, __INT_LEAST16_TYPE__, __INT_LEAST32_TYPE__, __INT_LEAST64_TYPE__, __UINT_LEAST8_TYPE__, __UINT_LEAST16_TYPE__, __UINT_LEAST32_TYPE_, __UINT_LEAST64_TYPE__, __INT_FAST8_TYPE__, __INT_FAST16_TYPE__, __INT_FAST32_TYPE__, __INT_FAST64_TYPE__, __UINT_FAST8_TYPE__, __UINT_FAST16_TYPE__, __UINT_FAST32_TYPE__, __UINT_FAST64_TYPE__, __INTPTR_TYPE__, __UINTPTR_TYPE__, __WINT_MAX__, __SIZE_MAX__, __PTRDIFF_MAX__, __UINTMAX_MAX__, __SIG_ATOMIC_MAX__, __INT8_MAX__, __INT16_MAX__, __INT32_MAX__, __INT64_MAX__, __UINT8_MAX__, __UINT16_MAX__, __UINT32_MAX__, __UINT64_MAX__, __INT_LEAST8_MAX__, __INT_LEAST16_MAX__, __INT_LEAST32_MAX__, __INT_LEAST64_MAX__, __UINT_LEAST8_MAX__, __UINT_LEAST16_MAX__, __UINT_LEAST32_MAX__, __UINT_LEAST64_MAX__, __INT_FAST8_MAX__, __INT_FAST16_MAX__, __INT_FAST32_MAX__, __INT_FAST64_MAX__, __UINT_FAST8_MAX__, __UINT_FAST16_MAX__, __UINT_FAST32_MAX__, __UINT_FAST64_MAX__, __INTPTR_MAX__, __UINTPTR_MAX__, __WCHAR_MIN__, __WINT_MIN__, __SIG_ATOMIC_MIN__, __INT8_C, __INT16_C, __INT32_C, __INT64_C, __UINT8_C, __UINT16_C, __UINT32_C, __UINT64_C, __INTMAX_C, __UINTMAX_C): Document. * doc/tm.texi (SIG_ATOMIC_TYPE, INT8_TYPE, INT16_TYPE, INT32_TYPE, INT64_TYPE, UINT8_TYPE, UINT16_TYPE, UINT32_TYPE, UINT64_TYPE, INT_LEAST8_TYPE, INT_LEAST16_TYPE, INT_LEAST32_TYPE, INT_LEAST64_TYPE, UINT_LEAST8_TYPE, UINT_LEAST16_TYPE, UINT_LEAST32_TYPE, UINT_LEAST64_TYPE, INT_FAST8_TYPE, INT_FAST16_TYPE, INT_FAST32_TYPE, INT_FAST64_TYPE, UINT_FAST8_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE, UINT_FAST64_TYPE, INTPTR_TYPE, UINTPTR_TYPE): Document. gcc/testsuite: * lib/target-supports.exp (check_effective_target_stdint_types): Update comment. (check_effective_target_inttypes_types): New. * gcc.dg/c99-stdint-1.c, gcc.dg/c99-stdint-2.c, gcc.dg/c99-stdint-3.c, gcc.dg/c99-stdint-4.c, gcc.dg/c99-stdint-5.c, gcc.dg/c99-stdint-6.c: New tests. From-SVN: r145372
2009-03-31 22:30:31 +02:00
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
re PR c/448 (<stdint.h>-related issues (C99 issues)) PR c/448 fixincludes: * inclhack.def (newlib_stdint_1, newlib_stdint_2): New fixes. * fixincl.x: Regenerate. * tests/base/stdint.h: Update. gcc: * Makefile.in (USE_GCC_STDINT): Define. (stmp-int-hdrs): Install stdint.h if applicable. * c-common.c (CHAR16_TYPE): Define in terms of UINT_LEAST16_TYPE if known. (CHAR32_TYPE): Define in terms of UINT_LEAST32_TYPE if known. (SIG_ATOMIC_TYPE, INT8_TYPE, INT16_TYPE, INT32_TYPE, INT64_TYPE, UINT8_TYPE, UINT16_TYPE, UINT32_TYPE, UINT64_TYPE, INT_LEAST8_TYPE, INT_LEAST16_TYPE, INT_LEAST32_TYPE, INT_LEAST64_TYPE, UINT_LEAST8_TYPE, UINT_LEAST16_TYPE, UINT_LEAST32_TYPE, UINT_LEAST64_TYPE, INT_FAST8_TYPE, INT_FAST16_TYPE, INT_FAST32_TYPE, INT_FAST64_TYPE, UINT_FAST8_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE, UINT_FAST64_TYPE, INTPTR_TYPE, UINTPTR_TYPE): Define. (c_common_nodes_and_builtins): Initialize underlying_wchar_type_node. Do not initialize signed_wchar_type_node or unsigned_wchar_type_node. Initialize nodes for new types. (c_stddef_cpp_builtins): Define macros for new types. * c-common.h (CTI_SIGNED_WCHAR_TYPE, CTI_UNSIGNED_WCHAR_TYPE): Remove. (CTI_UNDERLYING_WCHAR_TYPE, CTI_SIG_ATOMIC_TYPE, CTI_INT8_TYPE, CTI_INT16_TYPE, CTI_INT32_TYPE, CTI_INT64_TYPE, CTI_UINT8_TYPE, CTI_UINT16_TYPE, CTI_UINT32_TYPE, CTI_UINT64_TYPE, CTI_INT_LEAST8_TYPE, CTI_INT_LEAST16_TYPE, CTI_INT_LEAST32_TYPE, CTI_INT_LEAST64_TYPE, CTI_UINT_LEAST8_TYPE, CTI_UINT_LEAST16_TYPE, CTI_UINT_LEAST32_TYPE, CTI_UINT_LEAST64_TYPE, CTI_INT_FAST8_TYPE, CTI_INT_FAST16_TYPE, CTI_INT_FAST32_TYPE, CTI_INT_FAST64_TYPE, CTI_UINT_FAST8_TYPE, CTI_UINT_FAST16_TYPE, CTI_UINT_FAST32_TYPE, CTI_UINT_FAST64_TYPE, CTI_INTPTR_TYPE, CTI_UINTPTR_TYPE): Define. (signed_wchar_type_node, unsigned_wchar_type_node): Remove. (underlying_wchar_type_node, sig_atomic_type_node, int8_type_node, int16_type_node, int32_type_node, int64_type_node, uint8_type_node, uint16_type_node, c_uint32_type_node, c_uint64_type_node, int_least8_type_node, int_least16_type_node, int_least32_type_node, int_least64_type_node, uint_least8_type_node, uint_least16_type_node, uint_least32_type_node, uint_least64_type_node, int_fast8_type_node, int_fast16_type_node, int_fast32_type_node, int_fast64_type_node, uint_fast8_type_node, uint_fast16_type_node, uint_fast32_type_node, uint_fast64_type_node, intptr_type_node, uintptr_type_node): Define. * c-cppbuiltin.c (builtin_define_constants, builtin_define_type_minmax): New. (builtin_define_stdint_macros): Define more macros. (c_cpp_builtins): Define more limit macros. (type_suffix): New. (builtin_define_type_max): Define in terms of builtin_define_type_minmax. Remove is_long parameter. All callers changed. * config.gcc (use_gcc_stdint): Define. (tm_file): Add glibc-stdint.h for targets using glibc or uClibc. Add newlib-stdint.h for generic targets. * config/glibc-stdint.h, config/newlib-stdint.h, ginclude/stdint-gcc.h, ginclude/stdint-wrap.h: New. * config/m32c/m32c.h (UINTPTR_TYPE): Define. * config/score/score.h (UINTPTR_TYPE): Define. * config/sol2.h (SIG_ATOMIC_TYPE, INT8_TYPE, INT16_TYPE, INT32_TYPE, INT64_TYPE, UINT8_TYPE, UINT16_TYPE, UINT32_TYPE, UINT64_TYPE, INT_LEAST8_TYPE, INT_LEAST16_TYPE, INT_LEAST32_TYPE, INT_LEAST64_TYPE, UINT_LEAST8_TYPE, UINT_LEAST16_TYPE, UINT_LEAST32_TYPE, UINT_LEAST64_TYPE, INT_FAST8_TYPE, INT_FAST16_TYPE, INT_FAST32_TYPE, INT_FAST64_TYPE, UINT_FAST8_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE, UINT_FAST64_TYPE, INTPTR_TYPE, UINTPTR_TYPE): Define. * config/spu/spu.h (STDINT_LONG32): Define. * configure.ac (use_gcc_stdint): Substitute. * configure: Regenerate. * doc/cpp.texi (__SIG_ATOMIC_TYPE__, __INT8_TYPE__, __INT16_TYPE__, __INT32_TYPE__, __INT64_TYPE__, __UINT8_TYPE__, __UINT16_TYPE__, __UINT32_TYPE__, __UINT64_TYPE__, __INT_LEAST8_TYPE__, __INT_LEAST16_TYPE__, __INT_LEAST32_TYPE__, __INT_LEAST64_TYPE__, __UINT_LEAST8_TYPE__, __UINT_LEAST16_TYPE__, __UINT_LEAST32_TYPE_, __UINT_LEAST64_TYPE__, __INT_FAST8_TYPE__, __INT_FAST16_TYPE__, __INT_FAST32_TYPE__, __INT_FAST64_TYPE__, __UINT_FAST8_TYPE__, __UINT_FAST16_TYPE__, __UINT_FAST32_TYPE__, __UINT_FAST64_TYPE__, __INTPTR_TYPE__, __UINTPTR_TYPE__, __WINT_MAX__, __SIZE_MAX__, __PTRDIFF_MAX__, __UINTMAX_MAX__, __SIG_ATOMIC_MAX__, __INT8_MAX__, __INT16_MAX__, __INT32_MAX__, __INT64_MAX__, __UINT8_MAX__, __UINT16_MAX__, __UINT32_MAX__, __UINT64_MAX__, __INT_LEAST8_MAX__, __INT_LEAST16_MAX__, __INT_LEAST32_MAX__, __INT_LEAST64_MAX__, __UINT_LEAST8_MAX__, __UINT_LEAST16_MAX__, __UINT_LEAST32_MAX__, __UINT_LEAST64_MAX__, __INT_FAST8_MAX__, __INT_FAST16_MAX__, __INT_FAST32_MAX__, __INT_FAST64_MAX__, __UINT_FAST8_MAX__, __UINT_FAST16_MAX__, __UINT_FAST32_MAX__, __UINT_FAST64_MAX__, __INTPTR_MAX__, __UINTPTR_MAX__, __WCHAR_MIN__, __WINT_MIN__, __SIG_ATOMIC_MIN__, __INT8_C, __INT16_C, __INT32_C, __INT64_C, __UINT8_C, __UINT16_C, __UINT32_C, __UINT64_C, __INTMAX_C, __UINTMAX_C): Document. * doc/tm.texi (SIG_ATOMIC_TYPE, INT8_TYPE, INT16_TYPE, INT32_TYPE, INT64_TYPE, UINT8_TYPE, UINT16_TYPE, UINT32_TYPE, UINT64_TYPE, INT_LEAST8_TYPE, INT_LEAST16_TYPE, INT_LEAST32_TYPE, INT_LEAST64_TYPE, UINT_LEAST8_TYPE, UINT_LEAST16_TYPE, UINT_LEAST32_TYPE, UINT_LEAST64_TYPE, INT_FAST8_TYPE, INT_FAST16_TYPE, INT_FAST32_TYPE, INT_FAST64_TYPE, UINT_FAST8_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE, UINT_FAST64_TYPE, INTPTR_TYPE, UINTPTR_TYPE): Document. gcc/testsuite: * lib/target-supports.exp (check_effective_target_stdint_types): Update comment. (check_effective_target_inttypes_types): New. * gcc.dg/c99-stdint-1.c, gcc.dg/c99-stdint-2.c, gcc.dg/c99-stdint-3.c, gcc.dg/c99-stdint-4.c, gcc.dg/c99-stdint-5.c, gcc.dg/c99-stdint-6.c: New tests. From-SVN: r145372
2009-03-31 22:30:31 +02:00
any later version.
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Under Section 7 of GPL version 3, you are granted additional
permissions described in the GCC Runtime Library Exception, version
3.1, as published by the Free Software Foundation.
re PR c/448 (<stdint.h>-related issues (C99 issues)) PR c/448 fixincludes: * inclhack.def (newlib_stdint_1, newlib_stdint_2): New fixes. * fixincl.x: Regenerate. * tests/base/stdint.h: Update. gcc: * Makefile.in (USE_GCC_STDINT): Define. (stmp-int-hdrs): Install stdint.h if applicable. * c-common.c (CHAR16_TYPE): Define in terms of UINT_LEAST16_TYPE if known. (CHAR32_TYPE): Define in terms of UINT_LEAST32_TYPE if known. (SIG_ATOMIC_TYPE, INT8_TYPE, INT16_TYPE, INT32_TYPE, INT64_TYPE, UINT8_TYPE, UINT16_TYPE, UINT32_TYPE, UINT64_TYPE, INT_LEAST8_TYPE, INT_LEAST16_TYPE, INT_LEAST32_TYPE, INT_LEAST64_TYPE, UINT_LEAST8_TYPE, UINT_LEAST16_TYPE, UINT_LEAST32_TYPE, UINT_LEAST64_TYPE, INT_FAST8_TYPE, INT_FAST16_TYPE, INT_FAST32_TYPE, INT_FAST64_TYPE, UINT_FAST8_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE, UINT_FAST64_TYPE, INTPTR_TYPE, UINTPTR_TYPE): Define. (c_common_nodes_and_builtins): Initialize underlying_wchar_type_node. Do not initialize signed_wchar_type_node or unsigned_wchar_type_node. Initialize nodes for new types. (c_stddef_cpp_builtins): Define macros for new types. * c-common.h (CTI_SIGNED_WCHAR_TYPE, CTI_UNSIGNED_WCHAR_TYPE): Remove. (CTI_UNDERLYING_WCHAR_TYPE, CTI_SIG_ATOMIC_TYPE, CTI_INT8_TYPE, CTI_INT16_TYPE, CTI_INT32_TYPE, CTI_INT64_TYPE, CTI_UINT8_TYPE, CTI_UINT16_TYPE, CTI_UINT32_TYPE, CTI_UINT64_TYPE, CTI_INT_LEAST8_TYPE, CTI_INT_LEAST16_TYPE, CTI_INT_LEAST32_TYPE, CTI_INT_LEAST64_TYPE, CTI_UINT_LEAST8_TYPE, CTI_UINT_LEAST16_TYPE, CTI_UINT_LEAST32_TYPE, CTI_UINT_LEAST64_TYPE, CTI_INT_FAST8_TYPE, CTI_INT_FAST16_TYPE, CTI_INT_FAST32_TYPE, CTI_INT_FAST64_TYPE, CTI_UINT_FAST8_TYPE, CTI_UINT_FAST16_TYPE, CTI_UINT_FAST32_TYPE, CTI_UINT_FAST64_TYPE, CTI_INTPTR_TYPE, CTI_UINTPTR_TYPE): Define. (signed_wchar_type_node, unsigned_wchar_type_node): Remove. (underlying_wchar_type_node, sig_atomic_type_node, int8_type_node, int16_type_node, int32_type_node, int64_type_node, uint8_type_node, uint16_type_node, c_uint32_type_node, c_uint64_type_node, int_least8_type_node, int_least16_type_node, int_least32_type_node, int_least64_type_node, uint_least8_type_node, uint_least16_type_node, uint_least32_type_node, uint_least64_type_node, int_fast8_type_node, int_fast16_type_node, int_fast32_type_node, int_fast64_type_node, uint_fast8_type_node, uint_fast16_type_node, uint_fast32_type_node, uint_fast64_type_node, intptr_type_node, uintptr_type_node): Define. * c-cppbuiltin.c (builtin_define_constants, builtin_define_type_minmax): New. (builtin_define_stdint_macros): Define more macros. (c_cpp_builtins): Define more limit macros. (type_suffix): New. (builtin_define_type_max): Define in terms of builtin_define_type_minmax. Remove is_long parameter. All callers changed. * config.gcc (use_gcc_stdint): Define. (tm_file): Add glibc-stdint.h for targets using glibc or uClibc. Add newlib-stdint.h for generic targets. * config/glibc-stdint.h, config/newlib-stdint.h, ginclude/stdint-gcc.h, ginclude/stdint-wrap.h: New. * config/m32c/m32c.h (UINTPTR_TYPE): Define. * config/score/score.h (UINTPTR_TYPE): Define. * config/sol2.h (SIG_ATOMIC_TYPE, INT8_TYPE, INT16_TYPE, INT32_TYPE, INT64_TYPE, UINT8_TYPE, UINT16_TYPE, UINT32_TYPE, UINT64_TYPE, INT_LEAST8_TYPE, INT_LEAST16_TYPE, INT_LEAST32_TYPE, INT_LEAST64_TYPE, UINT_LEAST8_TYPE, UINT_LEAST16_TYPE, UINT_LEAST32_TYPE, UINT_LEAST64_TYPE, INT_FAST8_TYPE, INT_FAST16_TYPE, INT_FAST32_TYPE, INT_FAST64_TYPE, UINT_FAST8_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE, UINT_FAST64_TYPE, INTPTR_TYPE, UINTPTR_TYPE): Define. * config/spu/spu.h (STDINT_LONG32): Define. * configure.ac (use_gcc_stdint): Substitute. * configure: Regenerate. * doc/cpp.texi (__SIG_ATOMIC_TYPE__, __INT8_TYPE__, __INT16_TYPE__, __INT32_TYPE__, __INT64_TYPE__, __UINT8_TYPE__, __UINT16_TYPE__, __UINT32_TYPE__, __UINT64_TYPE__, __INT_LEAST8_TYPE__, __INT_LEAST16_TYPE__, __INT_LEAST32_TYPE__, __INT_LEAST64_TYPE__, __UINT_LEAST8_TYPE__, __UINT_LEAST16_TYPE__, __UINT_LEAST32_TYPE_, __UINT_LEAST64_TYPE__, __INT_FAST8_TYPE__, __INT_FAST16_TYPE__, __INT_FAST32_TYPE__, __INT_FAST64_TYPE__, __UINT_FAST8_TYPE__, __UINT_FAST16_TYPE__, __UINT_FAST32_TYPE__, __UINT_FAST64_TYPE__, __INTPTR_TYPE__, __UINTPTR_TYPE__, __WINT_MAX__, __SIZE_MAX__, __PTRDIFF_MAX__, __UINTMAX_MAX__, __SIG_ATOMIC_MAX__, __INT8_MAX__, __INT16_MAX__, __INT32_MAX__, __INT64_MAX__, __UINT8_MAX__, __UINT16_MAX__, __UINT32_MAX__, __UINT64_MAX__, __INT_LEAST8_MAX__, __INT_LEAST16_MAX__, __INT_LEAST32_MAX__, __INT_LEAST64_MAX__, __UINT_LEAST8_MAX__, __UINT_LEAST16_MAX__, __UINT_LEAST32_MAX__, __UINT_LEAST64_MAX__, __INT_FAST8_MAX__, __INT_FAST16_MAX__, __INT_FAST32_MAX__, __INT_FAST64_MAX__, __UINT_FAST8_MAX__, __UINT_FAST16_MAX__, __UINT_FAST32_MAX__, __UINT_FAST64_MAX__, __INTPTR_MAX__, __UINTPTR_MAX__, __WCHAR_MIN__, __WINT_MIN__, __SIG_ATOMIC_MIN__, __INT8_C, __INT16_C, __INT32_C, __INT64_C, __UINT8_C, __UINT16_C, __UINT32_C, __UINT64_C, __INTMAX_C, __UINTMAX_C): Document. * doc/tm.texi (SIG_ATOMIC_TYPE, INT8_TYPE, INT16_TYPE, INT32_TYPE, INT64_TYPE, UINT8_TYPE, UINT16_TYPE, UINT32_TYPE, UINT64_TYPE, INT_LEAST8_TYPE, INT_LEAST16_TYPE, INT_LEAST32_TYPE, INT_LEAST64_TYPE, UINT_LEAST8_TYPE, UINT_LEAST16_TYPE, UINT_LEAST32_TYPE, UINT_LEAST64_TYPE, INT_FAST8_TYPE, INT_FAST16_TYPE, INT_FAST32_TYPE, INT_FAST64_TYPE, UINT_FAST8_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE, UINT_FAST64_TYPE, INTPTR_TYPE, UINTPTR_TYPE): Document. gcc/testsuite: * lib/target-supports.exp (check_effective_target_stdint_types): Update comment. (check_effective_target_inttypes_types): New. * gcc.dg/c99-stdint-1.c, gcc.dg/c99-stdint-2.c, gcc.dg/c99-stdint-3.c, gcc.dg/c99-stdint-4.c, gcc.dg/c99-stdint-5.c, gcc.dg/c99-stdint-6.c: New tests. From-SVN: r145372
2009-03-31 22:30:31 +02:00
You should have received a copy of the GNU General Public License and
a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
re PR c/448 (<stdint.h>-related issues (C99 issues)) PR c/448 fixincludes: * inclhack.def (newlib_stdint_1, newlib_stdint_2): New fixes. * fixincl.x: Regenerate. * tests/base/stdint.h: Update. gcc: * Makefile.in (USE_GCC_STDINT): Define. (stmp-int-hdrs): Install stdint.h if applicable. * c-common.c (CHAR16_TYPE): Define in terms of UINT_LEAST16_TYPE if known. (CHAR32_TYPE): Define in terms of UINT_LEAST32_TYPE if known. (SIG_ATOMIC_TYPE, INT8_TYPE, INT16_TYPE, INT32_TYPE, INT64_TYPE, UINT8_TYPE, UINT16_TYPE, UINT32_TYPE, UINT64_TYPE, INT_LEAST8_TYPE, INT_LEAST16_TYPE, INT_LEAST32_TYPE, INT_LEAST64_TYPE, UINT_LEAST8_TYPE, UINT_LEAST16_TYPE, UINT_LEAST32_TYPE, UINT_LEAST64_TYPE, INT_FAST8_TYPE, INT_FAST16_TYPE, INT_FAST32_TYPE, INT_FAST64_TYPE, UINT_FAST8_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE, UINT_FAST64_TYPE, INTPTR_TYPE, UINTPTR_TYPE): Define. (c_common_nodes_and_builtins): Initialize underlying_wchar_type_node. Do not initialize signed_wchar_type_node or unsigned_wchar_type_node. Initialize nodes for new types. (c_stddef_cpp_builtins): Define macros for new types. * c-common.h (CTI_SIGNED_WCHAR_TYPE, CTI_UNSIGNED_WCHAR_TYPE): Remove. (CTI_UNDERLYING_WCHAR_TYPE, CTI_SIG_ATOMIC_TYPE, CTI_INT8_TYPE, CTI_INT16_TYPE, CTI_INT32_TYPE, CTI_INT64_TYPE, CTI_UINT8_TYPE, CTI_UINT16_TYPE, CTI_UINT32_TYPE, CTI_UINT64_TYPE, CTI_INT_LEAST8_TYPE, CTI_INT_LEAST16_TYPE, CTI_INT_LEAST32_TYPE, CTI_INT_LEAST64_TYPE, CTI_UINT_LEAST8_TYPE, CTI_UINT_LEAST16_TYPE, CTI_UINT_LEAST32_TYPE, CTI_UINT_LEAST64_TYPE, CTI_INT_FAST8_TYPE, CTI_INT_FAST16_TYPE, CTI_INT_FAST32_TYPE, CTI_INT_FAST64_TYPE, CTI_UINT_FAST8_TYPE, CTI_UINT_FAST16_TYPE, CTI_UINT_FAST32_TYPE, CTI_UINT_FAST64_TYPE, CTI_INTPTR_TYPE, CTI_UINTPTR_TYPE): Define. (signed_wchar_type_node, unsigned_wchar_type_node): Remove. (underlying_wchar_type_node, sig_atomic_type_node, int8_type_node, int16_type_node, int32_type_node, int64_type_node, uint8_type_node, uint16_type_node, c_uint32_type_node, c_uint64_type_node, int_least8_type_node, int_least16_type_node, int_least32_type_node, int_least64_type_node, uint_least8_type_node, uint_least16_type_node, uint_least32_type_node, uint_least64_type_node, int_fast8_type_node, int_fast16_type_node, int_fast32_type_node, int_fast64_type_node, uint_fast8_type_node, uint_fast16_type_node, uint_fast32_type_node, uint_fast64_type_node, intptr_type_node, uintptr_type_node): Define. * c-cppbuiltin.c (builtin_define_constants, builtin_define_type_minmax): New. (builtin_define_stdint_macros): Define more macros. (c_cpp_builtins): Define more limit macros. (type_suffix): New. (builtin_define_type_max): Define in terms of builtin_define_type_minmax. Remove is_long parameter. All callers changed. * config.gcc (use_gcc_stdint): Define. (tm_file): Add glibc-stdint.h for targets using glibc or uClibc. Add newlib-stdint.h for generic targets. * config/glibc-stdint.h, config/newlib-stdint.h, ginclude/stdint-gcc.h, ginclude/stdint-wrap.h: New. * config/m32c/m32c.h (UINTPTR_TYPE): Define. * config/score/score.h (UINTPTR_TYPE): Define. * config/sol2.h (SIG_ATOMIC_TYPE, INT8_TYPE, INT16_TYPE, INT32_TYPE, INT64_TYPE, UINT8_TYPE, UINT16_TYPE, UINT32_TYPE, UINT64_TYPE, INT_LEAST8_TYPE, INT_LEAST16_TYPE, INT_LEAST32_TYPE, INT_LEAST64_TYPE, UINT_LEAST8_TYPE, UINT_LEAST16_TYPE, UINT_LEAST32_TYPE, UINT_LEAST64_TYPE, INT_FAST8_TYPE, INT_FAST16_TYPE, INT_FAST32_TYPE, INT_FAST64_TYPE, UINT_FAST8_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE, UINT_FAST64_TYPE, INTPTR_TYPE, UINTPTR_TYPE): Define. * config/spu/spu.h (STDINT_LONG32): Define. * configure.ac (use_gcc_stdint): Substitute. * configure: Regenerate. * doc/cpp.texi (__SIG_ATOMIC_TYPE__, __INT8_TYPE__, __INT16_TYPE__, __INT32_TYPE__, __INT64_TYPE__, __UINT8_TYPE__, __UINT16_TYPE__, __UINT32_TYPE__, __UINT64_TYPE__, __INT_LEAST8_TYPE__, __INT_LEAST16_TYPE__, __INT_LEAST32_TYPE__, __INT_LEAST64_TYPE__, __UINT_LEAST8_TYPE__, __UINT_LEAST16_TYPE__, __UINT_LEAST32_TYPE_, __UINT_LEAST64_TYPE__, __INT_FAST8_TYPE__, __INT_FAST16_TYPE__, __INT_FAST32_TYPE__, __INT_FAST64_TYPE__, __UINT_FAST8_TYPE__, __UINT_FAST16_TYPE__, __UINT_FAST32_TYPE__, __UINT_FAST64_TYPE__, __INTPTR_TYPE__, __UINTPTR_TYPE__, __WINT_MAX__, __SIZE_MAX__, __PTRDIFF_MAX__, __UINTMAX_MAX__, __SIG_ATOMIC_MAX__, __INT8_MAX__, __INT16_MAX__, __INT32_MAX__, __INT64_MAX__, __UINT8_MAX__, __UINT16_MAX__, __UINT32_MAX__, __UINT64_MAX__, __INT_LEAST8_MAX__, __INT_LEAST16_MAX__, __INT_LEAST32_MAX__, __INT_LEAST64_MAX__, __UINT_LEAST8_MAX__, __UINT_LEAST16_MAX__, __UINT_LEAST32_MAX__, __UINT_LEAST64_MAX__, __INT_FAST8_MAX__, __INT_FAST16_MAX__, __INT_FAST32_MAX__, __INT_FAST64_MAX__, __UINT_FAST8_MAX__, __UINT_FAST16_MAX__, __UINT_FAST32_MAX__, __UINT_FAST64_MAX__, __INTPTR_MAX__, __UINTPTR_MAX__, __WCHAR_MIN__, __WINT_MIN__, __SIG_ATOMIC_MIN__, __INT8_C, __INT16_C, __INT32_C, __INT64_C, __UINT8_C, __UINT16_C, __UINT32_C, __UINT64_C, __INTMAX_C, __UINTMAX_C): Document. * doc/tm.texi (SIG_ATOMIC_TYPE, INT8_TYPE, INT16_TYPE, INT32_TYPE, INT64_TYPE, UINT8_TYPE, UINT16_TYPE, UINT32_TYPE, UINT64_TYPE, INT_LEAST8_TYPE, INT_LEAST16_TYPE, INT_LEAST32_TYPE, INT_LEAST64_TYPE, UINT_LEAST8_TYPE, UINT_LEAST16_TYPE, UINT_LEAST32_TYPE, UINT_LEAST64_TYPE, INT_FAST8_TYPE, INT_FAST16_TYPE, INT_FAST32_TYPE, INT_FAST64_TYPE, UINT_FAST8_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE, UINT_FAST64_TYPE, INTPTR_TYPE, UINTPTR_TYPE): Document. gcc/testsuite: * lib/target-supports.exp (check_effective_target_stdint_types): Update comment. (check_effective_target_inttypes_types): New. * gcc.dg/c99-stdint-1.c, gcc.dg/c99-stdint-2.c, gcc.dg/c99-stdint-3.c, gcc.dg/c99-stdint-4.c, gcc.dg/c99-stdint-5.c, gcc.dg/c99-stdint-6.c: New tests. From-SVN: r145372
2009-03-31 22:30:31 +02:00
/*
* ISO C Standard: 7.18 Integer types <stdint.h>
*/
#ifndef _GCC_STDINT_H
#define _GCC_STDINT_H
/* 7.8.1.1 Exact-width integer types */
#ifdef __INT8_TYPE__
typedef __INT8_TYPE__ int8_t;
#endif
#ifdef __INT16_TYPE__
typedef __INT16_TYPE__ int16_t;
#endif
#ifdef __INT32_TYPE__
typedef __INT32_TYPE__ int32_t;
#endif
#ifdef __INT64_TYPE__
typedef __INT64_TYPE__ int64_t;
#endif
#ifdef __UINT8_TYPE__
typedef __UINT8_TYPE__ uint8_t;
#endif
#ifdef __UINT16_TYPE__
typedef __UINT16_TYPE__ uint16_t;
#endif
#ifdef __UINT32_TYPE__
typedef __UINT32_TYPE__ uint32_t;
#endif
#ifdef __UINT64_TYPE__
typedef __UINT64_TYPE__ uint64_t;
#endif
/* 7.8.1.2 Minimum-width integer types */
typedef __INT_LEAST8_TYPE__ int_least8_t;
typedef __INT_LEAST16_TYPE__ int_least16_t;
typedef __INT_LEAST32_TYPE__ int_least32_t;
typedef __INT_LEAST64_TYPE__ int_least64_t;
typedef __UINT_LEAST8_TYPE__ uint_least8_t;
typedef __UINT_LEAST16_TYPE__ uint_least16_t;
typedef __UINT_LEAST32_TYPE__ uint_least32_t;
typedef __UINT_LEAST64_TYPE__ uint_least64_t;
/* 7.8.1.3 Fastest minimum-width integer types */
typedef __INT_FAST8_TYPE__ int_fast8_t;
typedef __INT_FAST16_TYPE__ int_fast16_t;
typedef __INT_FAST32_TYPE__ int_fast32_t;
typedef __INT_FAST64_TYPE__ int_fast64_t;
typedef __UINT_FAST8_TYPE__ uint_fast8_t;
typedef __UINT_FAST16_TYPE__ uint_fast16_t;
typedef __UINT_FAST32_TYPE__ uint_fast32_t;
typedef __UINT_FAST64_TYPE__ uint_fast64_t;
/* 7.8.1.4 Integer types capable of holding object pointers */
#ifdef __INTPTR_TYPE__
typedef __INTPTR_TYPE__ intptr_t;
#endif
#ifdef __UINTPTR_TYPE__
typedef __UINTPTR_TYPE__ uintptr_t;
#endif
/* 7.8.1.5 Greatest-width integer types */
typedef __INTMAX_TYPE__ intmax_t;
typedef __UINTMAX_TYPE__ uintmax_t;
#if (!defined __cplusplus || __cplusplus >= 201103L \
|| defined __STDC_LIMIT_MACROS)
re PR c/448 (<stdint.h>-related issues (C99 issues)) PR c/448 fixincludes: * inclhack.def (newlib_stdint_1, newlib_stdint_2): New fixes. * fixincl.x: Regenerate. * tests/base/stdint.h: Update. gcc: * Makefile.in (USE_GCC_STDINT): Define. (stmp-int-hdrs): Install stdint.h if applicable. * c-common.c (CHAR16_TYPE): Define in terms of UINT_LEAST16_TYPE if known. (CHAR32_TYPE): Define in terms of UINT_LEAST32_TYPE if known. (SIG_ATOMIC_TYPE, INT8_TYPE, INT16_TYPE, INT32_TYPE, INT64_TYPE, UINT8_TYPE, UINT16_TYPE, UINT32_TYPE, UINT64_TYPE, INT_LEAST8_TYPE, INT_LEAST16_TYPE, INT_LEAST32_TYPE, INT_LEAST64_TYPE, UINT_LEAST8_TYPE, UINT_LEAST16_TYPE, UINT_LEAST32_TYPE, UINT_LEAST64_TYPE, INT_FAST8_TYPE, INT_FAST16_TYPE, INT_FAST32_TYPE, INT_FAST64_TYPE, UINT_FAST8_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE, UINT_FAST64_TYPE, INTPTR_TYPE, UINTPTR_TYPE): Define. (c_common_nodes_and_builtins): Initialize underlying_wchar_type_node. Do not initialize signed_wchar_type_node or unsigned_wchar_type_node. Initialize nodes for new types. (c_stddef_cpp_builtins): Define macros for new types. * c-common.h (CTI_SIGNED_WCHAR_TYPE, CTI_UNSIGNED_WCHAR_TYPE): Remove. (CTI_UNDERLYING_WCHAR_TYPE, CTI_SIG_ATOMIC_TYPE, CTI_INT8_TYPE, CTI_INT16_TYPE, CTI_INT32_TYPE, CTI_INT64_TYPE, CTI_UINT8_TYPE, CTI_UINT16_TYPE, CTI_UINT32_TYPE, CTI_UINT64_TYPE, CTI_INT_LEAST8_TYPE, CTI_INT_LEAST16_TYPE, CTI_INT_LEAST32_TYPE, CTI_INT_LEAST64_TYPE, CTI_UINT_LEAST8_TYPE, CTI_UINT_LEAST16_TYPE, CTI_UINT_LEAST32_TYPE, CTI_UINT_LEAST64_TYPE, CTI_INT_FAST8_TYPE, CTI_INT_FAST16_TYPE, CTI_INT_FAST32_TYPE, CTI_INT_FAST64_TYPE, CTI_UINT_FAST8_TYPE, CTI_UINT_FAST16_TYPE, CTI_UINT_FAST32_TYPE, CTI_UINT_FAST64_TYPE, CTI_INTPTR_TYPE, CTI_UINTPTR_TYPE): Define. (signed_wchar_type_node, unsigned_wchar_type_node): Remove. (underlying_wchar_type_node, sig_atomic_type_node, int8_type_node, int16_type_node, int32_type_node, int64_type_node, uint8_type_node, uint16_type_node, c_uint32_type_node, c_uint64_type_node, int_least8_type_node, int_least16_type_node, int_least32_type_node, int_least64_type_node, uint_least8_type_node, uint_least16_type_node, uint_least32_type_node, uint_least64_type_node, int_fast8_type_node, int_fast16_type_node, int_fast32_type_node, int_fast64_type_node, uint_fast8_type_node, uint_fast16_type_node, uint_fast32_type_node, uint_fast64_type_node, intptr_type_node, uintptr_type_node): Define. * c-cppbuiltin.c (builtin_define_constants, builtin_define_type_minmax): New. (builtin_define_stdint_macros): Define more macros. (c_cpp_builtins): Define more limit macros. (type_suffix): New. (builtin_define_type_max): Define in terms of builtin_define_type_minmax. Remove is_long parameter. All callers changed. * config.gcc (use_gcc_stdint): Define. (tm_file): Add glibc-stdint.h for targets using glibc or uClibc. Add newlib-stdint.h for generic targets. * config/glibc-stdint.h, config/newlib-stdint.h, ginclude/stdint-gcc.h, ginclude/stdint-wrap.h: New. * config/m32c/m32c.h (UINTPTR_TYPE): Define. * config/score/score.h (UINTPTR_TYPE): Define. * config/sol2.h (SIG_ATOMIC_TYPE, INT8_TYPE, INT16_TYPE, INT32_TYPE, INT64_TYPE, UINT8_TYPE, UINT16_TYPE, UINT32_TYPE, UINT64_TYPE, INT_LEAST8_TYPE, INT_LEAST16_TYPE, INT_LEAST32_TYPE, INT_LEAST64_TYPE, UINT_LEAST8_TYPE, UINT_LEAST16_TYPE, UINT_LEAST32_TYPE, UINT_LEAST64_TYPE, INT_FAST8_TYPE, INT_FAST16_TYPE, INT_FAST32_TYPE, INT_FAST64_TYPE, UINT_FAST8_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE, UINT_FAST64_TYPE, INTPTR_TYPE, UINTPTR_TYPE): Define. * config/spu/spu.h (STDINT_LONG32): Define. * configure.ac (use_gcc_stdint): Substitute. * configure: Regenerate. * doc/cpp.texi (__SIG_ATOMIC_TYPE__, __INT8_TYPE__, __INT16_TYPE__, __INT32_TYPE__, __INT64_TYPE__, __UINT8_TYPE__, __UINT16_TYPE__, __UINT32_TYPE__, __UINT64_TYPE__, __INT_LEAST8_TYPE__, __INT_LEAST16_TYPE__, __INT_LEAST32_TYPE__, __INT_LEAST64_TYPE__, __UINT_LEAST8_TYPE__, __UINT_LEAST16_TYPE__, __UINT_LEAST32_TYPE_, __UINT_LEAST64_TYPE__, __INT_FAST8_TYPE__, __INT_FAST16_TYPE__, __INT_FAST32_TYPE__, __INT_FAST64_TYPE__, __UINT_FAST8_TYPE__, __UINT_FAST16_TYPE__, __UINT_FAST32_TYPE__, __UINT_FAST64_TYPE__, __INTPTR_TYPE__, __UINTPTR_TYPE__, __WINT_MAX__, __SIZE_MAX__, __PTRDIFF_MAX__, __UINTMAX_MAX__, __SIG_ATOMIC_MAX__, __INT8_MAX__, __INT16_MAX__, __INT32_MAX__, __INT64_MAX__, __UINT8_MAX__, __UINT16_MAX__, __UINT32_MAX__, __UINT64_MAX__, __INT_LEAST8_MAX__, __INT_LEAST16_MAX__, __INT_LEAST32_MAX__, __INT_LEAST64_MAX__, __UINT_LEAST8_MAX__, __UINT_LEAST16_MAX__, __UINT_LEAST32_MAX__, __UINT_LEAST64_MAX__, __INT_FAST8_MAX__, __INT_FAST16_MAX__, __INT_FAST32_MAX__, __INT_FAST64_MAX__, __UINT_FAST8_MAX__, __UINT_FAST16_MAX__, __UINT_FAST32_MAX__, __UINT_FAST64_MAX__, __INTPTR_MAX__, __UINTPTR_MAX__, __WCHAR_MIN__, __WINT_MIN__, __SIG_ATOMIC_MIN__, __INT8_C, __INT16_C, __INT32_C, __INT64_C, __UINT8_C, __UINT16_C, __UINT32_C, __UINT64_C, __INTMAX_C, __UINTMAX_C): Document. * doc/tm.texi (SIG_ATOMIC_TYPE, INT8_TYPE, INT16_TYPE, INT32_TYPE, INT64_TYPE, UINT8_TYPE, UINT16_TYPE, UINT32_TYPE, UINT64_TYPE, INT_LEAST8_TYPE, INT_LEAST16_TYPE, INT_LEAST32_TYPE, INT_LEAST64_TYPE, UINT_LEAST8_TYPE, UINT_LEAST16_TYPE, UINT_LEAST32_TYPE, UINT_LEAST64_TYPE, INT_FAST8_TYPE, INT_FAST16_TYPE, INT_FAST32_TYPE, INT_FAST64_TYPE, UINT_FAST8_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE, UINT_FAST64_TYPE, INTPTR_TYPE, UINTPTR_TYPE): Document. gcc/testsuite: * lib/target-supports.exp (check_effective_target_stdint_types): Update comment. (check_effective_target_inttypes_types): New. * gcc.dg/c99-stdint-1.c, gcc.dg/c99-stdint-2.c, gcc.dg/c99-stdint-3.c, gcc.dg/c99-stdint-4.c, gcc.dg/c99-stdint-5.c, gcc.dg/c99-stdint-6.c: New tests. From-SVN: r145372
2009-03-31 22:30:31 +02:00
/* 7.18.2 Limits of specified-width integer types */
#ifdef __INT8_MAX__
# undef INT8_MAX
# define INT8_MAX __INT8_MAX__
# undef INT8_MIN
# define INT8_MIN (-INT8_MAX - 1)
#endif
#ifdef __UINT8_MAX__
# undef UINT8_MAX
# define UINT8_MAX __UINT8_MAX__
#endif
#ifdef __INT16_MAX__
# undef INT16_MAX
# define INT16_MAX __INT16_MAX__
# undef INT16_MIN
# define INT16_MIN (-INT16_MAX - 1)
#endif
#ifdef __UINT16_MAX__
# undef UINT16_MAX
# define UINT16_MAX __UINT16_MAX__
#endif
#ifdef __INT32_MAX__
# undef INT32_MAX
# define INT32_MAX __INT32_MAX__
# undef INT32_MIN
# define INT32_MIN (-INT32_MAX - 1)
#endif
#ifdef __UINT32_MAX__
# undef UINT32_MAX
# define UINT32_MAX __UINT32_MAX__
#endif
#ifdef __INT64_MAX__
# undef INT64_MAX
# define INT64_MAX __INT64_MAX__
# undef INT64_MIN
# define INT64_MIN (-INT64_MAX - 1)
#endif
#ifdef __UINT64_MAX__
# undef UINT64_MAX
# define UINT64_MAX __UINT64_MAX__
#endif
#undef INT_LEAST8_MAX
#define INT_LEAST8_MAX __INT_LEAST8_MAX__
#undef INT_LEAST8_MIN
#define INT_LEAST8_MIN (-INT_LEAST8_MAX - 1)
#undef UINT_LEAST8_MAX
#define UINT_LEAST8_MAX __UINT_LEAST8_MAX__
#undef INT_LEAST16_MAX
#define INT_LEAST16_MAX __INT_LEAST16_MAX__
#undef INT_LEAST16_MIN
#define INT_LEAST16_MIN (-INT_LEAST16_MAX - 1)
#undef UINT_LEAST16_MAX
#define UINT_LEAST16_MAX __UINT_LEAST16_MAX__
#undef INT_LEAST32_MAX
#define INT_LEAST32_MAX __INT_LEAST32_MAX__
#undef INT_LEAST32_MIN
#define INT_LEAST32_MIN (-INT_LEAST32_MAX - 1)
#undef UINT_LEAST32_MAX
#define UINT_LEAST32_MAX __UINT_LEAST32_MAX__
#undef INT_LEAST64_MAX
#define INT_LEAST64_MAX __INT_LEAST64_MAX__
#undef INT_LEAST64_MIN
#define INT_LEAST64_MIN (-INT_LEAST64_MAX - 1)
#undef UINT_LEAST64_MAX
#define UINT_LEAST64_MAX __UINT_LEAST64_MAX__
#undef INT_FAST8_MAX
#define INT_FAST8_MAX __INT_FAST8_MAX__
#undef INT_FAST8_MIN
#define INT_FAST8_MIN (-INT_FAST8_MAX - 1)
#undef UINT_FAST8_MAX
#define UINT_FAST8_MAX __UINT_FAST8_MAX__
#undef INT_FAST16_MAX
#define INT_FAST16_MAX __INT_FAST16_MAX__
#undef INT_FAST16_MIN
#define INT_FAST16_MIN (-INT_FAST16_MAX - 1)
#undef UINT_FAST16_MAX
#define UINT_FAST16_MAX __UINT_FAST16_MAX__
#undef INT_FAST32_MAX
#define INT_FAST32_MAX __INT_FAST32_MAX__
#undef INT_FAST32_MIN
#define INT_FAST32_MIN (-INT_FAST32_MAX - 1)
#undef UINT_FAST32_MAX
#define UINT_FAST32_MAX __UINT_FAST32_MAX__
#undef INT_FAST64_MAX
#define INT_FAST64_MAX __INT_FAST64_MAX__
#undef INT_FAST64_MIN
#define INT_FAST64_MIN (-INT_FAST64_MAX - 1)
#undef UINT_FAST64_MAX
#define UINT_FAST64_MAX __UINT_FAST64_MAX__
#ifdef __INTPTR_MAX__
# undef INTPTR_MAX
# define INTPTR_MAX __INTPTR_MAX__
# undef INTPTR_MIN
# define INTPTR_MIN (-INTPTR_MAX - 1)
#endif
#ifdef __UINTPTR_MAX__
# undef UINTPTR_MAX
# define UINTPTR_MAX __UINTPTR_MAX__
#endif
#undef INTMAX_MAX
#define INTMAX_MAX __INTMAX_MAX__
#undef INTMAX_MIN
#define INTMAX_MIN (-INTMAX_MAX - 1)
#undef UINTMAX_MAX
#define UINTMAX_MAX __UINTMAX_MAX__
/* 7.18.3 Limits of other integer types */
#undef PTRDIFF_MAX
#define PTRDIFF_MAX __PTRDIFF_MAX__
#undef PTRDIFF_MIN
#define PTRDIFF_MIN (-PTRDIFF_MAX - 1)
#undef SIG_ATOMIC_MAX
#define SIG_ATOMIC_MAX __SIG_ATOMIC_MAX__
#undef SIG_ATOMIC_MIN
#define SIG_ATOMIC_MIN __SIG_ATOMIC_MIN__
#undef SIZE_MAX
#define SIZE_MAX __SIZE_MAX__
#undef WCHAR_MAX
#define WCHAR_MAX __WCHAR_MAX__
#undef WCHAR_MIN
#define WCHAR_MIN __WCHAR_MIN__
#undef WINT_MAX
#define WINT_MAX __WINT_MAX__
#undef WINT_MIN
#define WINT_MIN __WINT_MIN__
#endif /* (!defined __cplusplus || __cplusplus >= 201103L
|| defined __STDC_LIMIT_MACROS) */
re PR c/448 (<stdint.h>-related issues (C99 issues)) PR c/448 fixincludes: * inclhack.def (newlib_stdint_1, newlib_stdint_2): New fixes. * fixincl.x: Regenerate. * tests/base/stdint.h: Update. gcc: * Makefile.in (USE_GCC_STDINT): Define. (stmp-int-hdrs): Install stdint.h if applicable. * c-common.c (CHAR16_TYPE): Define in terms of UINT_LEAST16_TYPE if known. (CHAR32_TYPE): Define in terms of UINT_LEAST32_TYPE if known. (SIG_ATOMIC_TYPE, INT8_TYPE, INT16_TYPE, INT32_TYPE, INT64_TYPE, UINT8_TYPE, UINT16_TYPE, UINT32_TYPE, UINT64_TYPE, INT_LEAST8_TYPE, INT_LEAST16_TYPE, INT_LEAST32_TYPE, INT_LEAST64_TYPE, UINT_LEAST8_TYPE, UINT_LEAST16_TYPE, UINT_LEAST32_TYPE, UINT_LEAST64_TYPE, INT_FAST8_TYPE, INT_FAST16_TYPE, INT_FAST32_TYPE, INT_FAST64_TYPE, UINT_FAST8_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE, UINT_FAST64_TYPE, INTPTR_TYPE, UINTPTR_TYPE): Define. (c_common_nodes_and_builtins): Initialize underlying_wchar_type_node. Do not initialize signed_wchar_type_node or unsigned_wchar_type_node. Initialize nodes for new types. (c_stddef_cpp_builtins): Define macros for new types. * c-common.h (CTI_SIGNED_WCHAR_TYPE, CTI_UNSIGNED_WCHAR_TYPE): Remove. (CTI_UNDERLYING_WCHAR_TYPE, CTI_SIG_ATOMIC_TYPE, CTI_INT8_TYPE, CTI_INT16_TYPE, CTI_INT32_TYPE, CTI_INT64_TYPE, CTI_UINT8_TYPE, CTI_UINT16_TYPE, CTI_UINT32_TYPE, CTI_UINT64_TYPE, CTI_INT_LEAST8_TYPE, CTI_INT_LEAST16_TYPE, CTI_INT_LEAST32_TYPE, CTI_INT_LEAST64_TYPE, CTI_UINT_LEAST8_TYPE, CTI_UINT_LEAST16_TYPE, CTI_UINT_LEAST32_TYPE, CTI_UINT_LEAST64_TYPE, CTI_INT_FAST8_TYPE, CTI_INT_FAST16_TYPE, CTI_INT_FAST32_TYPE, CTI_INT_FAST64_TYPE, CTI_UINT_FAST8_TYPE, CTI_UINT_FAST16_TYPE, CTI_UINT_FAST32_TYPE, CTI_UINT_FAST64_TYPE, CTI_INTPTR_TYPE, CTI_UINTPTR_TYPE): Define. (signed_wchar_type_node, unsigned_wchar_type_node): Remove. (underlying_wchar_type_node, sig_atomic_type_node, int8_type_node, int16_type_node, int32_type_node, int64_type_node, uint8_type_node, uint16_type_node, c_uint32_type_node, c_uint64_type_node, int_least8_type_node, int_least16_type_node, int_least32_type_node, int_least64_type_node, uint_least8_type_node, uint_least16_type_node, uint_least32_type_node, uint_least64_type_node, int_fast8_type_node, int_fast16_type_node, int_fast32_type_node, int_fast64_type_node, uint_fast8_type_node, uint_fast16_type_node, uint_fast32_type_node, uint_fast64_type_node, intptr_type_node, uintptr_type_node): Define. * c-cppbuiltin.c (builtin_define_constants, builtin_define_type_minmax): New. (builtin_define_stdint_macros): Define more macros. (c_cpp_builtins): Define more limit macros. (type_suffix): New. (builtin_define_type_max): Define in terms of builtin_define_type_minmax. Remove is_long parameter. All callers changed. * config.gcc (use_gcc_stdint): Define. (tm_file): Add glibc-stdint.h for targets using glibc or uClibc. Add newlib-stdint.h for generic targets. * config/glibc-stdint.h, config/newlib-stdint.h, ginclude/stdint-gcc.h, ginclude/stdint-wrap.h: New. * config/m32c/m32c.h (UINTPTR_TYPE): Define. * config/score/score.h (UINTPTR_TYPE): Define. * config/sol2.h (SIG_ATOMIC_TYPE, INT8_TYPE, INT16_TYPE, INT32_TYPE, INT64_TYPE, UINT8_TYPE, UINT16_TYPE, UINT32_TYPE, UINT64_TYPE, INT_LEAST8_TYPE, INT_LEAST16_TYPE, INT_LEAST32_TYPE, INT_LEAST64_TYPE, UINT_LEAST8_TYPE, UINT_LEAST16_TYPE, UINT_LEAST32_TYPE, UINT_LEAST64_TYPE, INT_FAST8_TYPE, INT_FAST16_TYPE, INT_FAST32_TYPE, INT_FAST64_TYPE, UINT_FAST8_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE, UINT_FAST64_TYPE, INTPTR_TYPE, UINTPTR_TYPE): Define. * config/spu/spu.h (STDINT_LONG32): Define. * configure.ac (use_gcc_stdint): Substitute. * configure: Regenerate. * doc/cpp.texi (__SIG_ATOMIC_TYPE__, __INT8_TYPE__, __INT16_TYPE__, __INT32_TYPE__, __INT64_TYPE__, __UINT8_TYPE__, __UINT16_TYPE__, __UINT32_TYPE__, __UINT64_TYPE__, __INT_LEAST8_TYPE__, __INT_LEAST16_TYPE__, __INT_LEAST32_TYPE__, __INT_LEAST64_TYPE__, __UINT_LEAST8_TYPE__, __UINT_LEAST16_TYPE__, __UINT_LEAST32_TYPE_, __UINT_LEAST64_TYPE__, __INT_FAST8_TYPE__, __INT_FAST16_TYPE__, __INT_FAST32_TYPE__, __INT_FAST64_TYPE__, __UINT_FAST8_TYPE__, __UINT_FAST16_TYPE__, __UINT_FAST32_TYPE__, __UINT_FAST64_TYPE__, __INTPTR_TYPE__, __UINTPTR_TYPE__, __WINT_MAX__, __SIZE_MAX__, __PTRDIFF_MAX__, __UINTMAX_MAX__, __SIG_ATOMIC_MAX__, __INT8_MAX__, __INT16_MAX__, __INT32_MAX__, __INT64_MAX__, __UINT8_MAX__, __UINT16_MAX__, __UINT32_MAX__, __UINT64_MAX__, __INT_LEAST8_MAX__, __INT_LEAST16_MAX__, __INT_LEAST32_MAX__, __INT_LEAST64_MAX__, __UINT_LEAST8_MAX__, __UINT_LEAST16_MAX__, __UINT_LEAST32_MAX__, __UINT_LEAST64_MAX__, __INT_FAST8_MAX__, __INT_FAST16_MAX__, __INT_FAST32_MAX__, __INT_FAST64_MAX__, __UINT_FAST8_MAX__, __UINT_FAST16_MAX__, __UINT_FAST32_MAX__, __UINT_FAST64_MAX__, __INTPTR_MAX__, __UINTPTR_MAX__, __WCHAR_MIN__, __WINT_MIN__, __SIG_ATOMIC_MIN__, __INT8_C, __INT16_C, __INT32_C, __INT64_C, __UINT8_C, __UINT16_C, __UINT32_C, __UINT64_C, __INTMAX_C, __UINTMAX_C): Document. * doc/tm.texi (SIG_ATOMIC_TYPE, INT8_TYPE, INT16_TYPE, INT32_TYPE, INT64_TYPE, UINT8_TYPE, UINT16_TYPE, UINT32_TYPE, UINT64_TYPE, INT_LEAST8_TYPE, INT_LEAST16_TYPE, INT_LEAST32_TYPE, INT_LEAST64_TYPE, UINT_LEAST8_TYPE, UINT_LEAST16_TYPE, UINT_LEAST32_TYPE, UINT_LEAST64_TYPE, INT_FAST8_TYPE, INT_FAST16_TYPE, INT_FAST32_TYPE, INT_FAST64_TYPE, UINT_FAST8_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE, UINT_FAST64_TYPE, INTPTR_TYPE, UINTPTR_TYPE): Document. gcc/testsuite: * lib/target-supports.exp (check_effective_target_stdint_types): Update comment. (check_effective_target_inttypes_types): New. * gcc.dg/c99-stdint-1.c, gcc.dg/c99-stdint-2.c, gcc.dg/c99-stdint-3.c, gcc.dg/c99-stdint-4.c, gcc.dg/c99-stdint-5.c, gcc.dg/c99-stdint-6.c: New tests. From-SVN: r145372
2009-03-31 22:30:31 +02:00
#if (!defined __cplusplus || __cplusplus >= 201103L \
|| defined __STDC_CONSTANT_MACROS)
re PR c/448 (<stdint.h>-related issues (C99 issues)) PR c/448 fixincludes: * inclhack.def (newlib_stdint_1, newlib_stdint_2): New fixes. * fixincl.x: Regenerate. * tests/base/stdint.h: Update. gcc: * Makefile.in (USE_GCC_STDINT): Define. (stmp-int-hdrs): Install stdint.h if applicable. * c-common.c (CHAR16_TYPE): Define in terms of UINT_LEAST16_TYPE if known. (CHAR32_TYPE): Define in terms of UINT_LEAST32_TYPE if known. (SIG_ATOMIC_TYPE, INT8_TYPE, INT16_TYPE, INT32_TYPE, INT64_TYPE, UINT8_TYPE, UINT16_TYPE, UINT32_TYPE, UINT64_TYPE, INT_LEAST8_TYPE, INT_LEAST16_TYPE, INT_LEAST32_TYPE, INT_LEAST64_TYPE, UINT_LEAST8_TYPE, UINT_LEAST16_TYPE, UINT_LEAST32_TYPE, UINT_LEAST64_TYPE, INT_FAST8_TYPE, INT_FAST16_TYPE, INT_FAST32_TYPE, INT_FAST64_TYPE, UINT_FAST8_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE, UINT_FAST64_TYPE, INTPTR_TYPE, UINTPTR_TYPE): Define. (c_common_nodes_and_builtins): Initialize underlying_wchar_type_node. Do not initialize signed_wchar_type_node or unsigned_wchar_type_node. Initialize nodes for new types. (c_stddef_cpp_builtins): Define macros for new types. * c-common.h (CTI_SIGNED_WCHAR_TYPE, CTI_UNSIGNED_WCHAR_TYPE): Remove. (CTI_UNDERLYING_WCHAR_TYPE, CTI_SIG_ATOMIC_TYPE, CTI_INT8_TYPE, CTI_INT16_TYPE, CTI_INT32_TYPE, CTI_INT64_TYPE, CTI_UINT8_TYPE, CTI_UINT16_TYPE, CTI_UINT32_TYPE, CTI_UINT64_TYPE, CTI_INT_LEAST8_TYPE, CTI_INT_LEAST16_TYPE, CTI_INT_LEAST32_TYPE, CTI_INT_LEAST64_TYPE, CTI_UINT_LEAST8_TYPE, CTI_UINT_LEAST16_TYPE, CTI_UINT_LEAST32_TYPE, CTI_UINT_LEAST64_TYPE, CTI_INT_FAST8_TYPE, CTI_INT_FAST16_TYPE, CTI_INT_FAST32_TYPE, CTI_INT_FAST64_TYPE, CTI_UINT_FAST8_TYPE, CTI_UINT_FAST16_TYPE, CTI_UINT_FAST32_TYPE, CTI_UINT_FAST64_TYPE, CTI_INTPTR_TYPE, CTI_UINTPTR_TYPE): Define. (signed_wchar_type_node, unsigned_wchar_type_node): Remove. (underlying_wchar_type_node, sig_atomic_type_node, int8_type_node, int16_type_node, int32_type_node, int64_type_node, uint8_type_node, uint16_type_node, c_uint32_type_node, c_uint64_type_node, int_least8_type_node, int_least16_type_node, int_least32_type_node, int_least64_type_node, uint_least8_type_node, uint_least16_type_node, uint_least32_type_node, uint_least64_type_node, int_fast8_type_node, int_fast16_type_node, int_fast32_type_node, int_fast64_type_node, uint_fast8_type_node, uint_fast16_type_node, uint_fast32_type_node, uint_fast64_type_node, intptr_type_node, uintptr_type_node): Define. * c-cppbuiltin.c (builtin_define_constants, builtin_define_type_minmax): New. (builtin_define_stdint_macros): Define more macros. (c_cpp_builtins): Define more limit macros. (type_suffix): New. (builtin_define_type_max): Define in terms of builtin_define_type_minmax. Remove is_long parameter. All callers changed. * config.gcc (use_gcc_stdint): Define. (tm_file): Add glibc-stdint.h for targets using glibc or uClibc. Add newlib-stdint.h for generic targets. * config/glibc-stdint.h, config/newlib-stdint.h, ginclude/stdint-gcc.h, ginclude/stdint-wrap.h: New. * config/m32c/m32c.h (UINTPTR_TYPE): Define. * config/score/score.h (UINTPTR_TYPE): Define. * config/sol2.h (SIG_ATOMIC_TYPE, INT8_TYPE, INT16_TYPE, INT32_TYPE, INT64_TYPE, UINT8_TYPE, UINT16_TYPE, UINT32_TYPE, UINT64_TYPE, INT_LEAST8_TYPE, INT_LEAST16_TYPE, INT_LEAST32_TYPE, INT_LEAST64_TYPE, UINT_LEAST8_TYPE, UINT_LEAST16_TYPE, UINT_LEAST32_TYPE, UINT_LEAST64_TYPE, INT_FAST8_TYPE, INT_FAST16_TYPE, INT_FAST32_TYPE, INT_FAST64_TYPE, UINT_FAST8_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE, UINT_FAST64_TYPE, INTPTR_TYPE, UINTPTR_TYPE): Define. * config/spu/spu.h (STDINT_LONG32): Define. * configure.ac (use_gcc_stdint): Substitute. * configure: Regenerate. * doc/cpp.texi (__SIG_ATOMIC_TYPE__, __INT8_TYPE__, __INT16_TYPE__, __INT32_TYPE__, __INT64_TYPE__, __UINT8_TYPE__, __UINT16_TYPE__, __UINT32_TYPE__, __UINT64_TYPE__, __INT_LEAST8_TYPE__, __INT_LEAST16_TYPE__, __INT_LEAST32_TYPE__, __INT_LEAST64_TYPE__, __UINT_LEAST8_TYPE__, __UINT_LEAST16_TYPE__, __UINT_LEAST32_TYPE_, __UINT_LEAST64_TYPE__, __INT_FAST8_TYPE__, __INT_FAST16_TYPE__, __INT_FAST32_TYPE__, __INT_FAST64_TYPE__, __UINT_FAST8_TYPE__, __UINT_FAST16_TYPE__, __UINT_FAST32_TYPE__, __UINT_FAST64_TYPE__, __INTPTR_TYPE__, __UINTPTR_TYPE__, __WINT_MAX__, __SIZE_MAX__, __PTRDIFF_MAX__, __UINTMAX_MAX__, __SIG_ATOMIC_MAX__, __INT8_MAX__, __INT16_MAX__, __INT32_MAX__, __INT64_MAX__, __UINT8_MAX__, __UINT16_MAX__, __UINT32_MAX__, __UINT64_MAX__, __INT_LEAST8_MAX__, __INT_LEAST16_MAX__, __INT_LEAST32_MAX__, __INT_LEAST64_MAX__, __UINT_LEAST8_MAX__, __UINT_LEAST16_MAX__, __UINT_LEAST32_MAX__, __UINT_LEAST64_MAX__, __INT_FAST8_MAX__, __INT_FAST16_MAX__, __INT_FAST32_MAX__, __INT_FAST64_MAX__, __UINT_FAST8_MAX__, __UINT_FAST16_MAX__, __UINT_FAST32_MAX__, __UINT_FAST64_MAX__, __INTPTR_MAX__, __UINTPTR_MAX__, __WCHAR_MIN__, __WINT_MIN__, __SIG_ATOMIC_MIN__, __INT8_C, __INT16_C, __INT32_C, __INT64_C, __UINT8_C, __UINT16_C, __UINT32_C, __UINT64_C, __INTMAX_C, __UINTMAX_C): Document. * doc/tm.texi (SIG_ATOMIC_TYPE, INT8_TYPE, INT16_TYPE, INT32_TYPE, INT64_TYPE, UINT8_TYPE, UINT16_TYPE, UINT32_TYPE, UINT64_TYPE, INT_LEAST8_TYPE, INT_LEAST16_TYPE, INT_LEAST32_TYPE, INT_LEAST64_TYPE, UINT_LEAST8_TYPE, UINT_LEAST16_TYPE, UINT_LEAST32_TYPE, UINT_LEAST64_TYPE, INT_FAST8_TYPE, INT_FAST16_TYPE, INT_FAST32_TYPE, INT_FAST64_TYPE, UINT_FAST8_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE, UINT_FAST64_TYPE, INTPTR_TYPE, UINTPTR_TYPE): Document. gcc/testsuite: * lib/target-supports.exp (check_effective_target_stdint_types): Update comment. (check_effective_target_inttypes_types): New. * gcc.dg/c99-stdint-1.c, gcc.dg/c99-stdint-2.c, gcc.dg/c99-stdint-3.c, gcc.dg/c99-stdint-4.c, gcc.dg/c99-stdint-5.c, gcc.dg/c99-stdint-6.c: New tests. From-SVN: r145372
2009-03-31 22:30:31 +02:00
#undef INT8_C
#define INT8_C(c) __INT8_C(c)
#undef INT16_C
#define INT16_C(c) __INT16_C(c)
#undef INT32_C
#define INT32_C(c) __INT32_C(c)
#undef INT64_C
#define INT64_C(c) __INT64_C(c)
#undef UINT8_C
#define UINT8_C(c) __UINT8_C(c)
#undef UINT16_C
#define UINT16_C(c) __UINT16_C(c)
#undef UINT32_C
#define UINT32_C(c) __UINT32_C(c)
#undef UINT64_C
#define UINT64_C(c) __UINT64_C(c)
#undef INTMAX_C
#define INTMAX_C(c) __INTMAX_C(c)
#undef UINTMAX_C
#define UINTMAX_C(c) __UINTMAX_C(c)
#endif /* (!defined __cplusplus || __cplusplus >= 201103L
|| defined __STDC_CONSTANT_MACROS) */
re PR c/448 (<stdint.h>-related issues (C99 issues)) PR c/448 fixincludes: * inclhack.def (newlib_stdint_1, newlib_stdint_2): New fixes. * fixincl.x: Regenerate. * tests/base/stdint.h: Update. gcc: * Makefile.in (USE_GCC_STDINT): Define. (stmp-int-hdrs): Install stdint.h if applicable. * c-common.c (CHAR16_TYPE): Define in terms of UINT_LEAST16_TYPE if known. (CHAR32_TYPE): Define in terms of UINT_LEAST32_TYPE if known. (SIG_ATOMIC_TYPE, INT8_TYPE, INT16_TYPE, INT32_TYPE, INT64_TYPE, UINT8_TYPE, UINT16_TYPE, UINT32_TYPE, UINT64_TYPE, INT_LEAST8_TYPE, INT_LEAST16_TYPE, INT_LEAST32_TYPE, INT_LEAST64_TYPE, UINT_LEAST8_TYPE, UINT_LEAST16_TYPE, UINT_LEAST32_TYPE, UINT_LEAST64_TYPE, INT_FAST8_TYPE, INT_FAST16_TYPE, INT_FAST32_TYPE, INT_FAST64_TYPE, UINT_FAST8_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE, UINT_FAST64_TYPE, INTPTR_TYPE, UINTPTR_TYPE): Define. (c_common_nodes_and_builtins): Initialize underlying_wchar_type_node. Do not initialize signed_wchar_type_node or unsigned_wchar_type_node. Initialize nodes for new types. (c_stddef_cpp_builtins): Define macros for new types. * c-common.h (CTI_SIGNED_WCHAR_TYPE, CTI_UNSIGNED_WCHAR_TYPE): Remove. (CTI_UNDERLYING_WCHAR_TYPE, CTI_SIG_ATOMIC_TYPE, CTI_INT8_TYPE, CTI_INT16_TYPE, CTI_INT32_TYPE, CTI_INT64_TYPE, CTI_UINT8_TYPE, CTI_UINT16_TYPE, CTI_UINT32_TYPE, CTI_UINT64_TYPE, CTI_INT_LEAST8_TYPE, CTI_INT_LEAST16_TYPE, CTI_INT_LEAST32_TYPE, CTI_INT_LEAST64_TYPE, CTI_UINT_LEAST8_TYPE, CTI_UINT_LEAST16_TYPE, CTI_UINT_LEAST32_TYPE, CTI_UINT_LEAST64_TYPE, CTI_INT_FAST8_TYPE, CTI_INT_FAST16_TYPE, CTI_INT_FAST32_TYPE, CTI_INT_FAST64_TYPE, CTI_UINT_FAST8_TYPE, CTI_UINT_FAST16_TYPE, CTI_UINT_FAST32_TYPE, CTI_UINT_FAST64_TYPE, CTI_INTPTR_TYPE, CTI_UINTPTR_TYPE): Define. (signed_wchar_type_node, unsigned_wchar_type_node): Remove. (underlying_wchar_type_node, sig_atomic_type_node, int8_type_node, int16_type_node, int32_type_node, int64_type_node, uint8_type_node, uint16_type_node, c_uint32_type_node, c_uint64_type_node, int_least8_type_node, int_least16_type_node, int_least32_type_node, int_least64_type_node, uint_least8_type_node, uint_least16_type_node, uint_least32_type_node, uint_least64_type_node, int_fast8_type_node, int_fast16_type_node, int_fast32_type_node, int_fast64_type_node, uint_fast8_type_node, uint_fast16_type_node, uint_fast32_type_node, uint_fast64_type_node, intptr_type_node, uintptr_type_node): Define. * c-cppbuiltin.c (builtin_define_constants, builtin_define_type_minmax): New. (builtin_define_stdint_macros): Define more macros. (c_cpp_builtins): Define more limit macros. (type_suffix): New. (builtin_define_type_max): Define in terms of builtin_define_type_minmax. Remove is_long parameter. All callers changed. * config.gcc (use_gcc_stdint): Define. (tm_file): Add glibc-stdint.h for targets using glibc or uClibc. Add newlib-stdint.h for generic targets. * config/glibc-stdint.h, config/newlib-stdint.h, ginclude/stdint-gcc.h, ginclude/stdint-wrap.h: New. * config/m32c/m32c.h (UINTPTR_TYPE): Define. * config/score/score.h (UINTPTR_TYPE): Define. * config/sol2.h (SIG_ATOMIC_TYPE, INT8_TYPE, INT16_TYPE, INT32_TYPE, INT64_TYPE, UINT8_TYPE, UINT16_TYPE, UINT32_TYPE, UINT64_TYPE, INT_LEAST8_TYPE, INT_LEAST16_TYPE, INT_LEAST32_TYPE, INT_LEAST64_TYPE, UINT_LEAST8_TYPE, UINT_LEAST16_TYPE, UINT_LEAST32_TYPE, UINT_LEAST64_TYPE, INT_FAST8_TYPE, INT_FAST16_TYPE, INT_FAST32_TYPE, INT_FAST64_TYPE, UINT_FAST8_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE, UINT_FAST64_TYPE, INTPTR_TYPE, UINTPTR_TYPE): Define. * config/spu/spu.h (STDINT_LONG32): Define. * configure.ac (use_gcc_stdint): Substitute. * configure: Regenerate. * doc/cpp.texi (__SIG_ATOMIC_TYPE__, __INT8_TYPE__, __INT16_TYPE__, __INT32_TYPE__, __INT64_TYPE__, __UINT8_TYPE__, __UINT16_TYPE__, __UINT32_TYPE__, __UINT64_TYPE__, __INT_LEAST8_TYPE__, __INT_LEAST16_TYPE__, __INT_LEAST32_TYPE__, __INT_LEAST64_TYPE__, __UINT_LEAST8_TYPE__, __UINT_LEAST16_TYPE__, __UINT_LEAST32_TYPE_, __UINT_LEAST64_TYPE__, __INT_FAST8_TYPE__, __INT_FAST16_TYPE__, __INT_FAST32_TYPE__, __INT_FAST64_TYPE__, __UINT_FAST8_TYPE__, __UINT_FAST16_TYPE__, __UINT_FAST32_TYPE__, __UINT_FAST64_TYPE__, __INTPTR_TYPE__, __UINTPTR_TYPE__, __WINT_MAX__, __SIZE_MAX__, __PTRDIFF_MAX__, __UINTMAX_MAX__, __SIG_ATOMIC_MAX__, __INT8_MAX__, __INT16_MAX__, __INT32_MAX__, __INT64_MAX__, __UINT8_MAX__, __UINT16_MAX__, __UINT32_MAX__, __UINT64_MAX__, __INT_LEAST8_MAX__, __INT_LEAST16_MAX__, __INT_LEAST32_MAX__, __INT_LEAST64_MAX__, __UINT_LEAST8_MAX__, __UINT_LEAST16_MAX__, __UINT_LEAST32_MAX__, __UINT_LEAST64_MAX__, __INT_FAST8_MAX__, __INT_FAST16_MAX__, __INT_FAST32_MAX__, __INT_FAST64_MAX__, __UINT_FAST8_MAX__, __UINT_FAST16_MAX__, __UINT_FAST32_MAX__, __UINT_FAST64_MAX__, __INTPTR_MAX__, __UINTPTR_MAX__, __WCHAR_MIN__, __WINT_MIN__, __SIG_ATOMIC_MIN__, __INT8_C, __INT16_C, __INT32_C, __INT64_C, __UINT8_C, __UINT16_C, __UINT32_C, __UINT64_C, __INTMAX_C, __UINTMAX_C): Document. * doc/tm.texi (SIG_ATOMIC_TYPE, INT8_TYPE, INT16_TYPE, INT32_TYPE, INT64_TYPE, UINT8_TYPE, UINT16_TYPE, UINT32_TYPE, UINT64_TYPE, INT_LEAST8_TYPE, INT_LEAST16_TYPE, INT_LEAST32_TYPE, INT_LEAST64_TYPE, UINT_LEAST8_TYPE, UINT_LEAST16_TYPE, UINT_LEAST32_TYPE, UINT_LEAST64_TYPE, INT_FAST8_TYPE, INT_FAST16_TYPE, INT_FAST32_TYPE, INT_FAST64_TYPE, UINT_FAST8_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE, UINT_FAST64_TYPE, INTPTR_TYPE, UINTPTR_TYPE): Document. gcc/testsuite: * lib/target-supports.exp (check_effective_target_stdint_types): Update comment. (check_effective_target_inttypes_types): New. * gcc.dg/c99-stdint-1.c, gcc.dg/c99-stdint-2.c, gcc.dg/c99-stdint-3.c, gcc.dg/c99-stdint-4.c, gcc.dg/c99-stdint-5.c, gcc.dg/c99-stdint-6.c: New tests. From-SVN: r145372
2009-03-31 22:30:31 +02:00
Define TS 18661-1 type width macros in <limits.h> and <stdint.h>. TS 18661-1 defines <limits.h> and <stdint.h> macros for widths of standard integer types and the typedefs defined in, or whose limits are defined in, <stdint.h>. (The connection to the main floating-point subject matter of TS 18661-1 is that these are intended to be used with the fromfp functions to convert from floating point to integer types of any width in any rounding direction, though these macros may be of more general use.) This patch implements support for these macros in GCC's <limits.h> and <stdint.h>. To avoid needing to implement fixincludes for system headers where GCC wraps the system libc's <stdint.h> in hosted mode, the test for the <stdint.h> macros uses -ffreestanding (I'll add the macros to glibc's headers separately) - but as usual for new features in these headers, platforms (primarily OpenBSD) that use USER_H to avoid using GCC's headers at all will have failures until the system headers have the feature added or appropriate fixincludes are implemented. The header macros are implemented using appropriate new predefined macros, with the code avoiding defining more such macros than necessary (so one predefined macro suffices for corresponding signed and unsigned types, while no such predefined macros are needed for the exact-width types such as int8_t). Bootstrapped with no regressions on x86_64-pc-linux-gnu. gcc: * doc/cpp.texi (__SCHAR_WIDTH__, __SHRT_WIDTH__, __INT_WIDTH__) (__LONG_WIDTH__, __LONG_LONG_WIDTH__, __PTRDIFF_WIDTH__) (__SIG_ATOMIC_WIDTH__, __SIZE_WIDTH__, __WCHAR_WIDTH__) (__WINT_WIDTH__, __INT_LEAST8_WIDTH__, __INT_LEAST16_WIDTH__) (__INT_LEAST32_WIDTH__, __INT_LEAST64_WIDTH__) (__INT_FAST8_WIDTH__, __INT_FAST16_WIDTH__, __INT_FAST32_WIDTH__) (__INT_FAST64_WIDTH__, __INTPTR_WIDTH__, __INTMAX_WIDTH__): Document. * ginclude/stdint-gcc.h [__STDC_WANT_IEC_60559_BFP_EXT__]: Define width macros from TS 18661-1. * glimits.h [__STDC_WANT_IEC_60559_BFP_EXT__]: Likewise. gcc/c-family: * c-cppbuiltin.c (builtin_define_type_width): New function. (builtin_define_stdint_macros, c_cpp_builtins): Define type width macros. gcc/testsuite: * gcc.dg/limits-width-1.c, gcc.dg/stdint-width-1.c: New tests. From-SVN: r240048
2016-09-09 18:59:43 +02:00
#ifdef __STDC_WANT_IEC_60559_BFP_EXT__
/* TS 18661-1 widths of integer types. */
#ifdef __INT8_TYPE__
# undef INT8_WIDTH
# define INT8_WIDTH 8
#endif
#ifdef __UINT8_TYPE__
# undef UINT8_WIDTH
# define UINT8_WIDTH 8
#endif
#ifdef __INT16_TYPE__
# undef INT16_WIDTH
# define INT16_WIDTH 16
#endif
#ifdef __UINT16_TYPE__
# undef UINT16_WIDTH
# define UINT16_WIDTH 16
#endif
#ifdef __INT32_TYPE__
# undef INT32_WIDTH
# define INT32_WIDTH 32
#endif
#ifdef __UINT32_TYPE__
# undef UINT32_WIDTH
# define UINT32_WIDTH 32
#endif
#ifdef __INT64_TYPE__
# undef INT64_WIDTH
# define INT64_WIDTH 64
#endif
#ifdef __UINT64_TYPE__
# undef UINT64_WIDTH
# define UINT64_WIDTH 64
#endif
#undef INT_LEAST8_WIDTH
#define INT_LEAST8_WIDTH __INT_LEAST8_WIDTH__
#undef UINT_LEAST8_WIDTH
#define UINT_LEAST8_WIDTH __INT_LEAST8_WIDTH__
#undef INT_LEAST16_WIDTH
#define INT_LEAST16_WIDTH __INT_LEAST16_WIDTH__
#undef UINT_LEAST16_WIDTH
#define UINT_LEAST16_WIDTH __INT_LEAST16_WIDTH__
#undef INT_LEAST32_WIDTH
#define INT_LEAST32_WIDTH __INT_LEAST32_WIDTH__
#undef UINT_LEAST32_WIDTH
#define UINT_LEAST32_WIDTH __INT_LEAST32_WIDTH__
#undef INT_LEAST64_WIDTH
#define INT_LEAST64_WIDTH __INT_LEAST64_WIDTH__
#undef UINT_LEAST64_WIDTH
#define UINT_LEAST64_WIDTH __INT_LEAST64_WIDTH__
#undef INT_FAST8_WIDTH
#define INT_FAST8_WIDTH __INT_FAST8_WIDTH__
#undef UINT_FAST8_WIDTH
#define UINT_FAST8_WIDTH __INT_FAST8_WIDTH__
#undef INT_FAST16_WIDTH
#define INT_FAST16_WIDTH __INT_FAST16_WIDTH__
#undef UINT_FAST16_WIDTH
#define UINT_FAST16_WIDTH __INT_FAST16_WIDTH__
#undef INT_FAST32_WIDTH
#define INT_FAST32_WIDTH __INT_FAST32_WIDTH__
#undef UINT_FAST32_WIDTH
#define UINT_FAST32_WIDTH __INT_FAST32_WIDTH__
#undef INT_FAST64_WIDTH
#define INT_FAST64_WIDTH __INT_FAST64_WIDTH__
#undef UINT_FAST64_WIDTH
#define UINT_FAST64_WIDTH __INT_FAST64_WIDTH__
#ifdef __INTPTR_TYPE__
# undef INTPTR_WIDTH
# define INTPTR_WIDTH __INTPTR_WIDTH__
#endif
#ifdef __UINTPTR_TYPE__
# undef UINTPTR_WIDTH
# define UINTPTR_WIDTH __INTPTR_WIDTH__
#endif
#undef INTMAX_WIDTH
#define INTMAX_WIDTH __INTMAX_WIDTH__
#undef UINTMAX_WIDTH
#define UINTMAX_WIDTH __INTMAX_WIDTH__
#undef PTRDIFF_WIDTH
#define PTRDIFF_WIDTH __PTRDIFF_WIDTH__
#undef SIG_ATOMIC_WIDTH
#define SIG_ATOMIC_WIDTH __SIG_ATOMIC_WIDTH__
#undef SIZE_WIDTH
#define SIZE_WIDTH __SIZE_WIDTH__
#undef WCHAR_WIDTH
#define WCHAR_WIDTH __WCHAR_WIDTH__
#undef WINT_WIDTH
#define WINT_WIDTH __WINT_WIDTH__
#endif
re PR c/448 (<stdint.h>-related issues (C99 issues)) PR c/448 fixincludes: * inclhack.def (newlib_stdint_1, newlib_stdint_2): New fixes. * fixincl.x: Regenerate. * tests/base/stdint.h: Update. gcc: * Makefile.in (USE_GCC_STDINT): Define. (stmp-int-hdrs): Install stdint.h if applicable. * c-common.c (CHAR16_TYPE): Define in terms of UINT_LEAST16_TYPE if known. (CHAR32_TYPE): Define in terms of UINT_LEAST32_TYPE if known. (SIG_ATOMIC_TYPE, INT8_TYPE, INT16_TYPE, INT32_TYPE, INT64_TYPE, UINT8_TYPE, UINT16_TYPE, UINT32_TYPE, UINT64_TYPE, INT_LEAST8_TYPE, INT_LEAST16_TYPE, INT_LEAST32_TYPE, INT_LEAST64_TYPE, UINT_LEAST8_TYPE, UINT_LEAST16_TYPE, UINT_LEAST32_TYPE, UINT_LEAST64_TYPE, INT_FAST8_TYPE, INT_FAST16_TYPE, INT_FAST32_TYPE, INT_FAST64_TYPE, UINT_FAST8_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE, UINT_FAST64_TYPE, INTPTR_TYPE, UINTPTR_TYPE): Define. (c_common_nodes_and_builtins): Initialize underlying_wchar_type_node. Do not initialize signed_wchar_type_node or unsigned_wchar_type_node. Initialize nodes for new types. (c_stddef_cpp_builtins): Define macros for new types. * c-common.h (CTI_SIGNED_WCHAR_TYPE, CTI_UNSIGNED_WCHAR_TYPE): Remove. (CTI_UNDERLYING_WCHAR_TYPE, CTI_SIG_ATOMIC_TYPE, CTI_INT8_TYPE, CTI_INT16_TYPE, CTI_INT32_TYPE, CTI_INT64_TYPE, CTI_UINT8_TYPE, CTI_UINT16_TYPE, CTI_UINT32_TYPE, CTI_UINT64_TYPE, CTI_INT_LEAST8_TYPE, CTI_INT_LEAST16_TYPE, CTI_INT_LEAST32_TYPE, CTI_INT_LEAST64_TYPE, CTI_UINT_LEAST8_TYPE, CTI_UINT_LEAST16_TYPE, CTI_UINT_LEAST32_TYPE, CTI_UINT_LEAST64_TYPE, CTI_INT_FAST8_TYPE, CTI_INT_FAST16_TYPE, CTI_INT_FAST32_TYPE, CTI_INT_FAST64_TYPE, CTI_UINT_FAST8_TYPE, CTI_UINT_FAST16_TYPE, CTI_UINT_FAST32_TYPE, CTI_UINT_FAST64_TYPE, CTI_INTPTR_TYPE, CTI_UINTPTR_TYPE): Define. (signed_wchar_type_node, unsigned_wchar_type_node): Remove. (underlying_wchar_type_node, sig_atomic_type_node, int8_type_node, int16_type_node, int32_type_node, int64_type_node, uint8_type_node, uint16_type_node, c_uint32_type_node, c_uint64_type_node, int_least8_type_node, int_least16_type_node, int_least32_type_node, int_least64_type_node, uint_least8_type_node, uint_least16_type_node, uint_least32_type_node, uint_least64_type_node, int_fast8_type_node, int_fast16_type_node, int_fast32_type_node, int_fast64_type_node, uint_fast8_type_node, uint_fast16_type_node, uint_fast32_type_node, uint_fast64_type_node, intptr_type_node, uintptr_type_node): Define. * c-cppbuiltin.c (builtin_define_constants, builtin_define_type_minmax): New. (builtin_define_stdint_macros): Define more macros. (c_cpp_builtins): Define more limit macros. (type_suffix): New. (builtin_define_type_max): Define in terms of builtin_define_type_minmax. Remove is_long parameter. All callers changed. * config.gcc (use_gcc_stdint): Define. (tm_file): Add glibc-stdint.h for targets using glibc or uClibc. Add newlib-stdint.h for generic targets. * config/glibc-stdint.h, config/newlib-stdint.h, ginclude/stdint-gcc.h, ginclude/stdint-wrap.h: New. * config/m32c/m32c.h (UINTPTR_TYPE): Define. * config/score/score.h (UINTPTR_TYPE): Define. * config/sol2.h (SIG_ATOMIC_TYPE, INT8_TYPE, INT16_TYPE, INT32_TYPE, INT64_TYPE, UINT8_TYPE, UINT16_TYPE, UINT32_TYPE, UINT64_TYPE, INT_LEAST8_TYPE, INT_LEAST16_TYPE, INT_LEAST32_TYPE, INT_LEAST64_TYPE, UINT_LEAST8_TYPE, UINT_LEAST16_TYPE, UINT_LEAST32_TYPE, UINT_LEAST64_TYPE, INT_FAST8_TYPE, INT_FAST16_TYPE, INT_FAST32_TYPE, INT_FAST64_TYPE, UINT_FAST8_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE, UINT_FAST64_TYPE, INTPTR_TYPE, UINTPTR_TYPE): Define. * config/spu/spu.h (STDINT_LONG32): Define. * configure.ac (use_gcc_stdint): Substitute. * configure: Regenerate. * doc/cpp.texi (__SIG_ATOMIC_TYPE__, __INT8_TYPE__, __INT16_TYPE__, __INT32_TYPE__, __INT64_TYPE__, __UINT8_TYPE__, __UINT16_TYPE__, __UINT32_TYPE__, __UINT64_TYPE__, __INT_LEAST8_TYPE__, __INT_LEAST16_TYPE__, __INT_LEAST32_TYPE__, __INT_LEAST64_TYPE__, __UINT_LEAST8_TYPE__, __UINT_LEAST16_TYPE__, __UINT_LEAST32_TYPE_, __UINT_LEAST64_TYPE__, __INT_FAST8_TYPE__, __INT_FAST16_TYPE__, __INT_FAST32_TYPE__, __INT_FAST64_TYPE__, __UINT_FAST8_TYPE__, __UINT_FAST16_TYPE__, __UINT_FAST32_TYPE__, __UINT_FAST64_TYPE__, __INTPTR_TYPE__, __UINTPTR_TYPE__, __WINT_MAX__, __SIZE_MAX__, __PTRDIFF_MAX__, __UINTMAX_MAX__, __SIG_ATOMIC_MAX__, __INT8_MAX__, __INT16_MAX__, __INT32_MAX__, __INT64_MAX__, __UINT8_MAX__, __UINT16_MAX__, __UINT32_MAX__, __UINT64_MAX__, __INT_LEAST8_MAX__, __INT_LEAST16_MAX__, __INT_LEAST32_MAX__, __INT_LEAST64_MAX__, __UINT_LEAST8_MAX__, __UINT_LEAST16_MAX__, __UINT_LEAST32_MAX__, __UINT_LEAST64_MAX__, __INT_FAST8_MAX__, __INT_FAST16_MAX__, __INT_FAST32_MAX__, __INT_FAST64_MAX__, __UINT_FAST8_MAX__, __UINT_FAST16_MAX__, __UINT_FAST32_MAX__, __UINT_FAST64_MAX__, __INTPTR_MAX__, __UINTPTR_MAX__, __WCHAR_MIN__, __WINT_MIN__, __SIG_ATOMIC_MIN__, __INT8_C, __INT16_C, __INT32_C, __INT64_C, __UINT8_C, __UINT16_C, __UINT32_C, __UINT64_C, __INTMAX_C, __UINTMAX_C): Document. * doc/tm.texi (SIG_ATOMIC_TYPE, INT8_TYPE, INT16_TYPE, INT32_TYPE, INT64_TYPE, UINT8_TYPE, UINT16_TYPE, UINT32_TYPE, UINT64_TYPE, INT_LEAST8_TYPE, INT_LEAST16_TYPE, INT_LEAST32_TYPE, INT_LEAST64_TYPE, UINT_LEAST8_TYPE, UINT_LEAST16_TYPE, UINT_LEAST32_TYPE, UINT_LEAST64_TYPE, INT_FAST8_TYPE, INT_FAST16_TYPE, INT_FAST32_TYPE, INT_FAST64_TYPE, UINT_FAST8_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE, UINT_FAST64_TYPE, INTPTR_TYPE, UINTPTR_TYPE): Document. gcc/testsuite: * lib/target-supports.exp (check_effective_target_stdint_types): Update comment. (check_effective_target_inttypes_types): New. * gcc.dg/c99-stdint-1.c, gcc.dg/c99-stdint-2.c, gcc.dg/c99-stdint-3.c, gcc.dg/c99-stdint-4.c, gcc.dg/c99-stdint-5.c, gcc.dg/c99-stdint-6.c: New tests. From-SVN: r145372
2009-03-31 22:30:31 +02:00
#endif /* _GCC_STDINT_H */