libsnobol4 1.0.2
High-performance SNOBOL4-style pattern matching library
Loading...
Searching...
No Matches
c23_compat.h
Go to the documentation of this file.
1#pragma once
2
3/* C23 keyword compatibility for pre-C23 compilers (MSVC, GCC/Clang < C23).
4 * __STDC_VERSION__ == 202311L for C23; anything lower (or undefined) means the
5 * compiler does not recognise 'nullptr' or 'constexpr' as keywords in C mode.
6 *
7 * Every self-contained public header includes this so standalone consumers
8 * (and the test suite, which includes narrow headers directly) get the
9 * fallbacks regardless of which header they pull in. */
10#ifndef __cplusplus
11#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 202311L)
12#ifndef nullptr
13#define nullptr NULL
14#endif
15#ifndef constexpr
16#define constexpr static const
17#endif
18#endif
19#endif