Merge branch 'master' of ssh://git.code.sf.net/p/kiwix/kiwix

This commit is contained in:
rgaudin 2014-05-16 02:09:03 +00:00
commit 7d3d54d01e
2 changed files with 14 additions and 0 deletions

View File

@ -30,7 +30,12 @@ const char *nsStringToCString(const nsAString &str) {
#endif #endif
NS_CStringGetData(tmpStr, &cStr); NS_CStringGetData(tmpStr, &cStr);
#ifdef _WIN32
return _strdup(cStr);
#else
return strdup(cStr); return strdup(cStr);
#endif
} }
std::string nsStringToString(const nsEmbedString &str) { std::string nsStringToString(const nsEmbedString &str) {
@ -70,5 +75,10 @@ const char *nsStringToUTF8(const nsAString &str) {
nsCString tmpStr; nsCString tmpStr;
CopyUTF16toUTF8(str, tmpStr); CopyUTF16toUTF8(str, tmpStr);
NS_CStringGetData(tmpStr, &cStr); NS_CStringGetData(tmpStr, &cStr);
#ifdef _WIN32
return _strdup(cStr);
#else
return strdup(cStr); return strdup(cStr);
#endif
} }

View File

@ -20,6 +20,10 @@
#ifndef KIWIX_COMPONENTTOOLS_H #ifndef KIWIX_COMPONENTTOOLS_H
#define KIWIX_COMPONENTTOOLS_H #define KIWIX_COMPONENTTOOLS_H
#ifdef _WIN32
#include <mozilla/Char16.h>
#endif
#include<string> #include<string>
#ifdef __APPLE__ #ifdef __APPLE__