From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 9A0771F461 for ; Fri, 5 Jul 2019 20:30:01 +0000 (UTC) Date: Fri, 5 Jul 2019 20:30:01 +0000 From: Eric Wong To: unicorn-public@bogomips.org Subject: [PATCH 4/3] http: gperf 3.0.3 compatibility Message-ID: <20190705203001.fmblz3v4tnhpywdb@dcvr> References: <20190704220108.7849-1-e@80x24.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190704220108.7849-1-e@80x24.org> List-Id: gperf actually used to use offsetof in older versions: https://git.savannah.gnu.org/cgit/gperf.git/commit?h=b468e3aae05d176d So we don't need to do that substitution for versions before that commit in gperf. Now why do we care about gperf 3.0.3 from 2007? That's because FreeBSD is stuck on 3.0.3 from GPL-3-phobia, despite the gperf manual explicitly stating the output is NOT subject to the copyright of gperf: https://www.gnu.org/software/gperf/manual/gperf.html#Output-Copyright But there's plenty of other GPL-3 packages distributed by FreeBSD... Fwiw, OpenBSD and NetBSD have no problem with distributing the latest gperf 3.1; but I haven't tested those systems. --- ext/unicorn_http/gperf.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/unicorn_http/gperf.rb b/ext/unicorn_http/gperf.rb index 9765f86..330f70d 100644 --- a/ext/unicorn_http/gperf.rb +++ b/ext/unicorn_http/gperf.rb @@ -9,7 +9,8 @@ "\nstatic#$&" }. -gsub!( +# gperf 3.0.3 (on FreeBSD 12.0) actually uses offsetof +gsub( # gperf 3.0.x used "(int)(long)", 3.1 uses "(int)(size_t)", # input: {(int)(size_t)&((struct cf_pool_t *)0)->cf_pool_str3}, # output: {offsetof(struct cf_pool_t, cf_pool_str3)}, -- EW