Commit 6de8f4a1 authored by Rich Prohaska's avatar Rich Prohaska

make this file portable to compilers other than gcc 4



git-svn-id: file:///svn/tokudb@100 c7de825b-a66e-492c-adef-691d508d4ae1
parent dc5faf3e
...@@ -60,7 +60,11 @@ static inline void list_move(struct list *newhead, struct list *oldhead) { ...@@ -60,7 +60,11 @@ static inline void list_move(struct list *newhead, struct list *oldhead) {
list_init(oldhead); list_init(oldhead);
} }
#if defined(__GNUC__) && __GNUC__ >= 4
#define list_struct(p, t, f) (t*)((char*)(p) - __builtin_offsetof(t, f)) #define list_struct(p, t, f) (t*)((char*)(p) - __builtin_offsetof(t, f))
#else
#define list_struct(p, t, f) (t*)((char*)(p) - ((char*)&((t*)0)->f))
#endif
......
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