4223
|
1 #ifndef CONFIG_H_
|
|
2 #define CONFIG_H_
|
|
3
|
|
4 #ifdef DEBUGGING
|
|
5 #define DEBUG(x) x
|
|
6 #define DEBUG_P 1
|
|
7 #else
|
|
8 #define DEBUG(x)
|
|
9 #define DEBUG_P 0
|
|
10 #define NDEBUG 1
|
|
11 #endif
|
|
12
|
|
13 #if defined _WIN32 || defined __WIN32__ || defined WIN32
|
|
14 #define DIR_END "\\/"
|
|
15 #elif defined __unix__ || defined __linux__ || defined __unix || defined unix
|
|
16 #define DIR_END "/"
|
|
17 #else
|
|
18 /* XXX */
|
|
19 #define DIR_END 0
|
|
20 #endif
|
|
21
|
|
22 #if defined __POSIX__ || defined __unix__ || defined __linux__ || defined __unix || defined unix
|
|
23 #define HAVE_SLEEP_P 1
|
|
24 #define SLEEP_HEADER <unistd.h>
|
|
25 #define DO_SLEEP pause()
|
|
26 #elif defined _WIN32 || defined __WIN32__ || defined WIN32
|
|
27 #define HAVE_SLEEP_P 1
|
|
28 #define SLEEP_HEADER <windows.h>
|
|
29 #define DO_SLEEP Sleep(INFINITE)
|
|
30 #else
|
|
31 #define HAVE_SLEEP_P 0
|
|
32 #define DO_SLEEP ((void)0)
|
|
33 #endif
|
|
34
|
|
35 #if defined __linux__ || defined __sun__ || defined __sun
|
|
36 #define HAVE_DEV_URANDOM_P 1
|
|
37 #else
|
|
38 #define HAVE_DEV_URANDOM_P 0
|
|
39 #endif
|
|
40
|
|
41 #ifndef INC_PREFIX
|
|
42 #if defined __unix__ || defined __linux__ || defined __unix || defined unix
|
|
43 #define INC_PREFIX "/usr/local/lib/ploki/"
|
|
44 #else
|
|
45 #define INC_PREFIX 0
|
|
46 #endif
|
|
47 #endif
|
|
48
|
|
49 #define INC_PREFIX_LIST \
|
|
50 { \
|
|
51 "", \
|
|
52 INC_PREFIX, \
|
|
53 0 \
|
|
54 }
|
|
55
|
|
56 #if defined __STDC_VERSION__ && __STDC_VERSION__ + 0 >= 199901L
|
|
57 #define HAVE_C99_P 1
|
|
58 #define HAVE_C99(x) x
|
|
59 #else
|
|
60 #define HAVE_C99_P 0
|
|
61 #define HAVE_C99(x)
|
|
62 #endif
|
|
63
|
|
64 #ifdef __GNUC__
|
|
65 #define HAVE_GCC_P 1
|
|
66 #define HAVE_GCC(x) x
|
|
67 #else
|
|
68 #define HAVE_GCC_P 0
|
|
69 #define HAVE_GCC(x)
|
|
70 #endif
|
|
71
|
|
72 #if HAVE_GCC_P
|
|
73 #if __GNUC__ == 2 && __GNUC_MINOR__ >= 7 || __GNUC__ > 2
|
|
74 #define ATTR(x) __attribute__(x)
|
|
75 #else
|
|
76 #define ATTR(x)
|
|
77 #endif
|
|
78
|
|
79 #if __GNUC__ == 2 && __GNUC_MINOR__ >= 96 || __GNUC__ > 2
|
|
80 #define ATTR_MALLOC __attribute__((__malloc__))
|
|
81 #define ATTR_PURE __attribute__((__pure__))
|
|
82 #else
|
|
83 #define ATTR_MALLOC
|
|
84 #define ATTR_PURE
|
|
85 #endif
|
|
86 #else
|
|
87 #define ATTR(x)
|
|
88 #define ATTR_MALLOC
|
|
89 #define ATTR_PURE
|
|
90 #endif
|
|
91
|
|
92 #define ATTR_UNUSED ATTR((__unused__))
|
|
93 #define ATTR_NORETURN ATTR((__noreturn__))
|
|
94 #define ATTR_SPRINTF ATTR((__format__(__printf__, 2, 3)))
|
|
95 #define ATTR_CONST ATTR((__const__))
|
|
96
|
|
97 #if HAVE_C99_P
|
|
98 #define HAVE_VSNPRINTF(x) x
|
|
99 #define HAVE_VSNPRINTF_P 1
|
|
100 #elif defined __GLIBC__
|
|
101 #include <features.h>
|
|
102 #if defined __USE_BSD || defined __USE_ISOC99 || defined __USE_UNIX98
|
|
103 #define HAVE_VSNPRINTF(x) x
|
|
104 #define HAVE_VSNPRINTF_P 1
|
|
105 #else
|
|
106 #define HAVE_VSNPRINTF(x)
|
|
107 #define HAVE_VSNPRINTF_P 0
|
|
108 #endif
|
|
109 #else
|
|
110 #define HAVE_VSNPRINTF(x)
|
|
111 #define HAVE_VSNPRINTF_P 0
|
|
112 #endif
|
|
113
|
|
114 #endif /* CONFIG_H_ */
|