From f282bc3fe7a86dde0fa447d34494ba71569a5f62 Mon Sep 17 00:00:00 2001 From: Alexey Melnichuk Date: Fri, 8 Apr 2016 13:12:19 +0300 Subject: [PATCH] Fix. static assert. now only `magic` field should match --- src/lceasy.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/lceasy.c b/src/lceasy.c index 35a1593..72b85b5 100644 --- a/src/lceasy.c +++ b/src/lceasy.c @@ -1051,9 +1051,8 @@ void lcurl_easy_initlib(lua_State *L, int nup){ /* Hack. We ensure that lcurl_easy_t and lcurl_hpost_stream_t compatiable for readfunction */ - LCURL_STATIC_ASSERT(offsetof(lcurl_easy_t, L) == offsetof(lcurl_hpost_stream_t, L)); - LCURL_STATIC_ASSERT(offsetof(lcurl_easy_t, rd) == offsetof(lcurl_hpost_stream_t, rd)); - LCURL_STATIC_ASSERT(offsetof(lcurl_easy_t, rbuffer) == offsetof(lcurl_hpost_stream_t, rbuffer)); + LCURL_STATIC_ASSERT(offsetof(lcurl_easy_t, magic) == offsetof(lcurl_hpost_stream_t, magic)); + LCURL_STATIC_ASSERT(sizeof(((lcurl_easy_t*)0)->magic) == sizeof(((lcurl_hpost_stream_t*)0)->magic)); if(!lutil_createmetap(L, LCURL_EASY, lcurl_easy_methods, nup)) lua_pop(L, nup);