mirror of
https://github.com/cculianu/Fulcrum.git
synced 2026-08-13 12:33:27 +02:00
- Added a config test for the __builtin_bswap* functions. And use them if available. - Added templates for: beToH, leToH, hToLe, hToBe. - Added some static assertions to test the endian swap functions
9 lines
300 B
C++
9 lines
300 B
C++
#include <cstdint>
|
|
|
|
int main(int argc, char *[])
|
|
{
|
|
const uint16_t u16 = static_cast<uint16_t>(argc);
|
|
const uint32_t u32 = static_cast<uint32_t>(argc);
|
|
const uint64_t u64 = static_cast<uint64_t>(argc);
|
|
return __builtin_bswap16(u16) + __builtin_bswap32(u32) + __builtin_bswap64(u64);
|
|
}
|