shithub: scc

Download patch

ref: dafcc1466cedda9de51c749bdfb04e6c58429765
parent: 7fe70d06bd207ca43eaaf2b13c85900decf88b5f
author: Quentin Rameau <[email protected]>
date: Fri Mar 10 11:13:57 EST 2017

[libc] Complete stdint.h

--- a/libc/include/bits/amd64-sysv/arch/stdint.h
+++ b/libc/include/bits/amd64-sysv/arch/stdint.h
@@ -1,5 +1,85 @@
 /* See LICENSE file for copyright and license details. */
 
+#define INT8_MIN   (-128)
+#define INT8_MAX   127
+#define UINT8_MAX  255
+
+#define INT16_MIN  (-32768)
+#define INT16_MAX  32767
+#define UINT16_MAX 65535
+
+#define INT32_MIN  (-2147483648)
+#define INT32_MAX  2147483647
+#define UINT32_MAX 4294967295U
+
+#define INT64_MIN  (-9223372036854775808)
+#define INT64_MAX  9223372036854775807
+#define UINT64_MAX 18446744073709551615U
+
+#define INT_LEAST8_MIN   (-128)
+#define INT_LEAST8_MAX   127
+#define UINT_LEAST8_MAX  255
+
+#define INT_LEAST16_MIN  (-32768)
+#define INT_LEAST16_MAX  32767
+#define UINT_LEAST16_MAX 65535
+
+#define INT_LEAST32_MIN  (-2147483648)
+#define INT_LEAST32_MAX  2147483647
+#define UINT_LEAST32_MAX 4294967295U
+
+#define INT_LEAST64_MIN  (-9223372036854775808)
+#define INT_LEAST64_MAX  9223372036854775807
+#define UINT_LEAST64_MAX 18446744073709551615U
+
+#define INT_FAST8_MIN   (-2147483648)
+#define INT_FAST8_MAX   2147483647
+#define UINT_FAST8_MAX  4294967295U
+
+#define INT_FAST16_MIN  (-2147483648)
+#define INT_FAST16_MAX  2147483647
+#define UINT_FAST16_MAX 4294967295U
+
+#define INT_FAST32_MIN  (-2147483648)
+#define INT_FAST32_MAX  2147483647
+#define UINT_FAST32_MAX 4294967295U
+
+#define INT_FAST64_MIN  (-9223372036854775808)
+#define INT_FAST64_MAX  9223372036854775807
+#define UINT_FAST64_MAX 18446744073709551615U
+
+#define INTPTR_MIN  (-9223372036854775808)
+#define INTPTR_MAX  9223372036854775807
+#define UINTPTR_MAX 18446744073709551615U
+
+#define INTMAX_MIN  (-9223372036854775808)
+#define INTMAX_MAX  9223372036854775807
+#define UINTMAX_MAX 18446744073709551615U
+
+#define PTRDIFF_MIN (-2147483648)
+#define PTRDIFF_MAX 2147483647
+
+#define SIG_ATOMIC_MIN (-2147483648)
+#define SIG_ATOMIC_MAX 2147483647
+
+#define SIZE_MAX 18446744073709551615U
+
+#define WCHAR_MIN (-2147483648)
+#define WCHAR_MAX 2147483647
+
+#define INT8_C(x)  x
+#define INT16_C(x) x
+#define INT32_C(x) x
+#define INT64_C(x) x ## L
+
+#define UINT8_C(x)  x
+#define UINT16_C(x) x
+#define UINT32_C(x) x ## U
+#define UINT64_C(x) x ## UL
+
+#define INTMAX_C(x)  x ## L
+#define UINTMAX_C(x) x ## UL
+
 typedef signed char int8_t;
 typedef short int16_t;
 typedef int int32_t;
--- a/libc/include/bits/i386-sysv/arch/stdint.h
+++ b/libc/include/bits/i386-sysv/arch/stdint.h
@@ -1,5 +1,85 @@
 /* See LICENSE file for copyright and license details. */
 
+#define INT8_MIN   (-128)
+#define INT8_MAX   127
+#define UINT8_MAX  255
+
+#define INT16_MIN  (-32768)
+#define INT16_MAX  32767
+#define UINT16_MAX 65535
+
+#define INT32_MIN  (-2147483648)
+#define INT32_MAX  2147483647
+#define UINT32_MAX 4294967295U
+
+#define INT64_MIN  (-9223372036854775808)
+#define INT64_MAX  9223372036854775807
+#define UINT64_MAX 18446744073709551615U
+
+#define INT_LEAST8_MIN   (-128)
+#define INT_LEAST8_MAX   127
+#define UINT_LEAST8_MAX  255
+
+#define INT_LEAST16_MIN  (-32768)
+#define INT_LEAST16_MAX  32767
+#define UINT_LEAST16_MAX 65535
+
+#define INT_LEAST32_MIN  (-2147483648)
+#define INT_LEAST32_MAX  2147483647
+#define UINT_LEAST32_MAX 4294967295U
+
+#define INT_LEAST64_MIN  (-9223372036854775808)
+#define INT_LEAST64_MAX  9223372036854775807
+#define UINT_LEAST64_MAX 18446744073709551615U
+
+#define INT_FAST8_MIN   (-2147483648)
+#define INT_FAST8_MAX   2147483647
+#define UINT_FAST8_MAX  4294967295U
+
+#define INT_FAST16_MIN  (-2147483648)
+#define INT_FAST16_MAX  2147483647
+#define UINT_FAST16_MAX 4294967295U
+
+#define INT_FAST32_MIN  (-2147483648)
+#define INT_FAST32_MAX  2147483647
+#define UINT_FAST32_MAX 4294967295U
+
+#define INT_FAST64_MIN  (-9223372036854775808)
+#define INT_FAST64_MAX  9223372036854775807
+#define UINT_FAST64_MAX 18446744073709551615U
+
+#define INTPTR_MIN  (-9223372036854775808)
+#define INTPTR_MAX  9223372036854775807
+#define UINTPTR_MAX 18446744073709551615U
+
+#define INTMAX_MIN  (-9223372036854775808)
+#define INTMAX_MAX  9223372036854775807
+#define UINTMAX_MAX 18446744073709551615U
+
+#define PTRDIFF_MIN (-9223372036854775808)
+#define PTRDIFF_MAX 9223372036854775807
+
+#define SIG_ATOMIC_MIN (-2147483648)
+#define SIG_ATOMIC_MAX 2147483647
+
+#define SIZE_MAX 18446744073709551615U
+
+#define WCHAR_MIN (-2147483648)
+#define WCHAR_MAX 2147483647
+
+#define INT8_C(x)  x
+#define INT16_C(x) x
+#define INT32_C(x) x
+#define INT64_C(x) x ## LL
+
+#define UINT8_C(x)  x
+#define UINT16_C(x) x
+#define UINT32_C(x) x ## U
+#define UINT64_C(x) x ## ULL
+
+#define INTMAX_C(x)  x ## LL
+#define UINTMAX_C(x) x ## ULL
+
 typedef signed char int8_t;
 typedef short int16_t;
 typedef int int32_t;
--- a/libc/include/bits/qbe/arch/stdint.h
+++ b/libc/include/bits/qbe/arch/stdint.h
@@ -1,5 +1,85 @@
 /* See LICENSE file for copyright and license details. */
 
+#define INT8_MIN   (-128)
+#define INT8_MAX   127
+#define UINT8_MAX  255
+
+#define INT16_MIN  (-32768)
+#define INT16_MAX  32767
+#define UINT16_MAX 65535
+
+#define INT32_MIN  (-2147483648)
+#define INT32_MAX  2147483647
+#define UINT32_MAX 4294967295U
+
+#define INT64_MIN  (-9223372036854775808)
+#define INT64_MAX  9223372036854775807
+#define UINT64_MAX 18446744073709551615U
+
+#define INT_LEAST8_MIN   (-128)
+#define INT_LEAST8_MAX   127
+#define UINT_LEAST8_MAX  255
+
+#define INT_LEAST16_MIN  (-32768)
+#define INT_LEAST16_MAX  32767
+#define UINT_LEAST16_MAX 65535
+
+#define INT_LEAST32_MIN  (-2147483648)
+#define INT_LEAST32_MAX  2147483647
+#define UINT_LEAST32_MAX 4294967295U
+
+#define INT_LEAST64_MIN  (-9223372036854775808)
+#define INT_LEAST64_MAX  9223372036854775807
+#define UINT_LEAST64_MAX 18446744073709551615U
+
+#define INT_FAST8_MIN   (-2147483648)
+#define INT_FAST8_MAX   2147483647
+#define UINT_FAST8_MAX  4294967295U
+
+#define INT_FAST16_MIN  (-2147483648)
+#define INT_FAST16_MAX  2147483647
+#define UINT_FAST16_MAX 4294967295U
+
+#define INT_FAST32_MIN  (-2147483648)
+#define INT_FAST32_MAX  2147483647
+#define UINT_FAST32_MAX 4294967295U
+
+#define INT_FAST64_MIN  (-9223372036854775808)
+#define INT_FAST64_MAX  9223372036854775807
+#define UINT_FAST64_MAX 18446744073709551615U
+
+#define INTPTR_MIN  (-9223372036854775808)
+#define INTPTR_MAX  9223372036854775807
+#define UINTPTR_MAX 18446744073709551615U
+
+#define INTMAX_MIN  (-9223372036854775808)
+#define INTMAX_MAX  9223372036854775807
+#define UINTMAX_MAX 18446744073709551615U
+
+#define PTRDIFF_MIN (-9223372036854775808)
+#define PTRDIFF_MAX 9223372036854775807
+
+#define SIG_ATOMIC_MIN (-2147483648)
+#define SIG_ATOMIC_MAX 2147483647
+
+#define SIZE_MAX 18446744073709551615U
+
+#define WCHAR_MIN (-2147483648)
+#define WCHAR_MAX 2147483647
+
+#define INT8_C(x)  x
+#define INT16_C(x) x
+#define INT32_C(x) x
+#define INT64_C(x) x ## L
+
+#define UINT8_C(x)  x
+#define UINT16_C(x) x
+#define UINT32_C(x) x ## U
+#define UINT64_C(x) x ## UL
+
+#define INTMAX_C(x)  x ## L
+#define UINTMAX_C(x) x ## UL
+
 typedef signed char int8_t;
 typedef short int16_t;
 typedef int int32_t;
--- a/libc/include/bits/z80/arch/stdint.h
+++ b/libc/include/bits/z80/arch/stdint.h
@@ -1,5 +1,85 @@
 /* See LICENSE file for copyright and license details. */
 
+#define INT8_MIN   (-128)
+#define INT8_MAX   127
+#define UINT8_MAX  255
+
+#define INT16_MIN  (-32768)
+#define INT16_MAX  32767
+#define UINT16_MAX 65535U
+
+#define INT32_MIN  (-2147483648)
+#define INT32_MAX  2147483647
+#define UINT32_MAX 4294967295U
+
+#define INT64_MIN  (-9223372036854775808)
+#define INT64_MAX  9223372036854775807
+#define UINT64_MAX 18446744073709551615U
+
+#define INT_LEAST8_MIN   (-128)
+#define INT_LEAST8_MAX   127
+#define UINT_LEAST8_MAX  255
+
+#define INT_LEAST16_MIN  (-32768)
+#define INT_LEAST16_MAX  32767
+#define UINT_LEAST16_MAX 65535U
+
+#define INT_LEAST32_MIN  (-2147483648)
+#define INT_LEAST32_MAX  2147483647
+#define UINT_LEAST32_MAX 4294967295U
+
+#define INT_LEAST64_MIN  (-9223372036854775808)
+#define INT_LEAST64_MAX  9223372036854775807
+#define UINT_LEAST64_MAX 18446744073709551615U
+
+#define INT_FAST8_MIN   (-32768)
+#define INT_FAST8_MAX   32767
+#define UINT_FAST8_MAX  65535U
+
+#define INT_FAST16_MIN  (-32768)
+#define INT_FAST16_MAX  32767
+#define UINT_FAST16_MAX 65535U
+
+#define INT_FAST32_MIN  (-2147483648)
+#define INT_FAST32_MAX  2147483647
+#define UINT_FAST32_MAX 4294967295U
+
+#define INT_FAST64_MIN  (-9223372036854775808)
+#define INT_FAST64_MAX  9223372036854775807
+#define UINT_FAST64_MAX 18446744073709551615U
+
+#define INTPTR_MIN  (-32768)
+#define INTPTR_MAX  32767
+#define UINTPTR_MAX 65535U
+
+#define INTMAX_MIN  (-32768)
+#define INTMAX_MAX  32767
+#define UINTMAX_MAX 65535U
+
+#define PTRDIFF_MIN (-32768)
+#define PTRDIFF_MAX 32767
+
+#define SIG_ATOMIC_MIN (-128)
+#define SIG_ATOMIC_MAX 127
+
+#define SIZE_MAX 18446744073709551615U
+
+#define WCHAR_MIN (-32768)
+#define WCHAR_MAX 32767
+
+#define INT8_C(x)  x
+#define INT16_C(x) x
+#define INT32_C(x) x ## L
+#define INT64_C(x) x ## LL
+
+#define UINT8_C(x)  x
+#define UINT16_C(x) x ## U
+#define UINT32_C(x) x ## UL
+#define UINT64_C(x) x ## ULL
+
+#define INTMAX_C(x)  x ## LL
+#define UINTMAX_C(x) x ## ULL
+
 typedef signed char int8_t;
 typedef int int16_t;
 typedef long int32_t;