byte-order: use system ntohll() and htonll() for OS X
authorLance Richardson <lrichard@redhat.com>
Tue, 15 Mar 2016 15:52:59 +0000 (11:52 -0400)
committerBen Pfaff <blp@ovn.org>
Wed, 23 Mar 2016 01:45:22 +0000 (18:45 -0700)
Avoid collision with system headers when building under OS X.

Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
lib/byte-order.h

index 3430e29..41c3931 100644 (file)
@@ -22,7 +22,7 @@
 #include "openvswitch/types.h"
 
 #ifndef __CHECKER__
-#ifndef _WIN32
+#if !(defined(_WIN32) || defined(__MACH__))
 static inline ovs_be64
 htonll(uint64_t n)
 {
@@ -34,7 +34,7 @@ ntohll(ovs_be64 n)
 {
     return htonl(1) == 1 ? n : ((uint64_t) ntohl(n) << 32) | ntohl(n >> 32);
 }
-#endif /* _WIN32 */
+#endif /* !(defined(_WIN32) || defined(__MACH__)) */
 #else
 /* Making sparse happy with these functions also makes them unreadable, so
  * don't bother to show it their implementations. */