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

#ifndef MYSQL_BINLOG_CONFIG_H
#define MYSQL_BINLOG_CONFIG_H

/*
 * For the semantics of the following macros refer to
 * binlog_config.h.cmake.orig and libbinlogevents/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.
 */

#include <mysql/my_config.h> // BYTE_ORDER, BIG_ENDIAN, SIZEOF_*

/*
 * Macros defined by upstream's binlog_config.h (see binlog_config.h.cmake for
 * details).
 */
#if BYTE_ORDER == BIG_ENDIAN
# define IS_BIG_ENDIAN 1
#endif

/*
 * If le{64,32,16}toh() are defined in endian.h. That's why the macros are not
 * defined for FreeBSD.
 */
#ifdef __linux__
#  define HAVE_LE64TOH 1
#  define HAVE_LE32TOH 1
#  define HAVE_LE16TOH 1
#endif

#ifndef _WIN32
#  define HAVE_STRNDUP 1
#endif

#if defined(HAVE_LE64TOH) && defined(HAVE_LE32TOH) && defined(HAVE_LE16TOH)
#  define HAVE_ENDIAN_CONVERSION_MACROS 1
#endif

#define HAVE_LONG_LONG 1
#define HAVE_LONG      1
#define HAVE_INT       1

#endif /* MYSQL_BINLOG_CONFIG_H */