]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix compile on BSD
authorRoy Marples <roy@marples.name>
Fri, 12 Jun 2015 20:51:22 +0000 (20:51 +0000)
committerRoy Marples <roy@marples.name>
Fri, 12 Jun 2015 20:51:22 +0000 (20:51 +0000)
ipv4.h

diff --git a/ipv4.h b/ipv4.h
index fa5589608c1ac7f2080ae3f9117f2f05e18e6993..9c8422302c7278530d9a4ec1d58d9cfe47afad34 100644 (file)
--- a/ipv4.h
+++ b/ipv4.h
         (IN_IFF_TENTATIVE | IN_IFF_DUPLICATED | IN_IFF_DETACHED)
 #endif
 
-#ifndef HTONL
+/* Prefer our macro */
+#ifdef HTONL
+#undef HTONL
+#endif
+
 #if BYTE_ORDER == BIG_ENDIAN
 #define HTONL(A) (A)
 #elif BYTE_ORDER == LITTLE_ENDIAN
     (((uint32_t)(A) & 0x00ff0000) >> 8) | \
     (((uint32_t)(A) & 0x0000ff00) << 8) | \
     (((uint32_t)(A) & 0x000000ff) << 24))
-#endif
 #else
 #error Endian unknown
-#endif /* HTONL */
+#endif /* BYTE_ORDER */
 
 struct rt {
        TAILQ_ENTRY(rt) next;