summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlutzbichler <52852266+lutzbichler@users.noreply.github.com>2022-03-15 07:16:54 +0100
committerGitHub <noreply@github.com>2022-03-15 07:16:54 +0100
commit36dc5ee2536c82d611d98bd69f59151f50e700ea (patch)
treec1baa871cf62c015521a6710b4477a2d016fe24c
parentb7a73c36b3392ea9aaa7272f4bbd955c7233297c (diff)
parent1dbba36a39294588cd71df1907d2307714f6cabc (diff)
downloadvSomeIP-36dc5ee2536c82d611d98bd69f59151f50e700ea.tar.gz
Merge pull request #320 from alexlarsson/fix-big-endian
Fix big endian support in byteorder.hpp
-rw-r--r--implementation/utility/include/byteorder.hpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/implementation/utility/include/byteorder.hpp b/implementation/utility/include/byteorder.hpp
index ea2dc38..ad7f752 100644
--- a/implementation/utility/include/byteorder.hpp
+++ b/implementation/utility/include/byteorder.hpp
@@ -38,6 +38,8 @@
#define VSOMEIP_BYTES_TO_WORD(x0, x1) (uint16_t((x1) << 8 | (x0)))
#define VSOMEIP_BYTES_TO_LONG(x0, x1, x2, x3) (uint32_t((x3) << 24 | (x2) << 16 | (x1) << 8 | (x0)))
+#define VSOMEIP_WORDS_TO_LONG(x0, x1) (uint32_t((x1) << 16 | (x0)))
+
#define VSOMEIP_WORD_BYTE0(x) (uint8_t((x) >> 8))
#define VSOMEIP_WORD_BYTE1(x) (uint8_t((x) & 0xFF))
@@ -46,8 +48,8 @@
#define VSOMEIP_LONG_BYTE2(x) (uint8_t(((x) >> 8) & 0xFF))
#define VSOMEIP_LONG_BYTE3(x) (uint8_t((x) & 0xFF))
-#define VSOMEIP_LONG_WORD0(x) (uint16_t((((x) >> 16) & 0xFFFF))
-#define VSOMEIP_LONG_WORD1(x) (uint16_t(((x) & 0xFFFF))
+#define VSOMEIP_LONG_WORD0(x) (uint16_t(((x) >> 16) & 0xFFFF))
+#define VSOMEIP_LONG_WORD1(x) (uint16_t((x) & 0xFFFF))
#else