Re: [PATCH] Fixed compilation with Visual Studio by including poll.h
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 20, 2012, 21:51 UTC
- Message-ID
- <xmqqty0ekr5t.fsf@junio.mtv.corp.google.com>
- In-Reply-To
- <20120420204722.GD13103@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 6 quoted lines
> On Fri, Apr 20, 2012 at 10:37:19PM +0200, Sven Strickroth wrote: > >> upload-archive.c and upload-pack.c use pollfd struct and POLLIN constant >> which are defined in poll.h. However, poll.h is not included. > > This should already be included by git-compat-util.h:
Thanks for a bit of sanity.
Show 11 quoted lines
> $ grep -C1 poll.h git-compat-util.h > #ifndef NO_SYS_POLL_H > #include <sys/poll.h> > #else > #include <poll.h> > #endif > > It looks like we will prefer sys/poll.h if it exists. The official XSI > location is "poll.h", but I guess in practice they are equivalent on > most systems if you have both (certainly on Linux, poll.h just includes > sys/poll.h).
There actually is no preference between the two from _our_ side. It is up to the builder to know and define necessary make variables.
> Does your environments have a sys/poll.h that exists isn't sufficient to > use poll? Maybe we need to tweak git-compat-util to include both if they > both exist.
Both? I guess, but I suspect that on most sane systems one would include the other if there are both provided (iow, just so that you can complile sources written both for XSI and for systems in the field).