Commit 698303a1 authored by Christian Rober's avatar Christian Rober Committed by Yoni Fogel

refs #5086 fix to avoid using __builtin_offsetof on clang, since POD is...

refs #5086 fix to avoid using __builtin_offsetof on clang, since POD is stricter on clang, and not all of our types that use toku_list are POD on clang.

git-svn-id: file:///svn/toku/tokudb@47085 c7de825b-a66e-492c-adef-691d508d4ae1
parent 1fff2936
......@@ -87,7 +87,7 @@ static inline void toku_list_move(struct toku_list *newhead, struct toku_list *o
// Note: Need the extra level of parens in these macros so that
// toku_list_struct(h, foo, b)->zot
// will work right. Otherwise the type cast will try to include ->zot, and it will be all messed up.
#if (defined(__GNUC__) && __GNUC__ >= 4) || defined(__builtin_offsetof)
#if ((defined(__GNUC__) && __GNUC__ >= 4) || defined(__builtin_offsetof) ) && !defined(__clang__)
#define toku_list_struct(p, t, f) ((t*)((char*)(p) - __builtin_offsetof(t, f)))
#else
#define toku_list_struct(p, t, f) ((t*)((char*)(p) - ((char*)&((t*)0)->f)))
......
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