[master] 2fbac3f Cope with systems having both <sys/endian.h> and <endian.h>

Poul-Henning Kamp phk at FreeBSD.org
Mon May 12 13:30:13 CEST 2014


commit 2fbac3f212d858a55fe3ad11848fb2bfbee65671
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon May 12 11:29:46 2014 +0000

    Cope with systems having both <sys/endian.h> and <endian.h>
    
    Fixes:	1476

diff --git a/lib/libvarnish/vsha256.c b/lib/libvarnish/vsha256.c
index 6642d9f..90ac3ed 100644
--- a/lib/libvarnish/vsha256.c
+++ b/lib/libvarnish/vsha256.c
@@ -28,18 +28,17 @@
 
 #include "config.h"
 
-#ifdef HAVE_SYS_ENDIAN_H
-#include <sys/types.h>
-#include <sys/endian.h>
-#define VBYTE_ORDER	_BYTE_ORDER
-#define VBIG_ENDIAN	_BIG_ENDIAN
+#if defined(HAVE_SYS_ENDIAN_H)
+#  include <sys/types.h>
+#  include <sys/endian.h>
+#  define VBYTE_ORDER	_BYTE_ORDER
+#  define VBIG_ENDIAN	_BIG_ENDIAN
+#elif defined(HAVE_ENDIAN_H)
+#  include <endian.h>
+#  define VBYTE_ORDER	__BYTE_ORDER
+#  define VBIG_ENDIAN	__BIG_ENDIAN
 #endif
 
-#ifdef HAVE_ENDIAN_H
-#include <endian.h>
-#define VBYTE_ORDER	__BYTE_ORDER
-#define VBIG_ENDIAN	__BIG_ENDIAN
-#endif
 #include <errno.h>
 #include <stdint.h>
 #include <string.h>



More information about the varnish-commit mailing list