Avoid usage of typeof and replace __builtin_offsetof with offsetof

This commit is contained in:
Tatsuhiro Tsujikawa 2015-09-10 21:27:14 +09:00
parent 918f8cca36
commit 1bbef4be74
1 changed files with 2 additions and 5 deletions

View File

@ -41,10 +41,7 @@
#define lstreq(A, B, N) ((sizeof((A)) - 1) == (N) && memcmp((A), (B), (N)) == 0)
#define nghttp2_struct_of(ptr, type, member) \
({ \
const typeof(((type *)0)->member) *nghttp2__mptr = (ptr); \
(type *)(void *)((char *)nghttp2__mptr - __builtin_offsetof(type, member)); \
})
((type *)(void *)((char *)(ptr) - offsetof(type, member)))
/*
* Copies 2 byte unsigned integer |n| in host byte order to |buf| in