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:
parent
c1208cbe97
commit
cc4a7fa75d
@ -41,9 +41,7 @@ int getsockdomain(int sock);
|
|||||||
#define NET_SOFTERROR -1
|
#define NET_SOFTERROR -1
|
||||||
#define NET_HARDERROR -2
|
#define NET_HARDERROR -2
|
||||||
|
|
||||||
unsigned long long htonll(unsigned long long);
|
#ifndef htonll
|
||||||
unsigned long long ntohll(unsigned long long);
|
|
||||||
|
|
||||||
/* XXX: Need a better check for byte order */
|
/* XXX: Need a better check for byte order */
|
||||||
#if BYTE_ORDER == BIG_ENDIAN
|
#if BYTE_ORDER == BIG_ENDIAN
|
||||||
#define HTONLL(n) (n)
|
#define HTONLL(n) (n)
|
||||||
@ -72,3 +70,4 @@ unsigned long long ntohll(unsigned long long);
|
|||||||
#define ntohll(n) NTOHLL(n)
|
#define ntohll(n) NTOHLL(n)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user