mirror of
https://github.com/kiwix/libkiwix.git
synced 2026-10-25 02:19:11 -04:00
+ use _strdup on Windows
This commit is contained in:
1 parent
1faca99274
commit
b3c352f71a
1 file changed
+10
@@ -30,7 +30,12 @@ const char *nsStringToCString(const nsAString &str) {
|
||||
#endif
|
||||
|
||||
NS_CStringGetData(tmpStr, &cStr);
|
||||
|
||||
#ifdef _WIN32
|
||||
return _strdup(cStr);
|
||||
#else
|
||||
return strdup(cStr);
|
||||
#endif
|
||||
}
|
||||
|
||||
std::string nsStringToString(const nsEmbedString &str) {
|
||||
@@ -70,5 +75,10 @@ const char *nsStringToUTF8(const nsAString &str) {
|
||||
nsCString tmpStr;
|
||||
CopyUTF16toUTF8(str, tmpStr);
|
||||
NS_CStringGetData(tmpStr, &cStr);
|
||||
|
||||
#ifdef _WIN32
|
||||
return _strdup(cStr);
|
||||
#else
|
||||
return strdup(cStr);
|
||||
#endif
|
||||
}
|
||||
Reference in new issue
Block a user