]> pd.if.org Git - pdclib/blob - _PDCLIB_aux.h
Initial checkin.
[pdclib] / _PDCLIB_aux.h
1 /* $Id$ */
2
3 /* Release $Name$ */
4
5 /* Auxiliary PDCLib code <_PDCLIB_aux.h>
6
7    This file is part of the Public Domain C Library (PDCLib).
8    Permission is granted to use, modify, and / or redistribute at will.
9 */
10
11 /* -------------------------------------------------------------------------- */
12 /* Standard Version                                                           */
13 /* -------------------------------------------------------------------------- */
14
15 /* Many a compiler gets this wrong, so you might have to hardcode it instead. */
16
17 #if __STDC__ != 1
18 #error Compiler does not define _ _STDC_ _ to 1 (not standard-compliant)!
19 #endif
20
21 #ifndef __STDC_VERSION__
22 #define _PDCLIB_C_VERSION C90
23 #elif __STDC_VERSION__ == 199409L
24 #define _PDCLIB_C_VERSION C95
25 #elif __STDC_VERSION__ == 199901L
26 #define _PDCLIB_C_VERSION C99
27 #else
28 #error Unsupported _ _STDC_VERSION_ _ (__STDC_VERSION__)
29 (supported: ISO/IEC 9899:1990, 9899/AMD1:1995, and 9899:1999).
30 #endif
31
32 #ifndef __STDC_HOSTED__
33 #error Compiler does not define _ _STDC_HOSTED_ _ (not standard-compliant)!
34 #elif __STDC_HOSTED__ == 0
35 #define _PDCLIB_HOSTED 0
36 #elif __STDC_HOSTED__ == 1
37 #define _PDCLIB_HOSTED 1
38 #else
39 #error Compiler does not define _ _STDC_HOSTED_ _ to 0 or 1 (not standard-compliant)!
40 #endif
41
42 #if _PDCLIB_C_VERSION != C99
43 #error As of the current release, PDCLib only supports ISO/IEC 9899:1999 (C99).
44 #endif
45
46 #if _PDCLIB_HOSTED != 0
47 #error As of the current release, PDCLib is not a conforming hosted implementation.
48 #endif
49
50 /* -------------------------------------------------------------------------- */
51 /* Helper macros:                                                             */
52 /* _PDCLIB_cc( x, y ) concatenates two preprocessor tokens without extending  */
53 /* _PDCLIB_concat( x, y ) concatenates two preprocessor tokens with extending */
54 /* -------------------------------------------------------------------------- */
55
56 #define _PDCLIB_cc( x, y )     x ## y
57 #define _PDCLIB_concat( x, y ) _PDCLIB_cc( x, y )