diff options
author | Lawrence D'Anna <larry@elder-gods.org> | 2015-04-07 21:11:54 -0700 |
---|---|---|
committer | Lawrence D'Anna <larry@elder-gods.org> | 2015-04-07 21:14:23 -0700 |
commit | 575d56ee680e19a4bd235f549a5a047b517adce0 (patch) | |
tree | 0fd867c18df0a3296b0872009e12f8a182807806 | |
parent | 18175b8d93ca1807236eced0a3389e9b46ecca53 (diff) | |
download | crosstool-ng-575d56ee680e19a4bd235f549a5a047b517adce0.tar.gz crosstool-ng-575d56ee680e19a4bd235f549a5a047b517adce0.tar.bz2 crosstool-ng-575d56ee680e19a4bd235f549a5a047b517adce0.zip |
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>
-rw-r--r-- | kconfig/zconf.gperf | 9 |
1 files changed, 9 insertions, 0 deletions
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 <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); |