Merge branch 'develop' of github.com:ChaiScript/ChaiScript into develop

This commit is contained in:
Jason Turner 2015-03-21 14:15:06 -06:00
commit 9c1f5b6830
2 changed files with 4 additions and 4 deletions

View File

@ -150,7 +150,7 @@ namespace chaiscript
return std::string(t_str.begin(), t_str.end()); return std::string(t_str.begin(), t_str.end());
} }
#ifdef _UNICODE #if defined(_UNICODE) || defined(UNICODE)
template<typename T> template<typename T>
static std::wstring to_proper_string(const T &t_str) static std::wstring to_proper_string(const T &t_str)
{ {
@ -166,7 +166,7 @@ namespace chaiscript
static std::string get_error_message(DWORD t_err) static std::string get_error_message(DWORD t_err)
{ {
#ifdef _UNICODE #if defined(_UNICODE) || defined(UNICODE)
typedef LPWSTR StringType; typedef LPWSTR StringType;
std::wstring retval = L"Unknown Error"; std::wstring retval = L"Unknown Error";
#else #else

View File

@ -24,7 +24,7 @@ char *mystrdup (const char *s) {
char *d = static_cast<char*>(malloc (len+1)); char *d = static_cast<char*>(malloc (len+1));
if (d == nullptr) return nullptr; // No memory if (d == nullptr) return nullptr; // No memory
#ifdef CHAISCRIPT_MSVC #ifdef CHAISCRIPT_MSVC
strcpy_s(d, len, s); // Copy the characters strcpy_s(d, len+1, s); // Copy the characters
#else #else
strncpy(d,s,len); // Copy the characters strncpy(d,s,len); // Copy the characters
#endif #endif