// 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_
