From d05d20e08b3c6435afbecee329d9171105f25652 Mon Sep 17 00:00:00 2001 From: "Kirill A. Korinsky" Date: Thu, 7 Nov 2024 17:58:08 +0100 Subject: [PATCH] Tolerate when endian.h is symlink to sys/endian.h Since 5a60b36fe9b45b68244596d93db2b922d53e7b5c varnish drop support of sys/endian.h and they had a bit different API one or two leading `_`. Some system may have symlink from endian.h to sys/endian.h, for example OpenBSD. On such system build fails due to wrong SHA256 hash. --- lib/libvarnish/vsha256.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/libvarnish/vsha256.c b/lib/libvarnish/vsha256.c index 7e55ec3ad5..29f97fe404 100644 --- a/lib/libvarnish/vsha256.c +++ b/lib/libvarnish/vsha256.c @@ -33,8 +33,16 @@ #ifndef __DARWIN_BYTE_ORDER # include -# define VBYTE_ORDER __BYTE_ORDER -# define VBIG_ENDIAN __BIG_ENDIAN +# ifdef _BYTE_ORDER +# define VBYTE_ORDER _BYTE_ORDER +# else +# define VBYTE_ORDER __BYTE_ORDER +# endif +# ifdef _BIG_ENDIAN +# define VBIG_ENDIAN _BIG_ENDIAN +# else +# define VBIG_ENDIAN __BIG_ENDIAN +# endif #else # define VBYTE_ORDER __DARWIN_BYTE_ORDER # define VBIG_ENDIAN __DARWIN_BIG_ENDIAN