From: Dylan Baker Date: Thu, 24 Oct 2019 17:16:15 +0000 (-0700) Subject: util/u_endian: Add error checks X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9020f519d2434be33edd59b9205d6647db4472bb;p=mesa.git util/u_endian: Add error checks As suggested by Eric Engestrom and Michel Dänzer. --- 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