From a865812c070bce1c4e6f5946862c994e5c57b9e9 Mon Sep 17 00:00:00 2001 From: Nils Goroll Date: Mon, 18 Nov 2024 14:42:36 +0100 Subject: [PATCH] vsha256: Insist that our byte order macros are defined to avoid errors and confusion as documented in #4226 --- lib/libvarnish/vsha256.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/libvarnish/vsha256.c b/lib/libvarnish/vsha256.c index 6b6f756cb3..7e55ec3ad5 100644 --- a/lib/libvarnish/vsha256.c +++ b/lib/libvarnish/vsha256.c @@ -40,6 +40,14 @@ # define VBIG_ENDIAN __DARWIN_BIG_ENDIAN #endif +#ifndef VBYTE_ORDER +# error VBYTE_ORDER not defined +#endif +#ifndef VBIG_ENDIAN +# error VBIG_ENDIAN not defined +#endif + + #include #include #include @@ -50,7 +58,7 @@ #include "vend.h" #include "vsha256.h" -#if defined(VBYTE_ORDER) && VBYTE_ORDER == VBIG_ENDIAN +#if VBYTE_ORDER == VBIG_ENDIAN /* Copy a vector of big-endian uint32_t into a vector of bytes */ #define be32enc_vect(dst, src, len) \