Skip to content

Commit aa7f377

Browse files
authored
[libc++] Remove libc++'s own stdint.h and locale.h (#107436)
These headers are not doing anything beyond the system or compiler provided equivalent headers, so there's no real reason to keep them around. Reducing the number of C headers we provide in libc++ simplifies our header layering and reduces the potential for confusion when headers are layered incorrectly.
1 parent f0b3b6d commit aa7f377

File tree

8 files changed

+0
-204
lines changed

8 files changed

+0
-204
lines changed

libcxx/include/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,6 @@ set(files
967967
limits
968968
list
969969
locale
970-
locale.h
971970
map
972971
math.h
973972
mdspan
@@ -998,7 +997,6 @@ set(files
998997
stdbool.h
999998
stddef.h
1000999
stdexcept
1001-
stdint.h
10021000
stdio.h
10031001
stdlib.h
10041002
stop_token

libcxx/include/clocale

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,6 @@ lconv* localeconv();
3838

3939
#include <locale.h>
4040

41-
#ifndef _LIBCPP_LOCALE_H
42-
# error <clocale> tried including <locale.h> but didn't find libc++'s <locale.h> header. \
43-
This usually means that your header search paths are not configured properly. \
44-
The header search paths should contain the C++ Standard Library headers before \
45-
any C Standard Library, and you are probably using compiler flags that make that \
46-
not be the case.
47-
#endif
48-
4941
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
5042
# pragma GCC system_header
5143
#endif

libcxx/include/cstdint

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,6 @@ Types:
144144

145145
#include <stdint.h>
146146

147-
#ifndef _LIBCPP_STDINT_H
148-
# error <cstdint> tried including <stdint.h> but didn't find libc++'s <stdint.h> header. \
149-
This usually means that your header search paths are not configured properly. \
150-
The header search paths should contain the C++ Standard Library headers before \
151-
any C Standard Library, and you are probably using compiler flags that make that \
152-
not be the case.
153-
#endif
154-
155147
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
156148
# pragma GCC system_header
157149
#endif

libcxx/include/locale.h

Lines changed: 0 additions & 46 deletions
This file was deleted.

libcxx/include/module.modulemap

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2184,10 +2184,6 @@ module std_inttypes_h [system] {
21842184
header "inttypes.h"
21852185
export *
21862186
}
2187-
module std_locale_h [system] {
2188-
header "locale.h"
2189-
export *
2190-
}
21912187
module std_math_h [system] {
21922188
header "math.h"
21932189
export *
@@ -2204,10 +2200,6 @@ module std_stddef_h [system] {
22042200
// <stddef.h>'s __need_* macros require textual inclusion.
22052201
textual header "stddef.h"
22062202
}
2207-
module std_stdint_h [system] {
2208-
header "stdint.h"
2209-
export *
2210-
}
22112203
module std_stdio_h [system] {
22122204
// <stdio.h>'s __need_* macros require textual inclusion.
22132205
textual header "stdio.h"

libcxx/include/stdint.h

Lines changed: 0 additions & 127 deletions
This file was deleted.

libcxx/test/libcxx/depr/depr.c.headers/extern_c.pass.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ extern "C" {
2626
#include <inttypes.h>
2727
#include <iso646.h>
2828
#include <limits.h>
29-
#ifndef _LIBCPP_HAS_NO_LOCALIZATION
30-
# include <locale.h>
31-
#endif
3229
#include <math.h>
3330
#include <setjmp.h>
3431
#include <signal.h>

libcxx/utils/libcxx/header_information.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
# headers with #error directives
1717
"ios": "!defined(_LIBCPP_HAS_NO_LOCALIZATION)",
18-
"locale.h": "!defined(_LIBCPP_HAS_NO_LOCALIZATION)",
1918
# transitive includers of the above headers
2019
"clocale": "!defined(_LIBCPP_HAS_NO_LOCALIZATION)",
2120
"codecvt": "!defined(_LIBCPP_HAS_NO_LOCALIZATION)",
@@ -53,7 +52,6 @@
5352
"istream": "// UNSUPPORTED: no-localization",
5453
"latch": "// UNSUPPORTED: no-threads, c++03, c++11, c++14, c++17",
5554
"locale": "// UNSUPPORTED: no-localization",
56-
"locale.h": "// UNSUPPORTED: no-localization",
5755
"mutex": "// UNSUPPORTED: no-threads, c++03",
5856
"ostream": "// UNSUPPORTED: no-localization",
5957
"print": "// UNSUPPORTED: no-filesystem, c++03, c++11, c++14, c++17, c++20, availability-fp_to_chars-missing", # TODO PRINT investigate

0 commit comments

Comments
 (0)