projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ee4f1bc
)
util/u_endian: Add error checks
author
Dylan Baker
<dylan@pnwbakers.com>
Thu, 24 Oct 2019 17:16:15 +0000
(10:16 -0700)
committer
Dylan Baker
<dylan@pnwbakers.com>
Tue, 5 Nov 2019 16:39:55 +0000
(16:39 +0000)
As suggested by Eric Engestrom and Michel Dänzer.
src/util/u_endian.h
patch
|
blob
|
history
diff --git
a/src/util/u_endian.h
b/src/util/u_endian.h
index 4e4ba60ca1da308926974f58d2689f965e2de2c4..fb3eda42c5cdcc325dda77ebc22e4599a358de81 100644
(file)
--- 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