Fix for Windows-specific mruby C++ issues

This commit is contained in:
Tomasz Dąbrowski
2016-11-23 12:03:05 +01:00
committed by Yukihiro "Matz" Matsumoto
parent 44c3859a97
commit c2a60eb8af
+1 -1
View File
@@ -22,7 +22,7 @@ printstr(mrb_state *mrb, mrb_value obj)
int mlen = RSTRING_LEN(obj);
char* utf8 = RSTRING_PTR(obj);
int wlen = MultiByteToWideChar(CP_UTF8, 0, utf8, mlen, NULL, 0);
wchar_t* utf16 = mrb_malloc(mrb, (wlen+1) * sizeof(wchar_t));
wchar_t* utf16 = (wchar_t*)mrb_malloc(mrb, (wlen+1) * sizeof(wchar_t));
if (utf16 == NULL) return;
if (MultiByteToWideChar(CP_UTF8, 0, utf8, mlen, utf16, wlen) > 0) {
utf16[wlen] = 0;