Re: [PATCH] block-sha1: Windows declares ntohl() in winsock2.h
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 18, 2009, 17:05 UTC
- Message-ID
- <7vpratdpc8.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <bdca99240908180959h69f37671k4d526fbf4814e8d1@mail.gmail.com>
Sebastian Schuberth <sschuberth@gmail.com> writes:
Show 6 quoted lines
> I like the idea of making bswap available more globally, but I'm not > sure if it's worth to introduce a new file for only that purpose. > Isn't there already a central header for such things? > > Moreover, including compat/bswap.h would only give you ntohl()/htonl() > on one platform.
We do not include compat/ directly from the source; git-compat-util.h is supposed to be the first thing included (as some platforms have peculiar requirements on the order in which system header files are included, and one of the reasons git-compat-util.h is there). Hence by including it, you get ntohl/htonl everywhere.
To reduce confusion, you may want to rename compat/bswap.h to something like compat/ntohl-htonl-fix.h ;-)