1//===-- Common defines for sharing LLVM libc with LLVM projects -*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_LIBC_SHARED_LIBC_COMMON_H
10#define LLVM_LIBC_SHARED_LIBC_COMMON_H
11
12// Use system errno.
13#ifdef LIBC_ERRNO_MODE
14#if LIBC_ERRNO_MODE != LIBC_ERRNO_MODE_SYSTEM_INLINE
15#error \
16 "LIBC_ERRNO_MODE was set to something different from LIBC_ERRNO_MODE_SYSTEM_INLINE."
17#endif // LIBC_ERRNO_MODE != LIBC_ERRNO_MODE_SYSTEM_INLINE
18#else
19#define LIBC_ERRNO_MODE LIBC_ERRNO_MODE_SYSTEM_INLINE
20#endif // LIBC_ERRNO_MODE
21
22// Use system fenv functions in math implementations.
23#ifndef LIBC_MATH_USE_SYSTEM_FENV
24#define LIBC_MATH_USE_SYSTEM_FENV
25#endif // LIBC_MATH_USE_SYSTEM_FENV
26
27#ifndef LIBC_NAMESPACE
28#define LIBC_NAMESPACE __llvm_libc
29#endif // LIBC_NAMESPACE
30
31#endif // LLVM_LIBC_SHARED_LIBC_COMMON_H
32