Skip to content

Commit 569e43a

Browse files
committed
[libc] Provide an implementation of the 'stdint.h' header
Summary: I've noticed one problem is that the user includes `stdint.h` the compiler will do `#include_next <stdint.h>` potentially into a conflicting implementation on systems with multiple headers installed. The `clang` header is standards compliant and works with `clang` and `gcc` which are both of our targets, so I simply copied it here. This has the effect of including `stdint.h` on clang / LLVM libc behaving the same as `-ffreestanding`.
1 parent 1977404 commit 569e43a

File tree

4 files changed

+906
-0
lines changed

4 files changed

+906
-0
lines changed

libc/include/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,14 @@ add_gen_header(
8484
.llvm-libc-macros.float_macros
8585
)
8686

87+
add_gen_header(
88+
stdint
89+
DEF_FILE stdint.h.def
90+
GEN_HDR stdint.h
91+
DEPENDS
92+
.llvm-libc-macros.stdint_macros
93+
)
94+
8795
add_gen_header(
8896
limits
8997
DEF_FILE limits.h.def

libc/include/llvm-libc-macros/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ add_macro_header(
6767
file-seek-macros.h
6868
)
6969

70+
add_macro_header(
71+
stdint_macros
72+
HDR
73+
stdint-macros.h
74+
)
75+
7076
add_macro_header(
7177
float_macros
7278
HDR

0 commit comments

Comments
 (0)