1515
1616namespace Enigma {
1717
18- constexpr std::uint64_t BSwap64 (std::uint64_t host_int) {
18+ inline std::uint64_t BSwap64 (std::uint64_t host_int) {
1919#if defined(__GNUC__) || ENIGMA_HAVE_BUILTIN(__builtin_bswap64)
2020 return __builtin_bswap64 (host_int);
2121#elif defined(_MSC_VER)
@@ -32,7 +32,7 @@ namespace Enigma {
3232#endif
3333 }
3434
35- constexpr std::uint32_t BSwap32 (std::uint32_t host_int) {
35+ inline std::uint32_t BSwap32 (std::uint32_t host_int) {
3636#if defined(__GNUC__) || ENIGMA_HAVE_BUILTIN(__builtin_bswap32)
3737 return __builtin_bswap32 (host_int);
3838#elif defined(_MSC_VER)
@@ -45,7 +45,7 @@ namespace Enigma {
4545#endif
4646 }
4747
48- constexpr std::uint16_t BSwap16 (std::uint16_t host_int) {
48+ inline std::uint16_t BSwap16 (std::uint16_t host_int) {
4949#if defined(__GNUC__) || ENIGMA_HAVE_BUILTIN(__builtin_bswap16)
5050 return __builtin_bswap16 (host_int);
5151#elif defined(_MSC_VER)
@@ -58,48 +58,48 @@ namespace Enigma {
5858
5959 namespace LittleEndian {
6060
61- constexpr std::uint16_t fromHost (std::uint16_t value) {
62- if constexpr (std::endian::native == std::endian::big) {
61+ inline std::uint16_t fromHost (std::uint16_t value) {
62+ if (std::endian::native == std::endian::big) {
6363 return BSwap16 (value);
6464 } else {
6565 return value;
6666 }
6767 }
6868
69- constexpr std::uint32_t fromHost (std::uint32_t value) {
70- if constexpr (std::endian::native == std::endian::big) {
69+ inline std::uint32_t fromHost (std::uint32_t value) {
70+ if (std::endian::native == std::endian::big) {
7171 return BSwap32 (value);
7272 } else {
7373 return value;
7474 }
7575 }
7676
77- constexpr std::uint64_t fromHost (std::uint64_t value) {
78- if constexpr (std::endian::native == std::endian::big) {
77+ inline std::uint64_t fromHost (std::uint64_t value) {
78+ if (std::endian::native == std::endian::big) {
7979 return BSwap64 (value);
8080 } else {
8181 return value;
8282 }
8383 }
8484
85- constexpr std::uint16_t toHost (std::uint16_t value) {
86- if constexpr (std::endian::native == std::endian::big) {
85+ inline std::uint16_t toHost (std::uint16_t value) {
86+ if (std::endian::native == std::endian::big) {
8787 return BSwap16 (value);
8888 } else {
8989 return value;
9090 }
9191 }
9292
93- constexpr std::uint32_t toHost (std::uint32_t value) {
94- if constexpr (std::endian::native == std::endian::big) {
93+ inline std::uint32_t toHost (std::uint32_t value) {
94+ if (std::endian::native == std::endian::big) {
9595 return BSwap32 (value);
9696 } else {
9797 return value;
9898 }
9999 }
100100
101- constexpr std::uint64_t toHost (std::uint64_t value) {
102- if constexpr (std::endian::native == std::endian::big) {
101+ inline std::uint64_t toHost (std::uint64_t value) {
102+ if (std::endian::native == std::endian::big) {
103103 return BSwap64 (value);
104104 } else {
105105 return value;
@@ -110,48 +110,48 @@ namespace Enigma {
110110
111111 // [[maybe_unused]]
112112 namespace BigEndian {
113- constexpr std::uint16_t fromHost (std::uint16_t value) {
114- if constexpr (std::endian::native == std::endian::big) {
113+ inline std::uint16_t fromHost (std::uint16_t value) {
114+ if (std::endian::native == std::endian::big) {
115115 return value;
116116 } else {
117117 return BSwap16 (value);
118118 }
119119 }
120120
121- constexpr std::uint32_t fromHost (std::uint32_t value) {
122- if constexpr (std::endian::native == std::endian::big) {
121+ inline std::uint32_t fromHost (std::uint32_t value) {
122+ if (std::endian::native == std::endian::big) {
123123 return value;
124124 } else {
125125 return BSwap32 (value);
126126 }
127127 }
128128
129- constexpr std::uint64_t fromHost (std::uint64_t value) {
130- if constexpr (std::endian::native == std::endian::big) {
129+ inline std::uint64_t fromHost (std::uint64_t value) {
130+ if (std::endian::native == std::endian::big) {
131131 return value;
132132 } else {
133133 return BSwap64 (value);
134134 }
135135 }
136136
137- constexpr std::uint16_t toHost (std::uint16_t value) {
138- if constexpr (std::endian::native == std::endian::big) {
137+ inline std::uint16_t toHost (std::uint16_t value) {
138+ if (std::endian::native == std::endian::big) {
139139 return value;
140140 } else {
141141 return BSwap16 (value);
142142 }
143143 }
144144
145- constexpr std::uint32_t toHost (std::uint32_t value) {
146- if constexpr (std::endian::native == std::endian::big) {
145+ inline std::uint32_t toHost (std::uint32_t value) {
146+ if (std::endian::native == std::endian::big) {
147147 return value;
148148 } else {
149149 return BSwap32 (value);
150150 }
151151 }
152152
153- constexpr std::uint64_t toHost (std::uint64_t value) {
154- if constexpr (std::endian::native == std::endian::big) {
153+ inline std::uint64_t toHost (std::uint64_t value) {
154+ if (std::endian::native == std::endian::big) {
155155 return value;
156156 } else {
157157 return BSwap64 (value);
0 commit comments