[Clang mangling] Don't mangle when Clang says not to

We have been mangling extern "C" symbols when building with C++
interoperability, leading to incorrectly-mangled names such as
_Z6memset that should have been unmangled "memset". Fix this so we get
consistent mangling between C and C++ interoperability modes.

Fixes rdar://164495210.
This commit is contained in:
Doug Gregor
2025-11-12 22:18:17 -08:00
parent cc78bb5ebf
commit c02811d47b
3 changed files with 22 additions and 1 deletions

View File

@@ -7,6 +7,12 @@
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
typedef __SIZE_TYPE__ size_t;
#endif
void* memcpy(void* s1, const void* s2, size_t n);
void* memmove(void* s1, const void* s2, size_t n);
char* strcpy (char* s1, const char* s2);
@@ -30,4 +36,8 @@ void* memset(void* s, int c, size_t n);
char* strerror(int errnum);
size_t strlen(const char* s);
#ifdef __cplusplus
}
#endif
#endif // SDK_STRING_H