diff --git a/src/jansson_private.h b/src/jansson_private.h index 4490702a..6d7e46cc 100644 --- a/src/jansson_private.h +++ b/src/jansson_private.h @@ -8,11 +8,12 @@ #ifndef JANSSON_PRIVATE_H #define JANSSON_PRIVATE_H +#include #include "jansson.h" #include "hashtable.h" #define container_of(ptr_, type_, member_) \ - ((type_ *)((char *)ptr_ - (size_t)&((type_ *)0)->member_)) + ((type_ *)((char *)ptr_ - offsetof(type_, member_))) typedef struct { json_t json;