MCPcopy Create free account
hub / github.com/deathkiller/jazz2-native / ByteSwap32

Function ByteSwap32

Sources/nCine/Base/HashFunctions.cpp:69–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67#endif
68
69 inline std::uint32_t ByteSwap32(std::uint32_t value)
70 {
71#if defined(DEATH_TARGET_MSVC)
72 return _byteswap_ulong(value);
73#elif defined(DEATH_TARGET_APPLE)
74 return _OSSwapInt32(value);
75#elif DEATH_HAS_BUILTIN(__builtin_bswap32) || defined(DEATH_TARGET_GCC)
76 return __builtin_bswap32(value);
77#else
78 return (((value & std::uint32_t{0xFF}) << 24) |
79 ((value & std::uint32_t{0xFF00}) << 8) |
80 ((value & std::uint32_t{0xFF0000}) >> 8) |
81 ((value & std::uint32_t{0xFF000000}) >> 24));
82#endif
83 }
84
85 inline std::uint64_t ByteSwap64(std::uint64_t value)
86 {

Callers 1

CityHash32Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected