mirror of https://github.com/kiwix/libkiwix.git
+ use _strdup on Windows
This commit is contained in:
parent
1faca99274
commit
b3c352f71a
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue