Remove non-standard memswap.
Change-Id: I06548dda339987b755ef7139c590ca3e1f9fe0a9
diff --git a/libc/bionic/ndk_cruft.cpp b/libc/bionic/ndk_cruft.cpp
index fc9d9d4..b915382 100644
--- a/libc/bionic/ndk_cruft.cpp
+++ b/libc/bionic/ndk_cruft.cpp
@@ -59,4 +59,18 @@
return __get_tls();
}
+// This non-standard function was in our <string.h> for some reason.
+extern "C" void memswap(void* m1, void* m2, size_t n) {
+ char* p = reinterpret_cast<char*>(m1);
+ char* p_end = p + n;
+ char* q = reinterpret_cast<char*>(m2);
+ while (p < p_end) {
+ char tmp = *p;
+ *p = *q;
+ *q = tmp;
+ p++;
+ q++;
+ }
+}
+
#endif