summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-11-17 14:34:40 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-11-17 14:34:40 +0100
commit31447d58fb761cf1eae81fc3edb23cdd1aa6f1e8 (patch)
tree3cbb73aa9d1b457231d94ef0739ba2c1fef1e6e1 /Libraries
parent5f459ee9296a491ee2a67fe758a9a82d8af8dcdf (diff)
downloadserenity-31447d58fb761cf1eae81fc3edb23cdd1aa6f1e8.zip
LibC: Add back __bswap{16,32,64}() to endian.h
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibC/endian.h15
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