Mesa (master): util/u_endian: Add error checks
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Nov 5 16:40:24 UTC 2019
Module: Mesa
Branch: master
Commit: 9020f519d2434be33edd59b9205d6647db4472bb
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9020f519d2434be33edd59b9205d6647db4472bb
Author: Dylan Baker <dylan at pnwbakers.com>
Date: Thu Oct 24 10:16:15 2019 -0700
util/u_endian: Add error checks
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
More information about the mesa-commit
mailing list