libc: suppress libcxx's const-correct string overloads
libcxx checks for `defined(__CORRECT_ISO_CPP_STRING_H_PROTO)` before
defining const-correct overloads for common string.h functions. C
libraries should define this if they provide const-correct overloads.
Bug: None
Test: `clang -E` on a TU built with Bionic. No more const-correct
Test: overloads from libcxx.
Change-Id: I3d356c376f7845aadf1b5a56475863c9aea2eb4f
diff --git a/libc/include/string.h b/libc/include/string.h
index 47bdd72..a67df4c 100644
--- a/libc/include/string.h
+++ b/libc/include/string.h
@@ -185,11 +185,10 @@
/* Const-correct overloads. Placed after FORTIFY so we call those functions, if possible. */
#if defined(__cplusplus)
-/*
- * Use two enable_ifs so these overloads don't conflict with + are preferred over libcxx's. This can
- * be reduced to 1 after libcxx recognizes that we have const-correct overloads.
- */
-#define __prefer_this_overload __enable_if(true, "preferred overload") __enable_if(true, "")
+/* libcxx tries to provide these. Suppress that, since libcxx's impl doesn't respect FORTIFY. */
+#define __CORRECT_ISO_CPP_STRING_H_PROTO
+/* Used to make these preferable over regular <string.h> signatures for overload resolution. */
+#define __prefer_this_overload __enable_if(true, "")
extern "C++" {
inline __always_inline
void* _Nullable __bionic_memchr(const void* _Nonnull const s __pass_object_size, int c, size_t n) {