Skip to content

Commit c30c3fd

Browse files
committed
[libc++] Remove libc++'s own stdint.h and locale.h
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 cf2ecc7 commit c30c3fd

File tree

9 files changed

+0
-208
lines changed

9 files changed

+0
-208
lines changed

libcxx/include/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,6 @@ set(files
963963
limits
964964
list
965965
locale
966-
locale.h
967966
map
968967
math.h
969968
mdspan
@@ -994,7 +993,6 @@ set(files
994993
stdbool.h
995994
stddef.h
996995
stdexcept
997-
stdint.h
998996
stdio.h
999997
stdlib.h
1000998
stop_token

libcxx/include/__std_clang_module

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,6 @@
126126
#include <limits>
127127
#include <list>
128128
#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
129-
# include <locale.h>
130-
#endif
131-
#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
132129
# include <locale>
133130
#endif
134131
#include <map>
@@ -172,7 +169,6 @@
172169
#include <stdbool.h>
173170
#include <stddef.h>
174171
#include <stdexcept>
175-
#include <stdint.h>
176172
#include <stdio.h>
177173
#include <stdlib.h>
178174
#if !defined(_LIBCPP_HAS_NO_THREADS)

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
@@ -511,10 +511,6 @@ module std_inttypes_h [system] {
511511
export *
512512
}
513513
// <iso646.h> provided by compiler.
514-
module std_locale_h [system] {
515-
header "locale.h"
516-
export *
517-
}
518514
module std_math_h [system] {
519515
header "math.h"
520516
export *
@@ -537,10 +533,6 @@ module std_stddef_h [system] {
537533
textual header "stddef.h"
538534
export *
539535
}
540-
module std_stdint_h [system] {
541-
header "stdint.h"
542-
export *
543-
}
544536
module std_stdio_h [system] {
545537
// <stdio.h>'s __need_* macros require textual inclusion.
546538
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)",
@@ -69,7 +68,6 @@
6968
"istream": "// UNSUPPORTED: no-localization",
7069
"latch": "// UNSUPPORTED: no-threads, c++03, c++11, c++14, c++17",
7170
"locale": "// UNSUPPORTED: no-localization",
72-
"locale.h": "// UNSUPPORTED: no-localization",
7371
"mutex": "// UNSUPPORTED: no-threads, c++03",
7472
"ostream": "// UNSUPPORTED: no-localization",
7573
"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)