shithub: scc

Download patch

ref: dc0bb040730844c8019efbe09cb0ae81e7f1495d
parent: c679d867ba0e7d6c4ebbd82649d0eed8a4fe0c2a
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Thu Feb 16 12:21:05 EST 2017

[libc] Make stdint.h portable between architectures

--- /dev/null
+++ b/libc/include/amd64-sysv/arch/stdint.h
@@ -1,0 +1,37 @@
+/* See LICENSE file for copyright and license details. */
+
+typedef signed char int8_t;
+typedef short int16_t;
+typedef int int32_t;
+typedef long int64_t;
+
+typedef unsigned char uint8_t;
+typedef unsigned short uint16_t;
+typedef unsigned int uint32_t;
+typedef unsigned long uint64_t;
+
+typedef signed char int8_least_t;
+typedef short int16_least_t;
+typedef int int32_least_t;
+typedef long int64_least_t;
+
+typedef unsigned char uint8_least_t;
+typedef unsigned short uint16_least_t;
+typedef unsigned int uint32_least_t;
+typedef unsigned long uint64_least_t;
+
+typedef int int8_fast_t;
+typedef int int16_fast_t;
+typedef int int32_fast_t;
+typedef long int64_fast_t;
+
+typedef unsigned int8_fast_t;
+typedef unsigned int16_fast_t;
+typedef unsigned int32_fast_t;
+typedef unsigned long int64_fast_t;
+
+typedef long intptr_t;
+typedef unsigned long uintptr_t;
+
+typedef long intmax_t;
+typedef unsigned long uintmax_t;
--- a/libc/include/amd64-sysv/stdint.h
+++ /dev/null
@@ -1,41 +1,0 @@
-/* See LICENSE file for copyright and license details. */
-#ifndef _STDINT_H_
-#define _STDINT_H_
-
-typedef signed char int8_t;
-typedef short int16_t;
-typedef int int32_t;
-typedef long int64_t;
-
-typedef unsigned char uint8_t;
-typedef unsigned short uint16_t;
-typedef unsigned int uint32_t;
-typedef unsigned long uint64_t;
-
-typedef signed char int8_least_t;
-typedef short int16_least_t;
-typedef int int32_least_t;
-typedef long int64_least_t;
-
-typedef unsigned char uint8_least_t;
-typedef unsigned short uint16_least_t;
-typedef unsigned int uint32_least_t;
-typedef unsigned long uint64_least_t;
-
-typedef int int8_fast_t;
-typedef int int16_fast_t;
-typedef int int32_fast_t;
-typedef long int64_fast_t;
-
-typedef unsigned int8_fast_t;
-typedef unsigned int16_fast_t;
-typedef unsigned int32_fast_t;
-typedef unsigned long int64_fast_t;
-
-typedef long intptr_t;
-typedef unsigned long uintptr_t;
-
-typedef long intmax_t;
-typedef unsigned long uintmax_t;
-
-#endif
--- /dev/null
+++ b/libc/include/i386-sysv/arch/stdint.h
@@ -1,0 +1,38 @@
+/* See LICENSE file for copyright and license details. */
+
+typedef signed char int8_t;
+typedef short int16_t;
+typedef int int32_t;
+typedef long long int64_t;
+
+typedef unsigned char uint8_t;
+typedef unsigned short uint16_t;
+typedef unsigned uint32_t;
+typedef unsigned long long uint64_t;
+
+typedef signed char int8_least_t;
+typedef short int16_least_t;
+typedef int int32_least_t;
+typedef long long int64_least_t;
+
+typedef unsigned char uint8_least_t;
+typedef unsigned short uint16_least_t;
+typedef unsigned uint32_least_t;
+typedef unsigned long long uint64_least_t;
+
+typedef int int8_fast_t;
+typedef int int16_fast_t;
+typedef int int32_fast_t;
+typedef long long int64_fast_t;
+
+typedef unsigned int8_fast_t;
+typedef unsigned int16_fast_t;
+typedef unsigned int32_fast_t;
+typedef unsigned long long int64_fast_t;
+
+typedef intptr_t long;
+typedef long long uintptr_t unsigned;
+
+typedef intmax_t long;
+typedef long long uintmax_t unsigned;
+
--- a/libc/include/i386-sysv/stdint.h
+++ /dev/null
@@ -1,41 +1,0 @@
-/* See LICENSE file for copyright and license details. */
-#ifndef _STDINT_H_
-#define _STDINT_H_
-
-typedef signed char int8_t;
-typedef short int16_t;
-typedef int int32_t;
-typedef long long int64_t;
-
-typedef unsigned char uint8_t;
-typedef unsigned short uint16_t;
-typedef unsigned uint32_t;
-typedef unsigned long long uint64_t;
-
-typedef signed char int8_least_t;
-typedef short int16_least_t;
-typedef int int32_least_t;
-typedef long long int64_least_t;
-
-typedef unsigned char uint8_least_t;
-typedef unsigned short uint16_least_t;
-typedef unsigned uint32_least_t;
-typedef unsigned long long uint64_least_t;
-
-typedef int int8_fast_t;
-typedef int int16_fast_t;
-typedef int int32_fast_t;
-typedef long long int64_fast_t;
-
-typedef unsigned int8_fast_t;
-typedef unsigned int16_fast_t;
-typedef unsigned int32_fast_t;
-typedef unsigned long long int64_fast_t;
-
-typedef intptr_t long;
-typedef long long uintptr_t unsigned;
-
-typedef intmax_t long;
-typedef long long uintmax_t unsigned;
-
-#endif
--- /dev/null
+++ b/libc/include/qbe/arch/stdint.h
@@ -1,0 +1,37 @@
+/* See LICENSE file for copyright and license details. */
+
+typedef signed char int8_t;
+typedef short int16_t;
+typedef int int32_t;
+typedef long int64_t;
+
+typedef unsigned char uint8_t;
+typedef unsigned short uint16_t;
+typedef unsigned int uint32_t;
+typedef unsigned long uint64_t;
+
+typedef signed char int8_least_t;
+typedef short int16_least_t;
+typedef int int32_least_t;
+typedef long int64_least_t;
+
+typedef unsigned char uint8_least_t;
+typedef unsigned short uint16_least_t;
+typedef unsigned int uint32_least_t;
+typedef unsigned long uint64_least_t;
+
+typedef int int8_fast_t;
+typedef int int16_fast_t;
+typedef int int32_fast_t;
+typedef long int64_fast_t;
+
+typedef unsigned int8_fast_t;
+typedef unsigned int16_fast_t;
+typedef unsigned int32_fast_t;
+typedef unsigned long int64_fast_t;
+
+typedef long intptr_t;
+typedef unsigned long uintptr_t;
+
+typedef long intmax_t;
+typedef unsigned long uintmax_t;
--- a/libc/include/qbe/stdint.h
+++ /dev/null
@@ -1,41 +1,0 @@
-/* See LICENSE file for copyright and license details. */
-#ifndef _STDINT_H_
-#define _STDINT_H_
-
-typedef signed char int8_t;
-typedef short int16_t;
-typedef int int32_t;
-typedef long int64_t;
-
-typedef unsigned char uint8_t;
-typedef unsigned short uint16_t;
-typedef unsigned int uint32_t;
-typedef unsigned long uint64_t;
-
-typedef signed char int8_least_t;
-typedef short int16_least_t;
-typedef int int32_least_t;
-typedef long int64_least_t;
-
-typedef unsigned char uint8_least_t;
-typedef unsigned short uint16_least_t;
-typedef unsigned int uint32_least_t;
-typedef unsigned long uint64_least_t;
-
-typedef int int8_fast_t;
-typedef int int16_fast_t;
-typedef int int32_fast_t;
-typedef long int64_fast_t;
-
-typedef unsigned int8_fast_t;
-typedef unsigned int16_fast_t;
-typedef unsigned int32_fast_t;
-typedef unsigned long int64_fast_t;
-
-typedef long intptr_t;
-typedef unsigned long uintptr_t;
-
-typedef long intmax_t;
-typedef unsigned long uintmax_t;
-
-#endif
--- /dev/null
+++ b/libc/include/stdint.h
@@ -1,0 +1,7 @@
+/* See LICENSE file for copyright and license details. */
+#ifndef _STDINT_H_
+#define _STDINT_H_
+
+#include <arch/stdint.h>
+
+#endif
--- /dev/null
+++ b/libc/include/z80/arch/stdint.h
@@ -1,0 +1,37 @@
+/* See LICENSE file for copyright and license details. */
+
+typedef signed char int8_t;
+typedef int int16_t;
+typedef long int32_t;
+typedef long long int64_t;
+
+typedef unsigned char uint8_t;
+typedef unsigned uint16_t;
+typedef unsigned long uint32_t;
+typedef unsigned long long uint64_t;
+
+typedef signed char int8_least_t;
+typedef int int16_least_t;
+typedef long int32_least_t;
+typedef long long int64_least_t;
+
+typedef unsigned char uint8_least_t;
+typedef unsigned uint16_least_t;
+typedef unsigned long uint32_least_t;
+typedef unsigned long long uint64_least_t;
+
+typedef signed char int8_fast_t;
+typedef int int16_fast_t;
+typedef long int32_fast_t;
+typedef long long int64_fast_t;
+
+typedef unsigned char uint8_fast_t;
+typedef unsigned uint16_fast_t;
+typedef unsigned long uint32_fast_t;
+typedef unsigned long long uint64_fast_t;
+
+typedef int intptr_t;
+typedef unsigned uintptr_t;
+
+typedef long long intmax_t;
+typedef unsigned long long uintmax_t;
--- a/libc/include/z80/stdint.h
+++ /dev/null
@@ -1,41 +1,0 @@
-/* See LICENSE file for copyright and license details. */
-#ifndef _STDINT_H_
-#define _STDINT_H_
-
-typedef signed char int8_t;
-typedef int int16_t;
-typedef long int32_t;
-typedef long long int64_t;
-
-typedef unsigned char uint8_t;
-typedef unsigned uint16_t;
-typedef unsigned long uint32_t;
-typedef unsigned long long uint64_t;
-
-typedef signed char int8_least_t;
-typedef int int16_least_t;
-typedef long int32_least_t;
-typedef long long int64_least_t;
-
-typedef unsigned char uint8_least_t;
-typedef unsigned uint16_least_t;
-typedef unsigned long uint32_least_t;
-typedef unsigned long long uint64_least_t;
-
-typedef signed char int8_fast_t;
-typedef int int16_fast_t;
-typedef long int32_fast_t;
-typedef long long int64_fast_t;
-
-typedef unsigned char uint8_fast_t;
-typedef unsigned uint16_fast_t;
-typedef unsigned long uint32_fast_t;
-typedef unsigned long long uint64_fast_t;
-
-typedef int intptr_t;
-typedef unsigned uintptr_t;
-
-typedef long long intmax_t;
-typedef unsigned long long uintmax_t;
-
-#endif