From patchwork Thu Oct 16 16:27:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Masker X-Patchwork-Id: 400322 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 383751400DE for ; Fri, 17 Oct 2014 03:27:41 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:from:date:message-id:subject:to :content-type; q=dns; s=default; b=FY4I79Wjk/OqaZ6tCJBlK8xqT0m66 k5+cfJ6JiC6eG4++m5gXc2NyuGCXzdrTe7/2jW9dj4t87AArsX8RexWl+eX6rw0T /yNkM9024CTDUF8ZuHd93rXKisIJ285rTgFJGqyODnCOfYPiWUIcL0vJZs0fYf9O dRUPwPMm7D5Vbk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:from:date:message-id:subject:to :content-type; s=default; bh=1mtPSzw+ZBfH3jINvzGBpIppzDY=; b=RAO WXNM0KtJgMToUI88mY+o3hb/oUxvULXXPeP7vjtFKLVrTzmiS2hjiURt1i+PhBM1 fISLsQN9pND4QDnYULxCQoeQ+YVGHTp/+GHhY6QEJAxR5TPiwVIhtEwETvMNXQ6n gt7wY73SvjtXpwdtSlPmtRs+/WLHn0qdsdhCE8EY= Received: (qmail 14461 invoked by alias); 16 Oct 2014 16:27:33 -0000 Mailing-List: contact crossgcc-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: crossgcc-owner@sourceware.org Delivered-To: mailing list crossgcc@sourceware.org Received: (qmail 14447 invoked by uid 89); 16 Oct 2014 16:27:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-oi0-f47.google.com Received: from mail-oi0-f47.google.com (HELO mail-oi0-f47.google.com) (209.85.218.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 16 Oct 2014 16:27:31 +0000 Received: by mail-oi0-f47.google.com with SMTP id a141so2925228oig.6 for ; Thu, 16 Oct 2014 09:27:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-type; bh=ofvbOJLwKf4baW35YhGbguNbkqKFBYOeCyONe/+EriU=; b=f53e/uOhGghcz2QQPH5z7zi4ChVhWW8JCEJZS7dXkybsJFjP8VxC/X7teiiIi9/rzo KfW9lfg44IMFM5djprq+hzCU1NycXlPMeLAnjXfneRj/mPqxvSpd6/L+Rk06FSFiIg32 kv2s1TaPRrlUoI6yEInTVDHQ3lR3/sCwkgQpEAGOEon2+3MVBQBbEaQMI3GcrWvjuK6g +m5eYdXJ8J7QGtDYbAtW3vDww6GqP5CyoAH59tsMYPM66xHMv0r77BUpORtuyBkiPS8c ZqDDScI9i123sz9RaAXIMdYaNJljNbdEJSkoW0RpXcdSCKOt3DyOLBVHgKqS8OW+g9NQ qHrQ== X-Gm-Message-State: ALoCoQncHJkHVAaEchCTsSGRzy1RBT8E0QS77DcykWtWs7ZcC45mxHR0qaDKvY6w7r0eLh8eZA0a X-Received: by 10.60.146.171 with SMTP id td11mr1860944oeb.23.1413476849809; Thu, 16 Oct 2014 09:27:29 -0700 (PDT) MIME-Version: 1.0 Received: by 10.76.62.12 with HTTP; Thu, 16 Oct 2014 09:27:09 -0700 (PDT) From: "Jason T. Masker" Date: Thu, 16 Oct 2014 12:27:09 -0400 Message-ID: Subject: Re: [PATCH 1/2] Prevent zconf.gperf from throwing an error on OSX To: crossgcc 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. register unsigned int len); Signed-off-by: Bryan Hundven Signed-off-by: Jason Masker --- For unsubscribe information see http://sourceware.org/lists.html#faq 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,