diff mbox

[ovs-dev,v2,5/5] byte-order: use system ntohll() and htonll() for OS X

Message ID 1458057179-27633-6-git-send-email-lrichard@redhat.com
State Accepted
Headers show

Commit Message

Lance Richardson March 15, 2016, 3:52 p.m. UTC
Avoid collision with system headers when building under OS X.

Signed-off-by: Lance Richardson <lrichard@redhat.com>
---
 Changes from v1: this patch is new in v2.

 lib/byte-order.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Ben Pfaff March 23, 2016, 1:46 a.m. UTC | #1
On Tue, Mar 15, 2016 at 11:52:59AM -0400, Lance Richardson wrote:
> Avoid collision with system headers when building under OS X.
> 
> Signed-off-by: Lance Richardson <lrichard@redhat.com>

Applied, thanks!
diff mbox

Patch

diff --git a/lib/byte-order.h b/lib/byte-order.h
index 3430e29..41c3931 100644
--- a/lib/byte-order.h
+++ b/lib/byte-order.h
@@ -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. */