]> pd.if.org Git - pdclib/blob - internals/_PDCLIB_aux.h
Moved internal struct definitions to _PDCLIB_int.h where they belong.
[pdclib] / internals / _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 /* You should not have to edit anything in this file; if you DO have to, it   */
13 /* would be considered a bug / missing feature: notify the author(s).         */
14 /* -------------------------------------------------------------------------- */
15
16 /* -------------------------------------------------------------------------- */
17 /* Standard Version                                                           */
18 /* -------------------------------------------------------------------------- */
19
20 /* Many a compiler gets this wrong, so you might have to hardcode it instead. */
21
22 #if __STDC__ != 1
23 #error Compiler does not define _ _STDC_ _ to 1 (not standard-compliant)!
24 #endif
25
26 #ifndef __STDC_VERSION__
27 #define _PDCLIB_C_VERSION 90
28 #define _PDCLIB_restrict
29 #define _PDCLIB_inline
30 #elif __STDC_VERSION__ == 199409L
31 #define _PDCLIB_C_VERSION 95
32 #define _PDCLIB_restrict
33 #define _PDCLIB_inline
34 #elif __STDC_VERSION__ == 199901L
35 #define _PDCLIB_C_VERSION 99
36 #define _PDCLIB_restrict restrict
37 #define _PDCLIB_inline inline
38 #else
39 #error Unsupported _ _STDC_VERSION_ _ (__STDC_VERSION__) (supported: ISO/IEC 9899:1990, 9899/AMD1:1995, and 9899:1999).
40 #endif
41
42 #ifndef __STDC_HOSTED__
43 #error Compiler does not define _ _STDC_HOSTED_ _ (not standard-compliant)!
44 #elif __STDC_HOSTED__ == 0
45 #define _PDCLIB_HOSTED 0
46 #elif __STDC_HOSTED__ == 1
47 #define _PDCLIB_HOSTED 1
48 #else
49 #error Compiler does not define _ _STDC_HOSTED_ _ to 0 or 1 (not standard-compliant)!
50 #endif
51
52 #if _PDCLIB_C_VERSION != 99
53 #error PDCLib might not be fully conforming to either C89 or C95 prior to v2.x.
54 #endif
55
56 /* -------------------------------------------------------------------------- */
57 /* Helper macros:                                                             */
58 /* _PDCLIB_cc( x, y ) concatenates two preprocessor tokens without extending  */
59 /* _PDCLIB_concat( x, y ) concatenates two preprocessor tokens with extending */
60 /* -------------------------------------------------------------------------- */
61
62 #define _PDCLIB_cc( x, y )     x ## y
63 #define _PDCLIB_concat( x, y ) _PDCLIB_cc( x, y )
64
65 #define _PDCLIB_symbol2value( x ) #x
66 #define _PDCLIB_symbol2string( x ) _PDCLIB_symbol2value( x )
67 #define _PDCLIB_symbol2identity( x ) x