[PATCH 1/2][RESEND] Prevent zconf.gperf from throwing an error on OSX
Jason T. Masker
jason@masker.net
Mon Dec 15 02:17:00 GMT 2014
On Fri, Dec 5, 2014 at 6:25 AM, Bryan Hundven <bryanhundven@gmail.com> wrote:
> Jason,
>
> On Thu, Oct 16, 2014 at 9:51 AM, Jason T. Masker <jason@masker.net> wrote:
>> Updated zconf.gperf patch to be conditional.
>>
>> The problem is when compiling with clang/LLVM, so not necessarily
>> specific to OS X. Offsetof is part of C99 and defined in stddef.h, but
>> is builtin with gcc. This code will check for a definition and try
>> including stddef.h if it is not found. As a last resort, offsetof will
>> be defined. Apologies for the resend. I did not sign off.
>>
>> Signed-off-by: Jason Masker <jason@masker.net>
>>
>>
>> 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);
>
> Dang, I wanted to apply this but the patch did not apply cleanly.
> Would you mind rebasing this patch with latest head and resending?
> Then I'll finally get this bad boy applied.
>
> Thanks,
>
> -Bryan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-update-zconf.gperf-to-conditionally-define-offsetof.patch
Type: application/octet-stream
Size: 784 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/crossgcc/attachments/20141215/c9669305/attachment.obj>
-------------- next part --------------
--
For unsubscribe information see http://sourceware.org/lists.html#faq
More information about the crossgcc
mailing list