glibc/sysdeps
Joseph Myers 5b17fd0da6 Add <stdint.h> integer width macros.
TS 18661-1 defines macros for the width of integer types, intended for
use with the fromfp functions to convert from floating-point types to
integer types of any width, in any rounding mode and with control over
whether "inexact" is raised.  Such macros are, of course, more
generally useful than just with those functions.

Those macros are added to <limits.h> and <stdint.h>.  Having
previously added the <limits.h> macros, this patch adds the <stdint.h>
ones.  I've also added these macros to GCC's headers for GCC 7, but
for glibc systems, the definitions in GCC's <stdint.h> will only be
used with -ffreestanding.

Tested for x86_64 and x86.

	* sysdeps/generic/stdint.h: Define
	__GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION and include
	<bits/libc-header-start.h> instead of including <features.h>.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (INT8_WIDTH): New macro.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT8_WIDTH): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (INT16_WIDTH): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT16_WIDTH): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (INT32_WIDTH): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT32_WIDTH): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (INT64_WIDTH): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT64_WIDTH): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_LEAST8_WIDTH): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_LEAST8_WIDTH): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_LEAST16_WIDTH): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_LEAST16_WIDTH): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_LEAST32_WIDTH): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_LEAST32_WIDTH): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_LEAST64_WIDTH): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_LEAST64_WIDTH): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_FAST8_WIDTH): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_FAST8_WIDTH): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_FAST16_WIDTH): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_FAST16_WIDTH): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_FAST32_WIDTH): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_FAST32_WIDTH): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_FAST64_WIDTH): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_FAST64_WIDTH): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (INTPTR_WIDTH): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (UINTPTR_WIDTH): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (INTMAX_WIDTH): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (UINTMAX_WIDTH): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (PTRDIFF_WIDTH): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (SIG_ATOMIC_WIDTH): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (SIZE_WIDTH): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (WCHAR_WIDTH): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (WINT_WIDTH): Likewise.
	* manual/arith.texi (Integers): Document these macros for types
	specified by width properties.
	* manual/lang.texi (Width of Type): Document these macros for
	other standard typedefs.
	* stdlib/tst-width-stdint.c: New file.
	* stdlib/Makefile (tests): Add tst-width-stdint.
2016-09-21 17:06:36 +00:00
..
aarch64 Add femode_t functions: aarch64. 2016-09-07 16:41:20 +00:00
alpha Add femode_t functions: alpha. 2016-09-07 16:42:19 +00:00
arm Add femode_t functions: arm. 2016-09-07 16:43:03 +00:00
generic Add <stdint.h> integer width macros. 2016-09-21 17:06:36 +00:00
gnu Define UDP_ENCAP_* from Linux 4.7 in netinet/udp.h. 2016-08-03 12:13:16 +00:00
hppa Add femode_t functions: hppa. 2016-09-07 16:43:43 +00:00
i386 Remove remnants of .og patterns 2016-09-20 12:18:13 +02:00
ia64 Remove the ptw-% patterns 2016-09-14 16:02:06 +02:00
ieee754 Build s_nan* objects from a generic template 2016-09-20 14:37:42 -05:00
init_array Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
m68k Add femode_t functions: m68k. 2016-09-07 16:45:21 +00:00
mach malloc: Manual part of conversion to __libc_lock 2016-09-21 16:28:08 +02:00
microblaze Add femode_t functions. 2016-09-07 16:40:09 +00:00
mips Add femode_t functions: mips. 2016-09-07 16:46:02 +00:00
nacl Remove the ptw-% patterns 2016-09-14 16:02:06 +02:00
nios2 Add femode_t functions. 2016-09-07 16:40:09 +00:00
nptl malloc: Manual part of conversion to __libc_lock 2016-09-21 16:28:08 +02:00
posix hurd: fix fcntl visibility 2016-09-18 23:48:55 +02:00
powerpc powerpc: Fix POWER9 implies 2016-09-19 09:35:38 -03:00
pthread Revert "aio: fix newp->running data race" 2016-05-04 15:52:30 +02:00
s390 Remove the ptw-% patterns 2016-09-14 16:02:06 +02:00
sh Add femode_t functions: sh. 2016-09-07 16:48:08 +00:00
sparc Remove remnants of .og patterns 2016-09-20 12:18:13 +02:00
tile Add femode_t functions. 2016-09-07 16:40:09 +00:00
unix posix: Correctly block/unblock all signals on Linux posix_spawn 2016-09-20 17:18:15 -03:00
wordsize-32 Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
wordsize-64 Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
x86 Add femode_t functions. 2016-09-07 16:40:09 +00:00
x86_64 Add femode_t functions. 2016-09-07 16:40:09 +00:00