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# elif __cplusplus <= 202603L
35# define _LIBCPP_STD_VER 26
36# else
37// Expected release year of the next C++ standard
38# define _LIBCPP_STD_VER 29
39# endif
40#endif // __cplusplus
41// NOLINTEND(libcpp-cpp-version-check)
42
43#if defined(__cpp_rtti) && __cpp_rtti >= 199711L
44# define _LIBCPP_HAS_RTTI 1
45#else
46# define _LIBCPP_HAS_RTTI 0
47#endif
48
49#if defined(__cpp_exceptions) && __cpp_exceptions >= 199711L
50# define _LIBCPP_HAS_EXCEPTIONS 1
51#else
52# define _LIBCPP_HAS_EXCEPTIONS 0
53#endif
54
55#if _LIBCPP_STD_VER <= 17 || !defined(__cpp_char8_t)
56# define _LIBCPP_HAS_CHAR8_T 0
57#else
58# define _LIBCPP_HAS_CHAR8_T 1
59#endif
60
61#if _LIBCPP_STD_VER <= 11
62# define _LIBCPP_EXPLICIT_SINCE_CXX14
63#else
64# define _LIBCPP_EXPLICIT_SINCE_CXX14 explicit
65#endif
66
67#if _LIBCPP_STD_VER >= 14
68# define _LIBCPP_CONSTEXPR_SINCE_CXX14 constexpr
69#else
70# define _LIBCPP_CONSTEXPR_SINCE_CXX14
71#endif
72
73#if _LIBCPP_STD_VER >= 17
74# define _LIBCPP_CONSTEXPR_SINCE_CXX17 constexpr
75#else
76# define _LIBCPP_CONSTEXPR_SINCE_CXX17
77#endif
78
79#if _LIBCPP_STD_VER >= 20
80# define _LIBCPP_CONSTEXPR_SINCE_CXX20 constexpr
81#else
82# define _LIBCPP_CONSTEXPR_SINCE_CXX20
83#endif
84
85#if _LIBCPP_STD_VER >= 23
86# define _LIBCPP_CONSTEXPR_SINCE_CXX23 constexpr
87#else
88# define _LIBCPP_CONSTEXPR_SINCE_CXX23
89#endif
90
91#if _LIBCPP_STD_VER >= 26
92# define _LIBCPP_CONSTEXPR_SINCE_CXX26 constexpr
93#else
94# define _LIBCPP_CONSTEXPR_SINCE_CXX26
95#endif
96
97#endif // _LIBCPP___CONFIGURATION_LANGUAGE_H
98