mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
serialization: detect byteswap builtins without autoconf tests
Rather than a complicated set of tests to decide which bswap functions to use, always prefer the compiler built-ins when available. These builtins and fallbacks can all be removed once we're using c++23, which adds std::byteswap.
This commit is contained in:
@@ -16,9 +16,9 @@ BOOST_AUTO_TEST_CASE(bswap_tests)
|
||||
uint16_t e1 = 0x3412;
|
||||
uint32_t e2 = 0xbc9a7856;
|
||||
uint64_t e3 = 0xbc9a78563412f0de;
|
||||
BOOST_CHECK(bswap_16(u1) == e1);
|
||||
BOOST_CHECK(bswap_32(u2) == e2);
|
||||
BOOST_CHECK(bswap_64(u3) == e3);
|
||||
BOOST_CHECK(internal_bswap_16(u1) == e1);
|
||||
BOOST_CHECK(internal_bswap_32(u2) == e2);
|
||||
BOOST_CHECK(internal_bswap_64(u3) == e3);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
Reference in New Issue
Block a user