Avoid usage of typeof and replace __builtin_offsetof with offsetof
This commit is contained in:
parent
918f8cca36
commit
1bbef4be74
|
@ -40,11 +40,8 @@
|
||||||
|
|
||||||
#define lstreq(A, B, N) ((sizeof((A)) - 1) == (N) && memcmp((A), (B), (N)) == 0)
|
#define lstreq(A, B, N) ((sizeof((A)) - 1) == (N) && memcmp((A), (B), (N)) == 0)
|
||||||
|
|
||||||
#define nghttp2_struct_of(ptr, type, member) \
|
#define nghttp2_struct_of(ptr, type, member) \
|
||||||
({ \
|
((type *)(void *)((char *)(ptr) - offsetof(type, member)))
|
||||||
const typeof(((type *)0)->member) *nghttp2__mptr = (ptr); \
|
|
||||||
(type *)(void *)((char *)nghttp2__mptr - __builtin_offsetof(type, member)); \
|
|
||||||
})
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copies 2 byte unsigned integer |n| in host byte order to |buf| in
|
* Copies 2 byte unsigned integer |n| in host byte order to |buf| in
|
||||||
|
|
Loading…
Reference in New Issue