summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Libraries/LibC/bits/stdint.h109
-rwxr-xr-xLibraries/LibC/install.sh2
-rw-r--r--Libraries/LibC/inttypes.h2
-rw-r--r--Libraries/LibC/limits.h2
-rw-r--r--Libraries/LibC/netinet/in.h2
-rw-r--r--Libraries/LibC/netinet/ip_icmp.h2
-rw-r--r--Libraries/LibC/setjmp.h2
-rw-r--r--Libraries/LibC/stdint.h106
-rw-r--r--Libraries/LibC/sys/socket.h2
-rw-r--r--Libraries/LibC/sys/types.h2
10 files changed, 119 insertions, 112 deletions
diff --git a/Libraries/LibC/bits/stdint.h b/Libraries/LibC/bits/stdint.h
new file mode 100644
index 0000000000..8e1fbcba4d
--- /dev/null
+++ b/Libraries/LibC/bits/stdint.h
@@ -0,0 +1,109 @@
+#pragma once
+
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+
+typedef __UINT64_TYPE__ uint64_t;
+typedef __UINT32_TYPE__ uint32_t;
+typedef __UINT16_TYPE__ uint16_t;
+typedef __UINT8_TYPE__ uint8_t;
+
+typedef __INT64_TYPE__ int64_t;
+typedef __INT32_TYPE__ int32_t;
+typedef __INT16_TYPE__ int16_t;
+typedef __INT8_TYPE__ int8_t;
+
+typedef __UINT_FAST8_TYPE__ uint_fast8_t;
+typedef __UINT_FAST16_TYPE__ uint_fast16_t;
+typedef __UINT_FAST32_TYPE__ uint_fast32_t;
+typedef __UINT_FAST64_TYPE__ uint_fast64_t;
+
+typedef __INT_FAST8_TYPE__ int_fast8_t;
+typedef __INT_FAST16_TYPE__ int_fast16_t;
+typedef __INT_FAST32_TYPE__ int_fast32_t;
+typedef __INT_FAST64_TYPE__ int_fast64_t;
+
+typedef __UINT_LEAST8_TYPE__ uint_least8_t;
+typedef __UINT_LEAST16_TYPE__ uint_least16_t;
+typedef __UINT_LEAST32_TYPE__ uint_least32_t;
+typedef __UINT_LEAST64_TYPE__ uint_least64_t;
+
+typedef __INT_LEAST8_TYPE__ int_least8_t;
+typedef __INT_LEAST16_TYPE__ int_least16_t;
+typedef __INT_LEAST32_TYPE__ int_least32_t;
+typedef __INT_LEAST64_TYPE__ int_least64_t;
+
+#define __int8_t_defined 1
+#define __uint8_t_defined 1
+#define __int16_t_defined 1
+#define __uint16_t_defined 1
+#define __int32_t_defined 1
+#define __uint32_t_defined 1
+#define __int64_t_defined 1
+#define __uint64_t_defined 1
+
+typedef __PTRDIFF_TYPE__ uintptr_t;
+typedef __PTRDIFF_TYPE__ intptr_t;
+
+typedef __UINTMAX_TYPE__ uintmax_t;
+#define UINTMAX_MAX __UINTMAX_MAX__
+#define UINTMAX_MIN __UINTMAX_MIN__
+
+typedef __INTMAX_TYPE__ intmax_t;
+#define INTMAX_MAX __INTMAX_MAX__
+#define INTMAX_MIN (-INTMAX_MAX - 1)
+
+#define INT8_MIN (-128)
+#define INT16_MIN (-32767 - 1)
+#define INT32_MIN (-2147483647 - 1)
+#define INT64_MIN (-9223372036854775807LL - 1LL)
+#define INT8_MAX (127)
+#define INT16_MAX (32767)
+#define INT32_MAX (2147483647)
+#define INT64_MAX (9223372036854775807LL)
+#define UINT8_MAX (255)
+#define UINT16_MAX (65535)
+#define UINT32_MAX (4294967295U)
+#define UINT64_MAX (18446744073709551615ULL)
+
+#define INTPTR_MAX INT32_MAX
+#define INTPTR_MIN INT32_MIN
+#define UINTPTR_MAX UINT32_MAX
+
+#define INT_FAST8_MIN INT8_MIN
+#define INT_FAST16_MIN INT16_MIN
+#define INT_FAST32_MIN INT32_MIN
+#define INT_FAST64_MIN INT64_MIN
+
+#define INT_FAST8_MAX INT8_MAX
+#define INT_FAST16_MAX INT16_MAX
+#define INT_FAST32_MAX INT32_MAX
+#define INT_FAST64_MAX INT64_MAX
+
+#define UINT_FAST8_MAX UINT8_MAX
+#define UINT_FAST16_MAX UINT16_MAX
+#define UINT_FAST32_MAX UINT32_MAX
+#define UINT_FAST64_MAX UINT64_MAX
+
+#define INT_LEAST8_MIN INT8_MIN
+#define INT_LEAST16_MIN INT16_MIN
+#define INT_LEAST32_MIN INT32_MIN
+#define INT_LEAST64_MIN INT64_MIN
+
+#define INT_LEAST8_MAX INT8_MAX
+#define INT_LEAST16_MAX INT16_MAX
+#define INT_LEAST32_MAX INT32_MAX
+#define INT_LEAST64_MAX INT64_MAX
+
+#define UINT_LEAST8_MAX UINT8_MAX
+#define UINT_LEAST16_MAX UINT16_MAX
+#define UINT_LEAST32_MAX UINT32_MAX
+#define UINT_LEAST64_MAX UINT64_MAX
+
+#define INT64_C(x) x##LL
+#define UINT64_C(x) x##ULL
+
+#define SIZE_MAX ((size_t)-1)
+
+__END_DECLS
diff --git a/Libraries/LibC/install.sh b/Libraries/LibC/install.sh
index c8f2e7aabe..713af28094 100755
--- a/Libraries/LibC/install.sh
+++ b/Libraries/LibC/install.sh
@@ -4,11 +4,13 @@ set -e
SERENITY_ROOT=../../
mkdir -p $SERENITY_ROOT/Root/usr/include/sys/
+mkdir -p $SERENITY_ROOT/Root/usr/include/bits/
mkdir -p $SERENITY_ROOT/Root/usr/include/netinet/
mkdir -p $SERENITY_ROOT/Root/usr/include/arpa/
mkdir -p $SERENITY_ROOT/Root/usr/lib/
cp *.h $SERENITY_ROOT/Root/usr/include/
cp sys/*.h $SERENITY_ROOT/Root/usr/include/sys/
+cp bits/*.h $SERENITY_ROOT/Root/usr/include/bits/
cp arpa/*.h $SERENITY_ROOT/Root/usr/include/arpa/
cp netinet/*.h $SERENITY_ROOT/Root/usr/include/netinet/
cp libc.a $SERENITY_ROOT/Root/usr/lib/
diff --git a/Libraries/LibC/inttypes.h b/Libraries/LibC/inttypes.h
index 5686f3880a..7f27521caa 100644
--- a/Libraries/LibC/inttypes.h
+++ b/Libraries/LibC/inttypes.h
@@ -1,6 +1,6 @@
#pragma once
-#include <stdint.h>
+#include <bits/stdint.h>
#define PRId8 "d"
#define PRId16 "d"
diff --git a/Libraries/LibC/limits.h b/Libraries/LibC/limits.h
index b08fcf4759..63156af450 100644
--- a/Libraries/LibC/limits.h
+++ b/Libraries/LibC/limits.h
@@ -1,6 +1,6 @@
#pragma once
-#include <stdint.h>
+#include <bits/stdint.h>
#define PAGE_SIZE 4096
diff --git a/Libraries/LibC/netinet/in.h b/Libraries/LibC/netinet/in.h
index 268c2fe3b5..fa342e3000 100644
--- a/Libraries/LibC/netinet/in.h
+++ b/Libraries/LibC/netinet/in.h
@@ -1,6 +1,6 @@
#pragma once
-#include <stdint.h>
+#include <bits/stdint.h>
#include <sys/cdefs.h>
__BEGIN_DECLS
diff --git a/Libraries/LibC/netinet/ip_icmp.h b/Libraries/LibC/netinet/ip_icmp.h
index 7b278aac90..8f33488239 100644
--- a/Libraries/LibC/netinet/ip_icmp.h
+++ b/Libraries/LibC/netinet/ip_icmp.h
@@ -1,6 +1,6 @@
#pragma once
-#include <stdint.h>
+#include <bits/stdint.h>
#include <sys/cdefs.h>
__BEGIN_DECLS
diff --git a/Libraries/LibC/setjmp.h b/Libraries/LibC/setjmp.h
index a6511a38f6..6d76e42ddc 100644
--- a/Libraries/LibC/setjmp.h
+++ b/Libraries/LibC/setjmp.h
@@ -2,7 +2,7 @@
#include <signal.h>
#include <stdbool.h>
-#include <stdint.h>
+#include <bits/stdint.h>
#include <sys/cdefs.h>
#include <sys/types.h>
diff --git a/Libraries/LibC/stdint.h b/Libraries/LibC/stdint.h
index 8e1fbcba4d..149be91ecc 100644
--- a/Libraries/LibC/stdint.h
+++ b/Libraries/LibC/stdint.h
@@ -2,108 +2,4 @@
#include <sys/cdefs.h>
-__BEGIN_DECLS
-
-typedef __UINT64_TYPE__ uint64_t;
-typedef __UINT32_TYPE__ uint32_t;
-typedef __UINT16_TYPE__ uint16_t;
-typedef __UINT8_TYPE__ uint8_t;
-
-typedef __INT64_TYPE__ int64_t;
-typedef __INT32_TYPE__ int32_t;
-typedef __INT16_TYPE__ int16_t;
-typedef __INT8_TYPE__ int8_t;
-
-typedef __UINT_FAST8_TYPE__ uint_fast8_t;
-typedef __UINT_FAST16_TYPE__ uint_fast16_t;
-typedef __UINT_FAST32_TYPE__ uint_fast32_t;
-typedef __UINT_FAST64_TYPE__ uint_fast64_t;
-
-typedef __INT_FAST8_TYPE__ int_fast8_t;
-typedef __INT_FAST16_TYPE__ int_fast16_t;
-typedef __INT_FAST32_TYPE__ int_fast32_t;
-typedef __INT_FAST64_TYPE__ int_fast64_t;
-
-typedef __UINT_LEAST8_TYPE__ uint_least8_t;
-typedef __UINT_LEAST16_TYPE__ uint_least16_t;
-typedef __UINT_LEAST32_TYPE__ uint_least32_t;
-typedef __UINT_LEAST64_TYPE__ uint_least64_t;
-
-typedef __INT_LEAST8_TYPE__ int_least8_t;
-typedef __INT_LEAST16_TYPE__ int_least16_t;
-typedef __INT_LEAST32_TYPE__ int_least32_t;
-typedef __INT_LEAST64_TYPE__ int_least64_t;
-
-#define __int8_t_defined 1
-#define __uint8_t_defined 1
-#define __int16_t_defined 1
-#define __uint16_t_defined 1
-#define __int32_t_defined 1
-#define __uint32_t_defined 1
-#define __int64_t_defined 1
-#define __uint64_t_defined 1
-
-typedef __PTRDIFF_TYPE__ uintptr_t;
-typedef __PTRDIFF_TYPE__ intptr_t;
-
-typedef __UINTMAX_TYPE__ uintmax_t;
-#define UINTMAX_MAX __UINTMAX_MAX__
-#define UINTMAX_MIN __UINTMAX_MIN__
-
-typedef __INTMAX_TYPE__ intmax_t;
-#define INTMAX_MAX __INTMAX_MAX__
-#define INTMAX_MIN (-INTMAX_MAX - 1)
-
-#define INT8_MIN (-128)
-#define INT16_MIN (-32767 - 1)
-#define INT32_MIN (-2147483647 - 1)
-#define INT64_MIN (-9223372036854775807LL - 1LL)
-#define INT8_MAX (127)
-#define INT16_MAX (32767)
-#define INT32_MAX (2147483647)
-#define INT64_MAX (9223372036854775807LL)
-#define UINT8_MAX (255)
-#define UINT16_MAX (65535)
-#define UINT32_MAX (4294967295U)
-#define UINT64_MAX (18446744073709551615ULL)
-
-#define INTPTR_MAX INT32_MAX
-#define INTPTR_MIN INT32_MIN
-#define UINTPTR_MAX UINT32_MAX
-
-#define INT_FAST8_MIN INT8_MIN
-#define INT_FAST16_MIN INT16_MIN
-#define INT_FAST32_MIN INT32_MIN
-#define INT_FAST64_MIN INT64_MIN
-
-#define INT_FAST8_MAX INT8_MAX
-#define INT_FAST16_MAX INT16_MAX
-#define INT_FAST32_MAX INT32_MAX
-#define INT_FAST64_MAX INT64_MAX
-
-#define UINT_FAST8_MAX UINT8_MAX
-#define UINT_FAST16_MAX UINT16_MAX
-#define UINT_FAST32_MAX UINT32_MAX
-#define UINT_FAST64_MAX UINT64_MAX
-
-#define INT_LEAST8_MIN INT8_MIN
-#define INT_LEAST16_MIN INT16_MIN
-#define INT_LEAST32_MIN INT32_MIN
-#define INT_LEAST64_MIN INT64_MIN
-
-#define INT_LEAST8_MAX INT8_MAX
-#define INT_LEAST16_MAX INT16_MAX
-#define INT_LEAST32_MAX INT32_MAX
-#define INT_LEAST64_MAX INT64_MAX
-
-#define UINT_LEAST8_MAX UINT8_MAX
-#define UINT_LEAST16_MAX UINT16_MAX
-#define UINT_LEAST32_MAX UINT32_MAX
-#define UINT_LEAST64_MAX UINT64_MAX
-
-#define INT64_C(x) x##LL
-#define UINT64_C(x) x##ULL
-
-#define SIZE_MAX ((size_t)-1)
-
-__END_DECLS
+#include <bits/stdint.h>
diff --git a/Libraries/LibC/sys/socket.h b/Libraries/LibC/sys/socket.h
index 7c827d2bbc..c89a2176d7 100644
--- a/Libraries/LibC/sys/socket.h
+++ b/Libraries/LibC/sys/socket.h
@@ -1,6 +1,6 @@
#pragma once
-#include <stdint.h>
+#include <bits/stdint.h>
#include <sys/cdefs.h>
#include <sys/types.h>
#include <sys/un.h>
diff --git a/Libraries/LibC/sys/types.h b/Libraries/LibC/sys/types.h
index 4c4a20e7e4..c9b1edad1e 100644
--- a/Libraries/LibC/sys/types.h
+++ b/Libraries/LibC/sys/types.h
@@ -1,7 +1,7 @@
#pragma once
#include <stddef.h>
-#include <stdint.h>
+#include <bits/stdint.h>
#include <sys/cdefs.h>
__BEGIN_DECLS