diff --git a/lib/nghttp2_helper.h b/lib/nghttp2_helper.h index 979b64af..89631823 100644 --- a/lib/nghttp2_helper.h +++ b/lib/nghttp2_helper.h @@ -40,11 +40,8 @@ #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)); \ - }) +#define nghttp2_struct_of(ptr, type, member) \ + ((type *)(void *)((char *)(ptr) - offsetof(type, member))) /* * Copies 2 byte unsigned integer |n| in host byte order to |buf| in