diff mbox

[PATCHv2,1/4] include/odp_byteorder: allow for -std=c99 to be set

Message ID 1399060067-22104-2-git-send-email-anders.roxell@linaro.org
State Accepted
Headers show

Commit Message

Anders Roxell May 2, 2014, 7:47 p.m. UTC
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
---
 include/odp_byteorder.h | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)
diff mbox

Patch

diff --git a/include/odp_byteorder.h b/include/odp_byteorder.h
index c573bb6..80f6081 100644
--- a/include/odp_byteorder.h
+++ b/include/odp_byteorder.h
@@ -22,20 +22,28 @@  extern "C" {
 #include <odp_std_types.h>
 #include <odp_compiler.h>
 
-#ifndef BYTE_ORDER
-#error BYTE_ORDER not defined!
+#ifndef __BYTE_ORDER
+#error __BYTE_ORDER not defined!
+#endif
+
+#ifndef __BIG_ENDIAN
+#error __BIG_ENDIAN not defined!
+#endif
+
+#ifndef __LITTLE_ENDIAN
+#error __LITTLE_ENDIAN not defined!
 #endif
 
 /** Big endian byte order */
-#define ODP_BIG_ENDIAN    BIG_ENDIAN
+#define ODP_BIG_ENDIAN    __BIG_ENDIAN
 
 /** Little endian byte order */
-#define ODP_LITTLE_ENDIAN LITTLE_ENDIAN
+#define ODP_LITTLE_ENDIAN __LITTLE_ENDIAN
 
 /** Selected byte order */
-#if BYTE_ORDER == LITTLE_ENDIAN
+#if __BYTE_ORDER == __LITTLE_ENDIAN
 #define ODP_BYTE_ORDER ODP_LITTLE_ENDIAN
-#elif BYTE_ORDER == BIG_ENDIAN
+#elif __BYTE_ORDER == __BIG_ENDIAN
 #define ODP_BYTE_ORDER ODP_BIG_ENDIAN
 #endif