Re: [PATCH] list: avoid incompatibility with *BSD sys/queue.h
- From
- Eric Wong <e@80x24.org>
- Date
- Jul 17, 2016, 23:07 UTC
- Message-ID
- <20160717230718.GA8569@starla>
- In-Reply-To
- <CAPig+cRvhbKwr=QJAyp=sYLLGDx-B2EHovHpn8Z1701stQMi1g@mail.gmail.com>
Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 17 quoted lines
> On Sat, Jul 16, 2016 at 8:25 PM, Eric Wong <e@80x24.org> wrote: > > Eric Wong <e@80x24.org> wrote: > >> I also wonder where we use sys/queue.h, since I use > >> LIST_HEAD from ccan/list/list.h in a different project > >> without conflicts... > > > > Still wondering... Checking sys/mman.h in an old FreeBSD source > > tree I had lying around reveals "#include <sys/queue.h>" is > > guarded by "#if defined(_KERNEL)", so it mman.h wouldn't pull > > it in for userspace builds... > > It's pulled in like this: > > git-compat-util.h -> > sys/sysctl.h -> > sys/ucred.h -> > sys/queue.h
Ah, thanks (and I've been sidetracked into using FreeBSD again :>)
> Very reminiscent of [1]. > > [1]: http://git.661346.n2.nabble.com/PATCH-ewah-bitmap-silence-warning-about-MASK-macro-redefinition-td7632287.html
Alright. In this case, I think "LIST_HEAD" is sufficiently descriptive compared to more-generically named "MASK" or "BLOCK" that it's harmless to "#undef LIST_HEAD" here without worrying about conflicts or breaking outside code.