[Commits] 4c61c9b39a7: Fix compile error on windows: htobe{16, 32, 64} are not defined
revision-id: 4c61c9b39a75a815a14c9d8cd39782db8c4dc699 (mariadb-10.4.4-752-g4c61c9b39a7) parent(s): c54ecbc7f5d141fefd97b196113ad14d0c17eca6 author: Sergei Petrunia committer: Sergei Petrunia timestamp: 2020-03-10 01:24:33 +0300 message: Fix compile error on windows: htobe{16,32,64} are not defined Use the same solution as we used for MyRocks. --- storage/xpand/xpand_connection.cc | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/storage/xpand/xpand_connection.cc b/storage/xpand/xpand_connection.cc index eae19740a24..8fa1ef37483 100644 --- a/storage/xpand/xpand_connection.cc +++ b/storage/xpand/xpand_connection.cc @@ -15,6 +15,27 @@ Copyright (c) 2019, 2020, MariaDB Corporation. #include "my_pthread.h" +#ifdef _WIN32 +#include <stdlib.h> +#define htobe64 _byteswap_uint64 +#define be64toh _byteswap_uint64 +#define htobe32 _byteswap_ulong +#define be32toh _byteswap_ulong +#define htobe16 _byteswap_ushort +#define be16toh _byteswap_ushort +#endif + +#if defined(__APPLE__) +#include <libkern/OSByteOrder.h> +#define htobe64(x) OSSwapHostToBigInt64(x) +#define be64toh(x) OSSwapBigToHostInt64(x) +#define htobe32(x) OSSwapHostToBigInt32(x) +#define be32toh(x) OSSwapBigToHostInt32(x) +#define htobe16(x) OSSwapHostToBigInt16(x) +#define be16toh(x) OSSwapBigToHostInt16(x) +#endif + + extern int xpand_connect_timeout; extern int xpand_read_timeout; extern int xpand_write_timeout;
participants (1)
-
psergey