From c03ea4076378d806264550055a6d7e2c688d54e6 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Mon, 30 Jul 2018 11:47:35 +0200 Subject: [PATCH] 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. --- include/common/compiler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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