1// -*- C++ -*-
2//===----------------------------------------------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP___CONFIGURATION_LANGUAGE_H
11#define _LIBCPP___CONFIGURATION_LANGUAGE_H
12
13#include <__config_site>
14
15#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
16# pragma GCC system_header
17#endif
18
19// NOLINTBEGIN(libcpp-cpp-version-check)
20#ifdef __cplusplus
21# if __cplusplus < 201103L
22# define _LIBCPP_CXX03_LANG
23# endif
24# if __cplusplus <= 201103L
25# define _LIBCPP_STD_VER 11
26# elif __cplusplus <= 201402L
27# define _LIBCPP_STD_VER 14
28# elif __cplusplus <= 201703L
29# define _LIBCPP_STD_VER 17
30# elif __cplusplus <= 202002L
31# define _LIBCPP_STD_VER 20
32# elif __cplusplus <= 202302L
33# define _LIBCPP_STD_VER 23
34# else
35// Expected release year of the next C++ standard
36# define _LIBCPP_STD_VER 26
37# endif
38#endif // __cplusplus
39// NOLINTEND(libcpp-cpp-version-check)
40
41#if defined(__cpp_rtti) && __cpp_rtti >= 199711L
42# define _LIBCPP_HAS_RTTI 1
43#else
44# define _LIBCPP_HAS_RTTI 0
45#endif
46
47#if defined(__cpp_exceptions) && __cpp_exceptions >= 199711L
48# define _LIBCPP_HAS_EXCEPTIONS 1
49#else
50# define _LIBCPP_HAS_EXCEPTIONS 0
51#endif
52
53#if _LIBCPP_STD_VER <= 17 || !defined(__cpp_char8_t)
54# define _LIBCPP_HAS_CHAR8_T 0
55#else
56# define _LIBCPP_HAS_CHAR8_T 1
57#endif
58
59#if _LIBCPP_STD_VER <= 11
60# define _LIBCPP_EXPLICIT_SINCE_CXX14
61#else
62# define _LIBCPP_EXPLICIT_SINCE_CXX14 explicit
63#endif
64
65#if _LIBCPP_STD_VER >= 14
66# define _LIBCPP_CONSTEXPR_SINCE_CXX14 constexpr
67#else
68# define _LIBCPP_CONSTEXPR_SINCE_CXX14
69#endif
70
71#if _LIBCPP_STD_VER >= 17
72# define _LIBCPP_CONSTEXPR_SINCE_CXX17 constexpr
73#else
74# define _LIBCPP_CONSTEXPR_SINCE_CXX17
75#endif
76
77#if _LIBCPP_STD_VER >= 20
78# define _LIBCPP_CONSTEXPR_SINCE_CXX20 constexpr
79#else
80# define _LIBCPP_CONSTEXPR_SINCE_CXX20
81#endif
82
83#if _LIBCPP_STD_VER >= 23
84# define _LIBCPP_CONSTEXPR_SINCE_CXX23 constexpr
85#else
86# define _LIBCPP_CONSTEXPR_SINCE_CXX23
87#endif
88
89#if _LIBCPP_STD_VER >= 26
90# define _LIBCPP_CONSTEXPR_SINCE_CXX26 constexpr
91#else
92# define _LIBCPP_CONSTEXPR_SINCE_CXX26
93#endif
94
95#endif // _LIBCPP___CONFIGURATION_LANGUAGE_H
96