From: Willy Tarreau Date: Mon, 30 Jul 2018 09:47:35 +0000 (+0200) Subject: BUILD/MINOR: compiler: fix offsetof() on older compilers X-Git-Tag: v1.9-dev1~5 X-Git-Url: http://git.kaiwu.me/postgresql/log/contrib/postgres_fdw/postgres_fdw.c?a=commitdiff_plain;h=c03ea4076378d806264550055a6d7e2c688d54e6;p=haproxy.git BUILD/MINOR: compiler: fix offsetof() on older compilers An offsetof() macro was introduced with commit 928fbfa ("MINOR: compiler: introduce offsetoff().") with a fallback for older compilers. But this breaks gcc 3.4 because __size_t and __uintptr_t are not defined there. However size_t and uintptr_t are, so let's fix it this way. No backport needed. --- diff --git a/include/common/compiler.h b/include/common/compiler.h index 125c47399..ad99694af 100644 --- a/include/common/compiler.h +++ b/include/common/compiler.h @@ -121,7 +121,7 @@ #define offsetof(type, field) __builtin_offsetof(type, field) #else #define offsetof(type, field) \ - ((__size_t)(__uintptr_t)((const volatile void *)&((type *)0)->field)) + ((size_t)(uintptr_t)((const volatile void *)&((type *)0)->field)) #endif #endif