aboutsummaryrefslogtreecommitdiff
path: root/mysql/my_config.h
blob: 14bc10e67b912682a82ad497025cde20b55cfb45 (plain)
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
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
/* file      : mysql/my_config.h -*- C -*-
 * copyright : Copyright (c) 2016-2018 Code Synthesis Ltd
 * license   : GPLv2 with FOSS License Exception; see accompanying COPYING file
 */

#ifndef MYSQL_MY_CONFIG_H
#define MYSQL_MY_CONFIG_H

/*
 * For the semantics of the following macros refer to
 * mysql/config.h.cmake.orig file.
 *
 * Note that we will explicitly undefine macros that are present in the
 * libmysqlclient source code but should not be defined. While this is not
 * technically required, it simplifies the change tracking (see README-DEV).
 * As a bonus we also make sure that they are not get eventually defined by
 * some system headers.
 */

/*
 * The version header defines the following macros:

#define PROTOCOL_VERSION
#define MYSQL_VERSION_MAJOR
#define MYSQL_VERSION_MINOR
#define MACHINE_TYPE
#define SYSTEM_TYPE
#define DEFAULT_BASEDIR      "/usr/local/mysql"
#define DEFAULT_CHARSET_HOME "/usr/local/mysql"
#define PLUGINDIR            "/usr/local/mysql/lib/plugin"
#define SHAREDIR             "/usr/local/mysql/share"

  * Keep all the macros listed (in this exact form) for the change tracking
  * (see README-DEV).
  */
#include <mysql/version.h>

#define PACKAGE_VERSION MYSQL_SERVER_VERSION
#define VERSION         MYSQL_SERVER_VERSION

/*
 * Endianess.
 */
#ifdef __FreeBSD__
#  include <sys/endian.h> /* BYTE_ORDER */
#else
#  if defined(_WIN32)
#    ifndef BYTE_ORDER
#      define BIG_ENDIAN    4321
#      define LITTLE_ENDIAN 1234
#      define BYTE_ORDER    LITTLE_ENDIAN
#    endif
#  else
#    include <sys/param.h>  /* BYTE_ORDER/__BYTE_ORDER */
#    ifndef BYTE_ORDER
#      ifdef __BYTE_ORDER
#        define BYTE_ORDER    __BYTE_ORDER
#        define BIG_ENDIAN    __BIG_ENDIAN
#        define LITTLE_ENDIAN __LITTLE_ENDIAN
#      else
#        error no BYTE_ORDER/__BYTE_ORDER define
#      endif
#    endif
#  endif
#endif

#if BYTE_ORDER == BIG_ENDIAN
# define WORDS_BIGENDIAN 1
#endif

/*
 * Types and type sizes.
 */
#ifndef _WIN32
#  define SIZEOF_VOIDP     __SIZEOF_POINTER__
#  define SIZEOF_CHARP     __SIZEOF_POINTER__
#  define SIZEOF_INT       __SIZEOF_INT__
#  define SIZEOF_LONG      __SIZEOF_LONG__
#  define SIZEOF_LONG_LONG __SIZEOF_LONG_LONG__

/*
 * Is always 8 bytes, thanks to the -D_FILE_OFFSET_BITS=64 preprocessor option
 * passed (see buildfile). We also check this at the compile time using
 * _Static_assert() (see mysql/libmysql/assert.c).
 */
#  define SIZEOF_OFF_T     8

/*
 * There is no way to exactly tell the time_t type size at the preprocessing
 * time, so we define it as the most probable one. We check this assumption
 * at the compile time using _Static_assert() (see mysql/libmysql/assert.c).
 */
#  define SIZEOF_TIME_T __SIZEOF_LONG__
#else
#  define SIZEOF_INT       4
#  define SIZEOF_LONG      4
#  define SIZEOF_LONG_LONG 8
#   define SIZEOF_OFF_T    4
#  ifdef _WIN64
#    define SIZEOF_VOIDP   8
#    define SIZEOF_TIME_T  8
#  else
#    define SIZEOF_VOIDP   4
#    define SIZEOF_TIME_T  8
#  endif
#  define SIZEOF_CHARP     SIZEOF_VOIDP
#endif

#define HAVE_STRUCT_TIMESPEC

/*
 * Hard to even find any records of these types.
 */
#undef HAVE_UINT
#undef HAVE_ULONG

/*
 * Usage of libc++.
 */
#ifdef  _LIBCPP_VERSION
#  define HAVE_LLVM_LIBCPP 1
#endif

/*
 * Specific for Linux.
 */
#ifdef __linux__
#  define HAVE_MMAP64         1
#  define HAVE_POSIX_TIMERS   1

/*
 * The fdatasync() system call appeared in FreeBSD more recently (11.1), so we
 * disable it's usage on FreeBSD.
 */
#  define HAVE_DECL_FDATASYNC 1
#  define HAVE_FDATASYNC      1

/*
 * Irrelevant for the client.
 */
#  undef HAVE_LINUX_LARGE_PAGES
#endif

/*
 * Specific for FreeBSD.
 */
#ifdef __FreeBSD__
#  define HAVE_IEEEFP_H 1
#endif

/*
 * Specific for FreeBSD and Linux.
 */
#if defined(__FreeBSD__) || defined(__linux__)
#  define HAVE_CLOCK_GETTIME   1
#  define HAVE_CUSERID         1
#  define HAVE_SIGEV_THREAD_ID 1
#endif

/*
 * Specific for FreeBSD and Mac OS.
 */
#if defined(__FreeBSD__) || defined(__APPLE__)
#  define FIONREAD_IN_SYS_FILIO      1
#  define HAVE_KQUEUE_TIMERS         1
#  define HAVE_SOCKADDR_IN_SIN_LEN   1
#  define HAVE_SOCKADDR_IN6_SIN6_LEN 1
#endif

/*
 * Specific for POSIX.
 */
#ifndef _WIN32
#  define HAVE_DLFCN_H          1
#  define HAVE_LANGINFO_H       1
#  define HAVE_POLL_H           1
#  define HAVE_POLL             1
#  define HAVE_PWD_H            1
#  define HAVE_SYS_IOCTL_H      1
#  define HAVE_SYS_MMAN_H       1
#  define HAVE_SYS_RESOURCE_H   1
#  define HAVE_SYS_SELECT_H     1
#  define HAVE_SYS_SOCKET_H     1
#  define HAVE_TERMIOS_H        1
#  define HAVE_UNISTD_H         1
#  define HAVE_SYS_UN_H         1
#  define HAVE_BACKTRACE        1
#  define HAVE_FTRUNCATE        1
#  define HAVE_DLOPEN           1
#  define HAVE_FCNTL            1
#  define HAVE_FSEEKO           1
#  define HAVE_FSYNC            1
#  define HAVE_GETPASS          1
#  define HAVE_GETPWNAM         1
#  define HAVE_GETPWUID         1
#  define HAVE_GETRLIMIT        1
#  define HAVE_GETRUSAGE        1
#  define HAVE_LSTAT            1
#  define HAVE_READLINK         1
#  define HAVE_REALPATH         1
#  define HAVE_STPCPY           1
#  define HAVE_STPNCPY          1
#  define HAVE_NL_LANGINFO      1
#  define HAVE_SYS_TIME_H       1
#  define HAVE_SYS_TIMES_H      1
#  define HAVE_TIMES            1
#  define HAVE_GETTIMEOFDAY     1
#  define FIONREAD_IN_SYS_IOCTL 1
#  define TIME_WITH_SYS_TIME    1
#  define DEFAULT_TMPDIR        P_tmpdir

/*
 * Not POSIX but are present on Linux and BSDs.
 */
#  define HAVE_EXECINFO_H 1

/*
 * Support for tagging symbols with __attribute__((visibility("hidden")))
 */
#  define HAVE_VISIBILITY_HIDDEN 1

/*
 * Compiler builtins.
 */
#  define HAVE_BUILTIN_UNREACHABLE 1
#  define HAVE_BUILTIN_EXPECT      1
#  define HAVE_BUILTIN_STPCPY      1
#  define HAVE_GCC_ATOMIC_BUILTINS 1
#  define HAVE_GCC_SYNC_BUILTINS   1

/*
 * Specific for Windows.
 */
#else
#  define WITH_PERFSCHEMA_STORAGE_ENGINE 1
#  define HAVE_TELL                      1
#  define DEFAULT_TMPDIR                 ""
#endif

/*
 * Common for all supported OSes/compilers.
 */
#define HAVE_COMPRESS 1
#define HAVE_STRNLEN  1
#define HAVE_ISINF    1
#define HAVE_IPV6     1
#define MAX_INDEXES   64U

/*
 * Collations are added for the enabled character sets.
 */
#define MYSQL_DEFAULT_CHARSET_NAME   "latin1"
#define MYSQL_DEFAULT_COLLATION_NAME "latin1_swedish_ci"
#define HAVE_CHARSET_armscii8        1
#define HAVE_CHARSET_ascii           1
#define HAVE_CHARSET_big5            1
#define HAVE_CHARSET_cp1250          1
#define HAVE_CHARSET_cp1251          1
#define HAVE_CHARSET_cp1256          1
#define HAVE_CHARSET_cp1257          1
#define HAVE_CHARSET_cp850           1
#define HAVE_CHARSET_cp852           1
#define HAVE_CHARSET_cp866           1
#define HAVE_CHARSET_cp932           1
#define HAVE_CHARSET_dec8            1
#define HAVE_CHARSET_eucjpms         1
#define HAVE_CHARSET_euckr           1
#define HAVE_CHARSET_gb18030         1
#define HAVE_CHARSET_gb2312          1
#define HAVE_CHARSET_gbk             1
#define HAVE_CHARSET_geostd8         1
#define HAVE_CHARSET_greek           1
#define HAVE_CHARSET_hebrew          1
#define HAVE_CHARSET_hp8             1
#define HAVE_CHARSET_keybcs2         1
#define HAVE_CHARSET_koi8r           1
#define HAVE_CHARSET_koi8u           1
#define HAVE_CHARSET_latin1          1
#define HAVE_CHARSET_latin2          1
#define HAVE_CHARSET_latin5          1
#define HAVE_CHARSET_latin7          1
#define HAVE_CHARSET_macce           1
#define HAVE_CHARSET_macroman        1
#define HAVE_CHARSET_sjis            1
#define HAVE_CHARSET_swe7            1
#define HAVE_CHARSET_tis620          1
#define HAVE_CHARSET_ucs2            1
#define HAVE_CHARSET_ujis            1
#define HAVE_CHARSET_utf16           1
#define HAVE_CHARSET_utf32           1
#define HAVE_CHARSET_utf8            1
#define HAVE_CHARSET_utf8mb4         1
#define HAVE_UCA_COLLATIONS          1

#undef DISABLE_PSI_THREAD
#undef DISABLE_PSI_MUTEX
#undef DISABLE_PSI_RWLOCK
#undef DISABLE_PSI_COND
#undef DISABLE_PSI_FILE
#undef DISABLE_PSI_TABLE
#undef DISABLE_PSI_SOCKET
#undef DISABLE_PSI_STAGE
#undef DISABLE_PSI_STATEMENT
#undef DISABLE_PSI_SP
#undef DISABLE_PSI_PS
#undef DISABLE_PSI_IDLE
#undef DISABLE_PSI_STATEMENT_DIGEST
#undef DISABLE_PSI_METADATA
#undef DISABLE_PSI_MEMORY
#undef DISABLE_PSI_TRANSACTION

/*
 * Obsolete headers and functions.
 */
#undef HAVE_TERMIO_H

/*
 * Specific for unsupported OSes (Solaris, SunOS, HP-UX...).
 */
#undef HAVE_PRINTSTACK
#undef HAVE_GETHRTIME
#undef HAVE_GETPASSPHRASE
#undef HAVE_SIGEV_PORT
#undef HAVE_SOLARIS_ATOMIC

/*
 * The upstream package undefines it for all supported compilers.
 */
#undef HAVE_ABI_CXA_DEMANGLE

/*
 * The upstream package defines it only for MacOS. Let's disable tracing for it
 * as well.
 */
#undef HAVE_DTRACE

/*
 * We don't assume any instrumentation.
 */
#undef HAVE_VALGRIND
#undef HAVE_ASAN

/*
 * Usage of alloca() is discouraged on Linux and BSDs, so let's not use it.
 */
#undef HAVE_ALLOCA_H

#undef ss_family
#undef ENABLED_LOCAL_INFILE
#undef WITH_NDBCLUSTER_STORAGE_ENGINE
#undef EXTRA_DEBUG

#endif // MYSQL_MY_CONFIG_H