1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-22 17:18:39 +00:00

Fix win32/msvc i18n (quite UGLY version, blame Microsoft)

This commit is contained in:
sapier 2013-11-03 17:28:16 +01:00
parent 0f9440fa61
commit 22a59b3912
17 changed files with 315 additions and 111 deletions

View file

@ -197,6 +197,7 @@ public:
else
data = NULL;
refcount = new unsigned int;
memset(data,0,sizeof(T)*m_size);
(*refcount) = 1;
}
SharedBuffer(const SharedBuffer &buffer)

View file

@ -41,8 +41,9 @@ std::string wide_to_narrow(const std::wstring& wcs)
size_t mbl = wcs.size()*4;
SharedBuffer<char> mbs(mbl+1);
size_t l = wcstombs(*mbs, wcs.c_str(), mbl);
if(l == (size_t)(-1))
mbs[0] = 0;
if(l == (size_t)(-1)) {
return "Character conversion failed!";
}
else
mbs[l] = 0;
return *mbs;