Commit 5468b5b4 authored by Alessio Netti's avatar Alessio Netti
Browse files

Fixing BOOST endianness bugs

- Fixing a bug that caused endianness detection to not work properly
after switching to the new BOOST macros, causing dcdbquery and other
tools to break
parent 135a79f7
......@@ -71,9 +71,9 @@ public:
}
static inline uint16_t hostToBE(uint16_t x) {
#if defined BOOST_ENDIAN_BIG_BYTE
#if BOOST_ENDIAN_BIG_BYTE
return x;
#elif defined BOOST_ENDIAN_LITTLE_BYTE
#elif BOOST_ENDIAN_LITTLE_BYTE
return swap(x);
#else
# error Endianess of host is undefined!
......@@ -81,9 +81,9 @@ public:
}
static inline uint32_t hostToBE(uint32_t x) {
#if defined BOOST_ENDIAN_BIG_BYTE
#if BOOST_ENDIAN_BIG_BYTE
return x;
#elif defined BOOST_ENDIAN_LITTLE_BYTE
#elif BOOST_ENDIAN_LITTLE_BYTE
return swap(x);
#else
# error Endianess of host is undefined!
......@@ -91,9 +91,9 @@ public:
}
static inline uint64_t hostToBE(uint64_t x) {
#if defined BOOST_ENDIAN_BIG_BYTE
#if BOOST_ENDIAN_BIG_BYTE
return x;
#elif defined BOOST_ENDIAN_LITTLE_BYTE
#elif BOOST_ENDIAN_LITTLE_BYTE
return swap(x);
#else
# error Endianess of host is undefined!
......@@ -101,9 +101,9 @@ public:
}
static inline uint16_t hostToLE(uint16_t x) {
#if defined BOOST_ENDIAN_BIG_BYTE
#if BOOST_ENDIAN_BIG_BYTE
return swap(x);
#elif defined BOOST_ENDIAN_LITTLE_BYTE
#elif BOOST_ENDIAN_LITTLE_BYTE
return x;
#else
# error Endianess of host is undefined!
......@@ -111,9 +111,9 @@ public:
}
static inline uint32_t hostToLE(uint32_t x) {
#if defined BOOST_ENDIAN_BIG_BYTE
#if BOOST_ENDIAN_BIG_BYTE
return swap(x);
#elif defined BOOST_ENDIAN_LITTLE_BYTE
#elif BOOST_ENDIAN_LITTLE_BYTE
return x;
#else
# error Endianess of host is undefined!
......@@ -121,9 +121,9 @@ public:
}
static inline uint64_t hostToLE(uint64_t x) {
#if defined BOOST_ENDIAN_BIG_BYTE
#if BOOST_ENDIAN_BIG_BYTE
return swap(x);
#elif defined BOOST_ENDIAN_LITTLE_BYTE
#elif BOOST_ENDIAN_LITTLE_BYTE
return x;
#else
# error Endianess of host is undefined!
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment