diff --git a/include/proxysql_macros.h b/include/proxysql_macros.h index 53f3ab2b77..d7090b1c61 100644 --- a/include/proxysql_macros.h +++ b/include/proxysql_macros.h @@ -42,9 +42,6 @@ // copy 4 bytes #define CPY4(x) *((uint32_t *)x) -// copy 8 bytes -#define CPY8(x) *((uint64_t *)x) - // (un)set blocking mode on a file descriptor #define ioctl_FIONBIO(fd, mode) \ { \ diff --git a/lib/MySQL_Protocol.cpp b/lib/MySQL_Protocol.cpp index 86f6e0856a..80e4e478b8 100644 --- a/lib/MySQL_Protocol.cpp +++ b/lib/MySQL_Protocol.cpp @@ -215,6 +215,12 @@ unsigned int CPY3(unsigned char *ptr) { return buf.i; } +uint64_t CPY8(unsigned char *ptr) { + uint64_t buf; + memcpy(&buf,ptr,sizeof(uint64_t)); + return buf; +} + // see http://dev.mysql.com/doc/internals/en/integer.html#packet-Protocol::LengthEncodedInteger /* arguments to pass: * pointer to the field