From: Junio C Hamano Date: Tue, 18 Aug 2009 17:05:59 GMT Subject: Re: [PATCH] block-sha1: Windows declares ntohl() in winsock2.h Message-ID: <7vpratdpc8.fsf@alter.siamese.dyndns.org> In-Reply-To: Sebastian Schuberth writes: > 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 ;-)