aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2021-07-15 13:46:34 +0100
committerMichael Brown <mcb30@ipxe.org>2021-07-15 14:16:17 +0100
commit8d08300ad945988e0ce2fc24a34c19613154bae5 (patch)
treea22a67f4708889adc21d31eaa9d881438057fd2a
parent2690f730961e335875cac5fd9cf870a94eaef11a (diff)
downloadipxe-8d08300ad945988e0ce2fc24a34c19613154bae5.zip
ipxe-8d08300ad945988e0ce2fc24a34c19613154bae5.tar.gz
ipxe-8d08300ad945988e0ce2fc24a34c19613154bae5.tar.bz2
[libc] Allow for externally-defined LITTLE_ENDIAN and BIG_ENDIAN constants
When building the Linux userspace binaries, the external system headers may have already defined values for the __LITTLE_ENDIAN and __BIG_ENDIAN constants. Fix by retaining the existing values if already defined, since the actual values of these constants do not matter. Signed-off-by: Michael Brown <mcb30@ipxe.org>
-rw-r--r--src/include/endian.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/include/endian.h b/src/include/endian.h
index 79c3163..bdae9de 100644
--- a/src/include/endian.h
+++ b/src/include/endian.h
@@ -8,14 +8,18 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
* Little-endian systems should define BYTE_ORDER as LITTLE_ENDIAN.
* This constant is intended to be used only at compile time.
*/
+#ifndef __LITTLE_ENDIAN
#define __LITTLE_ENDIAN 0x44332211UL
+#endif
/** Constant representing big-endian byte order
*
* Big-endian systems should define BYTE_ORDER as BIG_ENDIAN.
* This constant is intended to be used only at compile time.
*/
+#ifndef __BIG_ENDIAN
#define __BIG_ENDIAN 0x11223344UL
+#endif
#include "bits/endian.h"