From 575d56ee680e19a4bd235f549a5a047b517adce0 Mon Sep 17 00:00:00 2001 From: Lawrence D'Anna Date: Tue, 7 Apr 2015 21:11:54 -0700 Subject: [PATCH] build compat fix for mac os: define offsetof if it's missing When building on Mac OS, we don't seem to have offsetof when we need it for gperf-generated code. This patch solves that issue. Signed-off-by: Lawrence D'Anna --- kconfig/zconf.gperf | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/kconfig/zconf.gperf b/kconfig/zconf.gperf index c9e690eb..d758a2ad 100644 --- a/kconfig/zconf.gperf +++ b/kconfig/zconf.gperf @@ -7,6 +7,15 @@ %pic %struct-type +%{ +# ifndef offsetof +# include +# ifndef offsetof +# define offsetof(st, m) ((size_t)(&((st *)0)->m)) +# endif +# endif +%} + struct kconf_id; static struct kconf_id *kconf_id_lookup(register const char *str, register unsigned int len);