Pigweed
C/C++ API Reference
Home
Modules
Loading...
Searching...
No Matches
standard.h
1
// Copyright 2020 The Pigweed Authors
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
4
// use this file except in compliance with the License. You may obtain a copy of
5
// the License at
6
//
7
// https://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12
// License for the specific language governing permissions and limitations under
13
// the License.
14
#pragma once
15
17
18
#if defined(__cplusplus)
19
23
#define PW_CXX_STANDARD_IS_SUPPORTED(std) \
24
(__cplusplus >= _PW_CXX_STANDARD_##std())
25
29
#define PW_C_STANDARD_IS_SUPPORTED(std) (0 >= _PW_C_STANDARD_##std())
30
31
#elif defined(__STDC_VERSION__)
32
33
#define PW_CXX_STANDARD_IS_SUPPORTED(std) (0 >= _PW_CXX_STANDARD_##std())
34
35
#define PW_C_STANDARD_IS_SUPPORTED(std) \
36
(__STDC_VERSION__ >= _PW_C_STANDARD_##std())
37
38
#endif
// defined(__cplusplus)
39
41
42
// Standard values of __cplusplus and __STDC_VERSION__. See the GCC docs for
43
// more info: https://gcc.gnu.org/onlinedocs/cpp/Standard-Predefined-Macros.html
44
#define _PW_CXX_STANDARD_98() 199711L
45
#define _PW_CXX_STANDARD_11() 201103L
46
#define _PW_CXX_STANDARD_14() 201402L
47
#define _PW_CXX_STANDARD_17() 201703L
48
#define _PW_CXX_STANDARD_20() 202002L
49
#define _PW_CXX_STANDARD_23() 202302L
50
51
#define _PW_C_STANDARD_89() 199409L
52
#define _PW_C_STANDARD_99() 199901L
53
#define _PW_C_STANDARD_11() 201112L
54
#define _PW_C_STANDARD_17() 201710L
55
#define _PW_C_STANDARD_23() 202311L
pw_polyfill
public
pw_polyfill
standard.h
Generated by
1.9.6