mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-22 07:06:21 +00:00
Drops custom utf16 string implementation (from cdd3317ded), uses C++11 one.
Patch By: sera Differential Revision: https://code.wildfiregames.com/D4223 This was SVN commit r26023.
This commit is contained in:
@@ -24,10 +24,11 @@
|
||||
#include "graphics/Entity.h"
|
||||
#include "lib/file/vfs/vfs_path.h"
|
||||
#include "maths/Vector2D.h"
|
||||
#include "ps/utf16string.h"
|
||||
#include "ps/CLogger.h"
|
||||
#include "ps/CStr.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
// Catch the raised exception right away to ensure the stack trace gets printed.
|
||||
#define FAIL(msg) STMT(ScriptException::Raise(rq, msg); ScriptException::CatchPending(rq); return false)
|
||||
|
||||
@@ -222,8 +223,8 @@ template<> void Script::ToJSVal<u32>(const ScriptRequest& UNUSED(rq), JS::Mutabl
|
||||
|
||||
template<> void Script::ToJSVal<std::wstring>(const ScriptRequest& rq, JS::MutableHandleValue ret, const std::wstring& val)
|
||||
{
|
||||
utf16string utf16(val.begin(), val.end());
|
||||
JS::RootedString str(rq.cx, JS_NewUCStringCopyN(rq.cx, reinterpret_cast<const char16_t*> (utf16.c_str()), utf16.length()));
|
||||
std::u16string utf16(val.begin(), val.end());
|
||||
JS::RootedString str(rq.cx, JS_NewUCStringCopyN(rq.cx, utf16.c_str(), utf16.length()));
|
||||
if (str)
|
||||
ret.setString(str);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user