Fix build on MacOS X Yosemite.

The problem is that Yosemite defines htonll as a macro, and we
don't deal properly with the case that it's already been
defined.  Instead we only implement our definition of it if this
macro doesn't already exist, on the assumption that anything called
htonll() will actually do the expected thing.

Direct commit to the 3.0-STABLE branch; this issue does not exist
on the master codeline.

Fixes #213.
This commit is contained in:
Bruce A. Mah 2014-10-22 15:14:15 -07:00
parent c1208cbe97
commit cc4a7fa75d

View File

@ -41,9 +41,7 @@ int getsockdomain(int sock);
#define NET_SOFTERROR -1
#define NET_HARDERROR -2
unsigned long long htonll(unsigned long long);
unsigned long long ntohll(unsigned long long);
#ifndef htonll
/* XXX: Need a better check for byte order */
#if BYTE_ORDER == BIG_ENDIAN
#define HTONLL(n) (n)
@ -72,3 +70,4 @@ unsigned long long ntohll(unsigned long long);
#define ntohll(n) NTOHLL(n)
#endif
#endif