diff options
author | Jack Lloyd <[email protected]> | 2018-11-20 09:37:08 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-11-20 09:37:08 -0500 |
commit | fd2d283eda8f293a4f2bd5f1c33e63a447e24883 (patch) | |
tree | 36500d10fd723c42389bf0034b89c5b4269522d2 /src | |
parent | eea263e826d1d50dc11004eab2afcc312ed4e7e0 (diff) |
Use builtin_bswap16 when available
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/utils/bswap.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/utils/bswap.h b/src/lib/utils/bswap.h index 8d5731f1b..509e911e0 100644 --- a/src/lib/utils/bswap.h +++ b/src/lib/utils/bswap.h @@ -23,7 +23,11 @@ namespace Botan { */ inline uint16_t reverse_bytes(uint16_t val) { +#if defined(BOTAN_BUILD_COMPILER_IS_GCC) || defined(BOTAN_BUILD_COMPILER_IS_CLANG) + return __builtin_bswap16(val); +#else return rotl<8>(val); +#endif } /** |