runtime: use _strdup on Windows

Windows prefers the `_strdup` extension over `strdup`. This avoids
unnecessary warnings when building the standard library.
This commit is contained in:
Saleem Abdulrasool
2024-12-12 10:32:28 -08:00
parent b7485467e9
commit 9e413bd3d2
4 changed files with 13 additions and 5 deletions

View File

@@ -330,7 +330,11 @@ reportOnCrash(uint32_t flags, const char *message)
if (previous)
swift_asprintf(&current, "%s%s", current, message);
else
#if defined(_WIN32)
current = ::_strdup(message);
#else
current = ::strdup(message);
#endif
} while (!std::atomic_compare_exchange_strong_explicit(&kFatalErrorMessage,
&previous,
static_cast<const char *>(current),