From 575d56ee680e19a4bd235f549a5a047b517adce0 Mon Sep 17 00:00:00 2001 From: Lawrence D'Anna Date: Tue, 7 Apr 2015 21:11:54 -0700 Subject: 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 diff --git a/kconfig/zconf.gperf b/kconfig/zconf.gperf index c9e690e..d758a2a 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); -- cgit v0.10.2-6-g49f6