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)
This commit is contained in:
parent
9434431374
commit
f620da194b
@ -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 */
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user