summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-09-24 01:17:35 +0200
committerSergei Golubchik <serg@mariadb.org>2016-09-26 12:20:28 +0200
commitf620da194befe4506679ad7f1d0725796fad7de0 (patch)
treef7892915914803a51e42691d8c018d3ff80d82f9 /include
parent943443137460cab6499c032f0e5a03256daa9571 (diff)
downloadmariadb-git-f620da194befe4506679ad7f1d0725796fad7de0.tar.gz
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)
Diffstat (limited to 'include')
-rw-r--r--include/my_global.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/include/my_global.h b/include/my_global.h
index dce38a124c1..0c15478439f 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -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