glibc/stdlib
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
..
bits
sys
a64l.c
abort.c
abs.c
add_n.c
addmul_1.c
alloca.h
at_quick_exit.c
atexit.c
atof.c
atoi.c
atol.c
atoll.c
bsearch.c
bug-fmtmsg1.c
bug-getcontext.c
bug-strtod2.c
bug-strtod.c
canonicalize.c
cmp.c
cxa_at_quick_exit.c
cxa_atexit.c
cxa_finalize.c
cxa_thread_atexit_impl.c
dbl2mpn.c
Depend
div.c
divmod_1.c
divrem.c
drand48_r.c
drand48-iter.c
drand48.c
erand48_r.c
erand48.c
errno.h
exit.c
exit.h
fmtmsg.c
fmtmsg.h
fpioconst.c
fpioconst.h
gen-fpioconst.c
gen-tst-strtod-round.c
getcontext.c
getenv.c
getsubopt.c
gmp-impl.h
gmp.h
grouping.c
grouping.h
groupingwc.c
inlines.c
isomac.c
jrand48_r.c
jrand48.c
l64a.c
labs.c
lcong48_r.c
lcong48.c
ldbl2mpn.c
ldiv.c
llabs.c
lldiv.c
longlong.h
lrand48_r.c
lrand48.c
lshift.c
makecontext.c
Makefile Add <stdint.h> integer width macros. 2016-09-21 17:06:36 +00:00
mblen.c
mbstowcs.c
mbtowc.c
mod_1.c
monetary.h
mp_clz_tab.c
mpn2dbl.c
mpn2flt.c
mpn2ldbl.c
mrand48_r.c
mrand48.c
msort.c
mul_1.c
mul_n.c
mul.c
nrand48_r.c
nrand48.c
old_atexit.c
on_exit.c
putenv.c
qsort.c
quick_exit.c
rand_r.c
rand.c
random_r.c
random.c
rpmatch.c
rshift.c
secure-getenv.c
seed48_r.c
seed48.c
setcontext.c
setenv.c
srand48_r.c
srand48.c
stdlib.h
strfmon_l.c
strfmon.c
strtod_l.c
strtod_nan_double.h
strtod_nan_float.h
strtod_nan_main.c
strtod_nan_narrow.h
strtod_nan_wide.h
strtod_nan.c
strtod.c
strtof_l.c
strtof_nan.c
strtof.c
strtoimax.c
strtol_l.c
strtol.c
strtold_l.c
strtold_nan.c
strtold.c
strtoll_l.c
strtoll.c
strtoul_l.c
strtoul.c
strtoull_l.c
strtoull.c
strtoumax.c
sub_n.c
submul_1.c
swapcontext.c
system.c
tens_in_limb.c
test-a64l.c
test-canon2.c
test-canon.c
testdiv.c
testdiv.input
testmb2.c
testmb.c
testrand.c
testsort.c
tst-atof1.c
tst-atof2.c
tst-bsearch.c
tst-environ.c
tst-fmtmsg.c
tst-fmtmsg.sh
tst-limits.c
tst-makecontext2.c
tst-makecontext3.c
tst-makecontext.c
tst-putenv.c
tst-putenvmod.c
tst-qsort2.c
tst-qsort.c
tst-quick_exit.cc
tst-rand48-2.c
tst-rand48.c
tst-random2.c
tst-random.c
tst-secure-getenv.c
tst-setcontext2.c
tst-setcontext3.c
tst-setcontext3.sh
tst-setcontext.c
tst-strfmon_l.c
tst-strtod2.c
tst-strtod3.c
tst-strtod4.c
tst-strtod5.c
tst-strtod6.c
tst-strtod-nan-locale-main.c
tst-strtod-nan-locale.c
tst-strtod-overflow.c
tst-strtod-round-data
tst-strtod-round-data.h
tst-strtod-round-skeleton.c
tst-strtod-round.c
tst-strtod-underflow.c
tst-strtod.c
tst-strtod.h
tst-strtol-locale-main.c
tst-strtol-locale.c
tst-strtol.c
tst-strtoll.c
tst-system.c
tst-thread-quick_exit.cc
tst-tininess.c
tst-tls-atexit-lib.c
tst-tls-atexit-nodelete.c
tst-tls-atexit.c
tst-unsetenv1.c
tst-width-stdint.c Add <stdint.h> integer width macros. 2016-09-21 17:06:36 +00:00
tst-width.c
tst-xpg-basename.c
ucontext.h
udiv_qrnnd.c
Versions
wcstoimax.c
wcstombs.c
wcstoumax.c
wctomb.c
xpg_basename.c