summaryrefslogtreecommitdiff
path: root/kconfig/zconf.gperf
diff options
context:
space:
mode:
authorLawrence D'Anna <larry@elder-gods.org>2015-04-08 04:11:54 (GMT)
committerLawrence D'Anna <larry@elder-gods.org>2015-04-08 04:14:23 (GMT)
commit575d56ee680e19a4bd235f549a5a047b517adce0 (patch)
tree0fd867c18df0a3296b0872009e12f8a182807806 /kconfig/zconf.gperf
parent18175b8d93ca1807236eced0a3389e9b46ecca53 (diff)
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 <larry@elder-gods.org>
Diffstat (limited to 'kconfig/zconf.gperf')
-rw-r--r--kconfig/zconf.gperf9
1 files changed, 9 insertions, 0 deletions
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 <stddef.h>
+# 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);