summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2019-10-24 10:16:15 -0700
committerDylan Baker <dylan@pnwbakers.com>2019-11-05 16:39:55 +0000
commit9020f519d2434be33edd59b9205d6647db4472bb (patch)
tree19304d342c132eed5d77a1939bc6499135cdd4ab
parentee4f1bc187536d32c30f4505247750754e27f6e4 (diff)
util/u_endian: Add error checks
As suggested by Eric Engestrom and Michel Dänzer.
-rw-r--r--src/util/u_endian.h6
1 files changed, 6 insertions, 0 deletions
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