summaryrefslogtreecommitdiff
path: root/lib/ktl/include/__config
diff options
context:
space:
mode:
authorRichard Qin <richard.qin.x@gmail.com>2026-07-11 22:48:30 +0800
committerRichard Qin <richard.qin.x@gmail.com>2026-07-11 22:48:30 +0800
commit3ad39e9878310e5317ee73c9b353c1e2c1c5c4ee (patch)
tree4bd5a49ef60ad1e371c0984cd46838368c5ef83a /lib/ktl/include/__config
parent48ef95c24e9ac3d11200b61af617a01b10b507d1 (diff)
downloadlume-3ad39e9878310e5317ee73c9b353c1e2c1c5c4ee.tar.gz
lume-3ad39e9878310e5317ee73c9b353c1e2c1c5c4ee.tar.xz
lib: establish Zircon libc++ and KTL foundation
Diffstat (limited to 'lib/ktl/include/__config')
-rw-r--r--lib/ktl/include/__config53
1 files changed, 53 insertions, 0 deletions
diff --git a/lib/ktl/include/__config b/lib/ktl/include/__config
new file mode 100644
index 0000000..e04573e
--- /dev/null
+++ b/lib/ktl/include/__config
@@ -0,0 +1,53 @@
+// Copyright 2022 The Fuchsia Authors
+//
+// Use of this source code is governed by a MIT-style
+// license that can be found in the LICENSE file or at
+// https://opensource.org/licenses/MIT
+
+#ifndef ZIRCON_KERNEL_LIB_KTL_INCLUDE___CONFIG_
+#define ZIRCON_KERNEL_LIB_KTL_INCLUDE___CONFIG_
+
+// The libc++ internal header <__config> unconditionally responds to some
+// predefines set in the EFI environment. So this header wraps it and then
+// undoes the damage that our __config_site header can't prevent.
+
+#include_next <__config>
+
+#undef _LIBCPP_WIN32API
+#undef _LIBCPP_MSVCRT_LIKE
+#undef _LIBCPP_MSVCRT
+#undef _LIBCPP_HAS_OPEN_WITH_WCHAR
+
+// This prevents libc++ from doing fallback to spin locks and the like for
+// cases where is_always_lock_free is not true. In the kernel, we don't want
+// any behind-the-scenes help like that, we want to get link errors from
+// libcalls if atomics can't be lowered to real hardware instructions.
+#undef _LIBCPP_ATOMIC_ONLY_USE_BUILTINS
+
+// These are used by <__configuration/availability.h> to decide when headers
+// should expect things to be defined in the library. For the kernel, there is
+// no library and so everything must be defined in headers.
+#undef _LIBCPP_INTRODUCED_IN_LLVM_21
+#define _LIBCPP_INTRODUCED_IN_LLVM_21 0
+#undef _LIBCPP_INTRODUCED_IN_LLVM_20
+#define _LIBCPP_INTRODUCED_IN_LLVM_20 0
+#undef _LIBCPP_INTRODUCED_IN_LLVM_19
+#define _LIBCPP_INTRODUCED_IN_LLVM_19 0
+#undef _LIBCPP_INTRODUCED_IN_LLVM_18
+#define _LIBCPP_INTRODUCED_IN_LLVM_18 0
+#undef _LIBCPP_INTRODUCED_IN_LLVM_16
+#define _LIBCPP_INTRODUCED_IN_LLVM_16 0
+#undef _LIBCPP_INTRODUCED_IN_LLVM_15
+#define _LIBCPP_INTRODUCED_IN_LLVM_15 0
+#undef _LIBCPP_INTRODUCED_IN_LLVM_14
+#define _LIBCPP_INTRODUCED_IN_LLVM_14 0
+#undef _LIBCPP_INTRODUCED_IN_LLVM_12
+#define _LIBCPP_INTRODUCED_IN_LLVM_12 0
+#undef _LIBCPP_INTRODUCED_IN_LLVM_11
+#define _LIBCPP_INTRODUCED_IN_LLVM_11 0
+#undef _LIBCPP_INTRODUCED_IN_LLVM_9
+#define _LIBCPP_INTRODUCED_IN_LLVM_9 0
+#undef _LIBCPP_INTRODUCED_IN_LLVM_4
+#define _LIBCPP_INTRODUCED_IN_LLVM_4 0
+
+#endif // ZIRCON_KERNEL_LIB_KTL_INCLUDE___CONFIG_