unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: unicorn-public@bogomips.org
Subject: [PATCH 4/3] http: gperf 3.0.3 compatibility
Date: Fri, 5 Jul 2019 20:30:01 +0000	[thread overview]
Message-ID: <20190705203001.fmblz3v4tnhpywdb@dcvr> (raw)
In-Reply-To: <20190704220108.7849-1-e@80x24.org>

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

      parent reply	other threads:[~2019-07-05 20:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-04 22:01 [PATCH 0/3] http: use gperf for common field memoization Eric Wong
2019-07-04 22:01 ` [PATCH 1/3] unit benchmark for our HTTP parser Eric Wong
2019-07-04 22:01 ` [PATCH 2/3] http: use gperf for common fields optimization Eric Wong
2019-07-04 22:01 ` [PATCH 3/3] http: memoize more common fields Eric Wong
2019-07-05 20:30 ` Eric Wong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://yhbt.net/unicorn/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190705203001.fmblz3v4tnhpywdb@dcvr \
    --to=e@80x24.org \
    --cc=unicorn-public@bogomips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhbt.net/unicorn.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).