5 /* Auxiliary PDCLib code <_PDCLIB_aux.h>
7 This file is part of the Public Domain C Library (PDCLib).
8 Permission is granted to use, modify, and / or redistribute at will.
11 /* -------------------------------------------------------------------------- */
12 /* Standard Version */
13 /* -------------------------------------------------------------------------- */
15 /* Many a compiler gets this wrong, so you might have to hardcode it instead. */
18 #error Compiler does not define _ _STDC_ _ to 1 (not standard-compliant)!
21 #ifndef __STDC_VERSION__
22 #define _PDCLIB_C_VERSION 90
23 #elif __STDC_VERSION__ == 199409L
24 #define _PDCLIB_C_VERSION 95
25 #elif __STDC_VERSION__ == 199901L
26 #define _PDCLIB_C_VERSION 99
28 #error Unsupported _ _STDC_VERSION_ _ (__STDC_VERSION__) (supported: ISO/IEC 9899:1990, 9899/AMD1:1995, and 9899:1999).
31 #ifndef __STDC_HOSTED__
32 #error Compiler does not define _ _STDC_HOSTED_ _ (not standard-compliant)!
33 #elif __STDC_HOSTED__ == 0
34 #define _PDCLIB_HOSTED 0
35 #elif __STDC_HOSTED__ == 1
36 #define _PDCLIB_HOSTED 1
38 #error Compiler does not define _ _STDC_HOSTED_ _ to 0 or 1 (not standard-compliant)!
41 #if _PDCLIB_C_VERSION != 99
42 #warning Up to and including v1.x, PDCLib is only aiming at ISO/IEC 9899:1999 (C99).
43 #warning PDCLib might not be fully conforming to either C89 or C95 prior to v2.x.
46 #if _PDCLIB_HOSTED != 0
47 #warning Up to the 1.x release, PDCLib is only complete as a freestanding environment.
48 #warning PDCLib might not be fully conforming as a hosted environment.
51 /* -------------------------------------------------------------------------- */
53 /* _PDCLIB_cc( x, y ) concatenates two preprocessor tokens without extending */
54 /* _PDCLIB_concat( x, y ) concatenates two preprocessor tokens with extending */
55 /* -------------------------------------------------------------------------- */
57 #define _PDCLIB_cc( x, y ) x ## y
58 #define _PDCLIB_concat( x, y ) _PDCLIB_cc( x, y )
60 #define _PDCLIB_symbol2value( x ) #x
61 #define _PDCLIB_symbol2string( x ) _PDCLIB_symbol2value( x )
62 #define _PDCLIB_symbol2identity( x ) x