From 9020f519d2434be33edd59b9205d6647db4472bb Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Thu, 24 Oct 2019 10:16:15 -0700 Subject: [PATCH] util/u_endian: Add error checks MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit As suggested by Eric Engestrom and Michel Dänzer. --- src/util/u_endian.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/util/u_endian.h b/src/util/u_endian.h index 4e4ba60ca1d..fb3eda42c5c 100644 --- a/src/util/u_endian.h +++ b/src/util/u_endian.h @@ -80,4 +80,10 @@ #endif +#if !defined(UTIL_ARCH_LITTLE_ENDIAN) || !defined(UTIL_ARCH_BIG_ENDIAN) +# error "UTIL_ARCH_LITTLE_ENDIAN and/or UTIL_ARCH_BIG_ENDIAN were unset." +#elif UTIL_ARCH_LITTLE_ENDIAN == UTIL_ARCH_BIG_ENDIAN +# error "UTIL_ARCH_LITTLE_ENDIAN and UTIL_ARCH_BIG_ENDIAN must not both be 1 or 0." +#endif + #endif -- 2.30.2