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

@@ -84,7 +84,11 @@ private:
static char *getCString(char *str) { return str; }
static char *getCString(const std::string &str) {
#if defined(_WIN32)
return _strdup(str.c_str());
#else
return strdup(str.c_str());
#endif
}
public: