Skip to content

Commit

Permalink
vsha256: Insist that our byte order macros are defined
Browse files Browse the repository at this point in the history
to avoid errors and confusion as documented in #4226
  • Loading branch information
nigoroll committed Nov 18, 2024
1 parent 117161c commit a865812
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/libvarnish/vsha256.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <sys/types.h>
#include <stdint.h>
#include <string.h>
Expand All @@ -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) \
Expand Down

0 comments on commit a865812

Please sign in to comment.