mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user