forked from cloudflarearchive/kyotocabinet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
myconf.h
242 lines (176 loc) · 5.23 KB
/
myconf.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
/*************************************************************************************************
* System-dependent configurations
* Copyright (C) 2009-2012 FAL Labs
* This file is part of Kyoto Cabinet.
* This program is free software: you can redistribute it and/or modify it under the terms of
* the GNU General Public License as published by the Free Software Foundation, either version
* 3 of the License, or any later version.
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
* You should have received a copy of the GNU General Public License along with this program.
* If not, see <http://www.gnu.org/licenses/>.
*************************************************************************************************/
#ifndef _MYCONF_H // duplication check
#define _MYCONF_H
/*************************************************************************************************
* system discrimination
*************************************************************************************************/
#if defined(__linux__)
#define _SYS_LINUX_
#define _KC_OSNAME "Linux"
#elif defined(__FreeBSD__)
#define _SYS_FREEBSD_
#define _KC_OSNAME "FreeBSD"
#elif defined(__NetBSD__)
#define _SYS_NETBSD_
#define _KC_OSNAME "NetBSD"
#elif defined(__OpenBSD__)
#define _SYS_OPENBSD_
#define _KC_OSNAME "OpenBSD"
#elif defined(__sun__) || defined(__sun)
#define _SYS_SUNOS_
#define _KC_OSNAME "SunOS"
#elif defined(__hpux)
#define _SYS_HPUX_
#define _KC_OSNAME "HP-UX"
#elif defined(__osf)
#define _SYS_TRU64_
#define _KC_OSNAME "Tru64"
#elif defined(_AIX)
#define _SYS_AIX_
#define _KC_OSNAME "AIX"
#elif defined(__APPLE__) && defined(__MACH__)
#define _SYS_MACOSX_
#define _KC_OSNAME "Mac OS X"
#elif defined(_MSC_VER)
#define _SYS_MSVC_
#define _KC_OSNAME "Windows (VC++)"
#elif defined(_WIN32)
#define _SYS_MINGW_
#define _KC_OSNAME "Windows (MinGW)"
#elif defined(__CYGWIN__)
#define _SYS_CYGWIN_
#define _KC_OSNAME "Windows (Cygwin)"
#else
#define _SYS_GENERIC_
#define _KC_OSNAME "Generic"
#endif
#define _KC_VERSION "1.2.76"
#define _KC_LIBVER 16
#define _KC_LIBREV 13
#define _KC_FMTVER 5
#if defined(_MYBIGEND)
#define _KC_BIGEND 1
#else
#define _KC_BIGEND 0
#endif
#if defined(_MYGCCATOMIC)
#define _KC_GCCATOMIC 1
#else
#define _KC_GCCATOMIC 0
#endif
#if defined(_MYZLIB)
#define _KC_ZLIB 1
#else
#define _KC_ZLIB 0
#endif
#if defined(_MYLZO)
#define _KC_LZO 1
#else
#define _KC_LZO 0
#endif
#if defined(_MYLZMA)
#define _KC_LZMA 1
#else
#define _KC_LZMA 0
#endif
#if defined(_SYS_MSVC_)
#define _KC_PXREGEX 0
#else
#define _KC_PXREGEX 1
#endif
/*************************************************************************************************
* notation of the file system
*************************************************************************************************/
#if defined(_SYS_MSVC_) || defined(_SYS_MINGW_)
#define MYPATHCHR '\\'
#define MYPATHSTR "\\"
#define MYEXTCHR '.'
#define MYEXTSTR "."
#define MYCDIRSTR "."
#define MYPDIRSTR ".."
#else
#define MYPATHCHR '/'
#define MYPATHSTR "/"
#define MYEXTCHR '.'
#define MYEXTSTR "."
#define MYCDIRSTR "."
#define MYPDIRSTR ".."
#endif
/*************************************************************************************************
* general headers
*************************************************************************************************/
extern "C" {
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <float.h>
#include <limits.h>
#include <locale.h>
#include <math.h>
#include <setjmp.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <string.h>
#include <time.h>
}
extern "C" {
#include <stdint.h>
}
#if defined(_SYS_MSVC_) || defined(_SYS_MINGW_)
#include <windows.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <direct.h>
#include <io.h>
#include <process.h>
#else
extern "C" {
#include <unistd.h>
#include <sys/param.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <sys/time.h>
#include <sys/times.h>
#include <sys/wait.h>
#include <sys/resource.h>
#include <fcntl.h>
#include <dirent.h>
}
extern "C" {
#include <pthread.h>
#include <sched.h>
}
#endif
#if defined(_SYS_FREEBSD_) || defined(_SYS_OPENBSD_) || defined(_SYS_NETBSD_) || \
defined(_SYS_MACOSX_)
#define pthread_spinlock_t pthread_mutex_t
#define pthread_spin_init(KC_a, KC_b) \
pthread_mutex_init(KC_a, NULL)
#define pthread_spin_destroy(KC_a) \
pthread_mutex_destroy(KC_a)
#define pthread_spin_lock(KC_a) \
pthread_mutex_lock(KC_a)
#define pthread_spin_trylock(KC_a) \
pthread_mutex_trylock(KC_a)
#define pthread_spin_unlock(KC_a) \
pthread_mutex_unlock(KC_a)
#endif
#endif // duplication check
// END OF FILE