summaryrefslogtreecommitdiff
path: root/libmysqlclient/mysql/my_config.h
blob: bfbb4dc648b92d0d1e004ae31da5bf28e36680db (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
/* file      : mysql/my_config.h -*- C -*-
 * copyright : Copyright (c) 2016-2019 Code Synthesis Ltd
 * license   : GPLv2 with Universal FOSS Exception; see accompanying LICENSE file
 */

#ifndef MYSQL_MY_CONFIG_H
#define MYSQL_MY_CONFIG_H

/*
 * For the semantics of the following macros refer to config.h.cmake.orig and
 * upstream's configure.cmake.
 *
 * 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.
 */

/*
 * Auto-generated. Defines the following configuration macros:

#define PROTOCOL_VERSION

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

/*
 * Auto-generated. Defines macros that depend on the version and build2
 * configuration variables.
 */
#include <mysql/config.h>

#define PACKAGE_VERSION MYSQL_SERVER_VERSION
#define VERSION         MYSQL_SERVER_VERSION

/*
 * Is ON by default.
 */
#define ENABLED_PROFILING 1

/*
 * 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

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

/*
 * malloc_info()
 */
#  define HAVE_MALLOC_H    1
#  define HAVE_MALLOC_INFO 1

/*
 * syscall(SYS_gettid)
 */
#  define HAVE_SYS_GETTID 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_PTHREAD_GETTHREADID_NP 1
#endif

/*
 * Specific for Mac OS.
 */
#ifdef __APPLE__
#  define HAVE_PTHREAD_THREADID_NP 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
#  define HAVE_POSIX_FALLOCATE 1
#endif

/*
 * Specific for FreeBSD and Mac OS.
 */
#if defined(__FreeBSD__) || defined(__APPLE__)
#  define FIONREAD_IN_SYS_FILIO      1
#  define HAVE_KQUEUE                1
#  define HAVE_KQUEUE_TIMERS         1
#  define HAVE_SOCKADDR_IN_SIN_LEN   1
#  define HAVE_SOCKADDR_IN6_SIN6_LEN 1
#  define HAVE_STRLCAT               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_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_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 HAVE_ARPA_INET_H          1
#  define HAVE_NETINET_IN_H         1
#  define HAVE_CHOWN                1
#  define HAVE_FCHMOD               1
#  define HAVE_MLOCKALL             1
#  define HAVE_SYS_WAIT_H           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

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

#ifdef _WIN32
#  define SO_EXT ".dll"
#elif defined(__APPLE__)
#  define SO_EXT ".dylib"
#else
#  define SO_EXT ".so"
#endif

/*
 * Common for all supported OSes/compilers.
 */
#define HAVE_STRNLEN     1
#define MAX_INDEXES      64U
#define HAVE_SYS_TYPES_H 1
#define STACK_DIRECTION  -1

/*
 * Default character set and collation.
 */
#define MYSQL_DEFAULT_CHARSET_NAME   "latin1"
#define MYSQL_DEFAULT_COLLATION_NAME "latin1_swedish_ci"

#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
#undef DISABLE_PSI_ERROR

/*
 * 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

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

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

/*
 * Some exotic host_access(), struct request_info, etc.
 */
#undef HAVE_LIBWRAP
#undef HAVE_LIBWRAP_PROTOTYPES

#undef ENABLED_LOCAL_INFILE
#undef EXTRA_DEBUG

#endif /* MYSQL_MY_CONFIG_H */