ae2f_docs
Loading...
Searching...
No Matches
LangVer.h
Go to the documentation of this file.
1/**
2 * @file LangVer.h
3 * @brief Language version for C/C++
4 * @details
5 * - Uses `__cplusplus` and `__STDC_VERSION__` for language version.
6 * - If not defined, Uses generated `ae2f_LangVer_C`, `ae2f_LangVer_CC` to detect language version.
7 * - Versions will be the year as the version * 100 as `long` which used to represent the month (as minour version)
8 *
9 * @def ae2f_stdc_v
10 * @brief Standard C version, or at least cmake intended.
11 *
12 * @def ae2f_stdcc_v
13 * @brief
14 * Standard C++ version. \n\n
15 *
16 * - When it is compiled as standard C, this will be 0.
17 * - When it is not compiled as standard C, this will be decided by cmake.
18 *
19 * @macro __ae2f_stdcheck_C
20 * @brief Check if it hits over specific standard C version.
21 * @param v a standard C version to check
22 *
23 * @macro __ae2f_stdcheck_CC
24 * @brief Check if it hits over specific standard C++ version.
25 * @param v a standard C++ version to check
26 * */
27#include "./LangVer.auto.h"
28
29
30#undef ae2f_stdcc_v
31#ifdef __cplusplus
32#define ae2f_stdcc_v (__cplusplus)
33#else
34#define ae2f_stdcc_v 0L
35#endif
36
37#undef ae2f_stdc_v
38#ifdef __STDC_VERSION__
39#define ae2f_stdc_v (__STDC_VERSION__)
40#elif defined(__STDC__) && (__STDC__)
41#define ae2f_stdc_v 198900L
42#else
43#define ae2f_stdc_v ((ae2f_LangVer_C) * 100L)
44#endif
45
46#undef __ae2f_stdcheck_C
47#undef __ae2f_stdcheck_CC
48
49#define __ae2f_stdcheck_C(v) (ae2f_stdc_v >= (v))
50#define __ae2f_stdcheck_CC(v) (ae2f_stdcc_v >= (v))
#define ae2f_stdcc_v
Standard C++ version. .
Definition LangVer.h:34
#define ae2f_stdc_v
Standard C version, or at least cmake intended.
Definition LangVer.h:43
#define ae2f_assume(a)
tells the compiler that value if a is false, below this keyword is not expected to be reached.
Definition cc.h:228
#define ae2f_ccpure
Keyword as [[pure]] on C23.
Definition cc.h:52
#define ae2f_unexpected
Definition cc.h:189
#define ae2f_ccconst
Keyword as [[const]] on C23..
Definition cc.h:66
#define ae2f_noexcept
marker that this function does not throw something.
Definition cc.h:133
#define ae2f_restrict
Keyword as restrict on C99.
Definition cc.h:81
#define ae2f_expected_not(a)
expectes a as false.
Definition cc.h:185
#define ae2f_unreachable()
tells the compiler that below this keyword is not expected to be reached.
Definition cc.h:213
#define _ae2f_msvc(a)
Available when compiled with msvc.
Definition cc.h:38
#define _ae2f_gnuc(a)
Available when compiled with gcc compiler.
Definition cc.h:21
#define ae2f_inline
inline
Definition cc.h:149
#define ae2f_expected(a)
expectes a as true.
Definition cc.h:184