diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-11-17 14:34:40 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-11-17 14:34:40 +0100 |
commit | 31447d58fb761cf1eae81fc3edb23cdd1aa6f1e8 (patch) | |
tree | 3cbb73aa9d1b457231d94ef0739ba2c1fef1e6e1 /Libraries | |
parent | 5f459ee9296a491ee2a67fe758a9a82d8af8dcdf (diff) | |
download | serenity-31447d58fb761cf1eae81fc3edb23cdd1aa6f1e8.zip |
LibC: Add back __bswap{16,32,64}() to endian.h
Diffstat (limited to 'Libraries')
-rw-r--r-- | Libraries/LibC/endian.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Libraries/LibC/endian.h b/Libraries/LibC/endian.h index b84eda9faa..97bb617236 100644 --- a/Libraries/LibC/endian.h +++ b/Libraries/LibC/endian.h @@ -18,6 +18,21 @@ __BEGIN_DECLS #include <stdint.h> +static __inline uint16_t __bswap16(uint16_t x) +{ + return __builtin_bswap16(x); +} + +static __inline uint32_t __bswap32(uint32_t x) +{ + return __builtin_bswap32(x) +} + +static __inline uint64_t __bswap64(uint64_t x) +{ + return __builtin_bswap64(x) +} + #define LITTLE_ENDIAN __LITTLE_ENDIAN #define BIG_ENDIAN __BIG_ENDIAN #define PDP_ENDIAN __PDP_ENDIAN |