mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2026-07-24 03:56:43 +00:00
2481f2e085
This is only available from C++23, but the implementation is fairly trivial and the old variants of BSWAP32/BSWAP16 were not constexpr on MSVC. This was due to all kinds of intrinsics that were added to get better code. However, recent compilers with reasonable optimisation settings see the naive code and will inject the appropriate optimised code (bswap op on x86-64). For x86-64 recent is: Clang 6+ -O1, GCC 6+ -O2, MSVC 19.34+ /O1.