util/u_endian: Add error checks

As suggested by Eric Engestrom and Michel Dänzer.
This commit is contained in:
Dylan Baker
2019-10-24 10:16:15 -07:00
parent ee4f1bc187
commit 9020f519d2

View File

@@ -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