diff options
Diffstat (limited to 'implementation/utility/include/byteorder.hpp')
-rw-r--r-- | implementation/utility/include/byteorder.hpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/implementation/utility/include/byteorder.hpp b/implementation/utility/include/byteorder.hpp index ad7f752..deda45c 100644 --- a/implementation/utility/include/byteorder.hpp +++ b/implementation/utility/include/byteorder.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// Copyright (C) 2014-2021 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -6,9 +6,9 @@ #ifndef VSOMEIP_V3_BYTEORDER_HPP #define VSOMEIP_V3_BYTEORDER_HPP -#if defined(LINUX) +#if defined(__linux__) #include <endian.h> -#elif defined(FREEBSD) +#elif defined(__freebsd__) #include <sys/endian.h> #else // TEST IF THERE COULD BE AN ERROR! @@ -38,8 +38,6 @@ #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)) @@ -48,8 +46,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 |