summaryrefslogtreecommitdiff
path: root/sysdeps/generic/stdint.h
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/generic/stdint.h')
-rw-r--r--sysdeps/generic/stdint.h125
1 files changed, 67 insertions, 58 deletions
diff --git a/sysdeps/generic/stdint.h b/sysdeps/generic/stdint.h
index 442762728b..11fb0ebef9 100644
--- a/sysdeps/generic/stdint.h
+++ b/sysdeps/generic/stdint.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,66 +22,34 @@
#ifndef _STDINT_H
#define _STDINT_H 1
-#include <features.h>
+#define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION
+#include <bits/libc-header-start.h>
+#include <bits/types.h>
#include <bits/wchar.h>
#include <bits/wordsize.h>
/* Exact integral types. */
/* Signed. */
-
-/* There is some amount of overlap with <sys/types.h> as known by inet code */
-#ifndef __int8_t_defined
-# define __int8_t_defined
-typedef signed char int8_t;
-typedef short int int16_t;
-typedef int int32_t;
-# if __WORDSIZE == 64
-typedef long int int64_t;
-# else
-__extension__
-typedef long long int int64_t;
-# endif
-#endif
+#include <bits/stdint-intn.h>
/* Unsigned. */
-typedef unsigned char uint8_t;
-typedef unsigned short int uint16_t;
-#ifndef __uint32_t_defined
-typedef unsigned int uint32_t;
-# define __uint32_t_defined
-#endif
-#if __WORDSIZE == 64
-typedef unsigned long int uint64_t;
-#else
-__extension__
-typedef unsigned long long int uint64_t;
-#endif
+#include <bits/stdint-uintn.h>
/* Small types. */
/* Signed. */
-typedef signed char int_least8_t;
-typedef short int int_least16_t;
-typedef int int_least32_t;
-#if __WORDSIZE == 64
-typedef long int int_least64_t;
-#else
-__extension__
-typedef long long int int_least64_t;
-#endif
+typedef __int_least8_t int_least8_t;
+typedef __int_least16_t int_least16_t;
+typedef __int_least32_t int_least32_t;
+typedef __int_least64_t int_least64_t;
/* Unsigned. */
-typedef unsigned char uint_least8_t;
-typedef unsigned short int uint_least16_t;
-typedef unsigned int uint_least32_t;
-#if __WORDSIZE == 64
-typedef unsigned long int uint_least64_t;
-#else
-__extension__
-typedef unsigned long long int uint_least64_t;
-#endif
+typedef __uint_least8_t uint_least8_t;
+typedef __uint_least16_t uint_least16_t;
+typedef __uint_least32_t uint_least32_t;
+typedef __uint_least64_t uint_least64_t;
/* Fast types. */
@@ -130,15 +98,8 @@ typedef unsigned int uintptr_t;
/* Largest integral types. */
-#if __WORDSIZE == 64
-typedef long int intmax_t;
-typedef unsigned long int uintmax_t;
-#else
-__extension__
-typedef long long int intmax_t;
-__extension__
-typedef unsigned long long int uintmax_t;
-#endif
+typedef __intmax_t intmax_t;
+typedef __uintmax_t uintmax_t;
# if __WORDSIZE == 64
@@ -248,8 +209,13 @@ typedef unsigned long long int uintmax_t;
# define PTRDIFF_MIN (-9223372036854775807L-1)
# define PTRDIFF_MAX (9223372036854775807L)
# else
-# define PTRDIFF_MIN (-2147483647-1)
-# define PTRDIFF_MAX (2147483647)
+# if __WORDSIZE32_PTRDIFF_LONG
+# define PTRDIFF_MIN (-2147483647L-1)
+# define PTRDIFF_MAX (2147483647L)
+# else
+# define PTRDIFF_MIN (-2147483647-1)
+# define PTRDIFF_MAX (2147483647)
+# endif
# endif
/* Limits of `sig_atomic_t'. */
@@ -260,7 +226,7 @@ typedef unsigned long long int uintmax_t;
# if __WORDSIZE == 64
# define SIZE_MAX (18446744073709551615UL)
# else
-# ifdef __WORDSIZE32_SIZE_ULONG
+# if __WORDSIZE32_SIZE_ULONG
# define SIZE_MAX (4294967295UL)
# else
# define SIZE_MAX (4294967295U)
@@ -307,4 +273,47 @@ typedef unsigned long long int uintmax_t;
# define UINTMAX_C(c) c ## ULL
# endif
+#if __GLIBC_USE (IEC_60559_BFP_EXT)
+
+# define INT8_WIDTH 8
+# define UINT8_WIDTH 8
+# define INT16_WIDTH 16
+# define UINT16_WIDTH 16
+# define INT32_WIDTH 32
+# define UINT32_WIDTH 32
+# define INT64_WIDTH 64
+# define UINT64_WIDTH 64
+
+# define INT_LEAST8_WIDTH 8
+# define UINT_LEAST8_WIDTH 8
+# define INT_LEAST16_WIDTH 16
+# define UINT_LEAST16_WIDTH 16
+# define INT_LEAST32_WIDTH 32
+# define UINT_LEAST32_WIDTH 32
+# define INT_LEAST64_WIDTH 64
+# define UINT_LEAST64_WIDTH 64
+
+# define INT_FAST8_WIDTH 8
+# define UINT_FAST8_WIDTH 8
+# define INT_FAST16_WIDTH __WORDSIZE
+# define UINT_FAST16_WIDTH __WORDSIZE
+# define INT_FAST32_WIDTH __WORDSIZE
+# define UINT_FAST32_WIDTH __WORDSIZE
+# define INT_FAST64_WIDTH 64
+# define UINT_FAST64_WIDTH 64
+
+# define INTPTR_WIDTH __WORDSIZE
+# define UINTPTR_WIDTH __WORDSIZE
+
+# define INTMAX_WIDTH 64
+# define UINTMAX_WIDTH 64
+
+# define PTRDIFF_WIDTH __WORDSIZE
+# define SIG_ATOMIC_WIDTH 32
+# define SIZE_WIDTH __WORDSIZE
+# define WCHAR_WIDTH 32
+# define WINT_WIDTH 32
+
+#endif
+
#endif /* stdint.h */