Make swab(3) inline prior to API 28.
Test: make checkbuild
Bug: https://stackoverflow.com/q/54392471/632035
Change-Id: Iaeb55231ea2395d7e1e31be63034f5db19025060
diff --git a/libc/bionic/swab.cpp b/libc/bionic/swab.cpp
index bc53ba4..59e1c0f 100644
--- a/libc/bionic/swab.cpp
+++ b/libc/bionic/swab.cpp
@@ -28,14 +28,5 @@
#include <unistd.h>
-void swab(const void* void_src, void* void_dst, ssize_t byte_count) {
- const uint8_t* src = static_cast<const uint8_t*>(void_src);
- uint8_t* dst = static_cast<uint8_t*>(void_dst);
- while (byte_count > 1) {
- uint8_t x = *src++;
- uint8_t y = *src++;
- *dst++ = y;
- *dst++ = x;
- byte_count -= 2;
- }
-}
+#define __BIONIC_SWAB_INLINE /* Out of line. */
+#include <bits/swab.h>