Skip to content

Commit 9912236

Browse files
committed
Define more variables in __config_site
libcxx decides to almost all configuration macros to be defined. So before it tested whether a macro was defined/undefined, and now it assumes it is defined and tests whether its value is 1/0. Before llvm/llvm-project#112094 `_config_site.in` used to use `#cmakedefine`, which only defined variables when they were enabled, but now it uses `#cmakedefine01`, which always defines variables and assigns 1 or 0 depending on whether the feature is enabled. So this change adds `#define` to each variable that `_config_site.in` has an entry of. The value assigned is 1 if it was defined in our previous Emscripten environment and 0 if not.
1 parent d646f6b commit 9912236

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

system/lib/libcxx/include/__config_site

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,27 @@
11
// Set the LIBCPP ABI version 2 under emscripten so that we get nicely aligned string
22
// data and other nice fixes.
33
#define _LIBCPP_ABI_VERSION 2
4-
#define _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS
5-
#define _LIBCPP_HAS_MUSL_LIBC
64
#define _LIBCPP_ABI_NAMESPACE __2
7-
// Emscripten doesn't use PSTL at the moment.
5+
#define _LIBCPP_ABI_FORCE_ITANIUM 0
6+
#define _LIBCPP_ABI_FORCE_MICROSOFT 0
7+
#define _LIBCPP_HAS_THREADS 1
8+
#define _LIBCPP_HAS_MONOTONIC_CLOCK 1
9+
#define _LIBCPP_HAS_MUSL_LIBC 1
10+
#define _LIBCPP_HAS_THREAD_API_PTHREAD 1
11+
#define _LIBCPP_HAS_THREAD_API_EXTERNAL 0
12+
#define _LIBCPP_HAS_THREAD_API_WIN32 0
13+
#define _LIBCPP_HAS_THREAD_API_C11 0
14+
#define _LIBCPP_HAS_VENDOR_AVAILABILITY_ANNOTATIONS 0
15+
#define _LIBCPP_HAS_FILESYSTEM 1
16+
#define _LIBCPP_HAS_RANDOM_DEVICE 1
17+
#define _LIBCPP_HAS_LOCALIZATION 1
18+
#define _LIBCPP_HAS_UNICODE 1
19+
#define _LIBCPP_HAS_WIDE_CHARACTERS 1
20+
#define _LIBCPP_HAS_TIME_ZONE_DATABASE 0
21+
#define _LIBCPP_INSTRUMENTED_WITH_ASAN 0
22+
23+
// PSTL backends: Emscripten doesn't use PSTL at the moment.
824
#define _LIBCPP_PSTL_BACKEND_SERIAL
25+
26+
// Hardening
927
#define _LIBCPP_HARDENING_MODE_DEFAULT _LIBCPP_HARDENING_MODE_NONE
10-
#define _LIBCPP_HAS_NO_TIME_ZONE_DATABASE

0 commit comments

Comments
 (0)