Skip to content
This repository was archived by the owner on Feb 16, 2026. It is now read-only.

Commit a865812

Browse files
committed
vsha256: Insist that our byte order macros are defined
to avoid errors and confusion as documented in #4226
1 parent 117161c commit a865812

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

lib/libvarnish/vsha256.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@
4040
# define VBIG_ENDIAN __DARWIN_BIG_ENDIAN
4141
#endif
4242

43+
#ifndef VBYTE_ORDER
44+
# error VBYTE_ORDER not defined
45+
#endif
46+
#ifndef VBIG_ENDIAN
47+
# error VBIG_ENDIAN not defined
48+
#endif
49+
50+
4351
#include <sys/types.h>
4452
#include <stdint.h>
4553
#include <string.h>
@@ -50,7 +58,7 @@
5058
#include "vend.h"
5159
#include "vsha256.h"
5260

53-
#if defined(VBYTE_ORDER) && VBYTE_ORDER == VBIG_ENDIAN
61+
#if VBYTE_ORDER == VBIG_ENDIAN
5462

5563
/* Copy a vector of big-endian uint32_t into a vector of bytes */
5664
#define be32enc_vect(dst, src, len) \

0 commit comments

Comments
 (0)