Commit f620da19 authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-10725 Server 10.1.17 fails to build using clang with c++11

my_offsetof() returns a difference of two pointers, it must use the
appropriate return type (my_ptrdiff_t, not size_t)
parent 94344313
......@@ -857,8 +857,7 @@ typedef long long my_ptrdiff_t;
and related routines are refactored.
*/
#define my_offsetof(TYPE, MEMBER) \
((size_t)((char *)&(((TYPE *)0x10)->MEMBER) - (char*)0x10))
#define my_offsetof(TYPE, MEMBER) PTR_BYTE_DIFF(&((TYPE *)0x10)->MEMBER, 0x10)
#define NullS (char *) 0
......
......@@ -42,9 +42,9 @@ enum file_opt_type {
struct File_option
{
LEX_STRING name; /**< Name of the option */
int offset; /**< offset to base address of value */
file_opt_type type; /**< Option type */
LEX_STRING name; /**< Name of the option */
my_ptrdiff_t offset; /**< offset to base address of value */
file_opt_type type; /**< Option type */
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment