- Timestamp:
- Jan 21, 2018, 12:10:09 AM (6 years ago)
- Location:
- EcnlProtoTool/trunk/mruby-1.3.0
- Files:
-
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
EcnlProtoTool/trunk/mruby-1.3.0/mrbgems/mruby-print/src/print.c
r321 r331 1 #include "mruby.h"2 #include "mruby/string.h"1 #include <mruby.h> 2 #include <mruby/string.h> 3 3 #include <stdio.h> 4 4 #include <string.h> 5 5 #include <stdlib.h> 6 #if defined(_ _MINGW32__) || defined(__MINGW64__)6 #if defined(_WIN32) 7 7 # include <windows.h> 8 8 # include <io.h> 9 #ifdef _MSC_VER 10 # define isatty(x) _isatty(x) 11 # define fileno(x) _fileno(x) 12 #endif 9 13 #endif 10 14 … … 13 17 { 14 18 if (mrb_string_p(obj)) { 15 #if defined(_ _MINGW32__) || defined(__MINGW64__)19 #if defined(_WIN32) 16 20 if (isatty(fileno(stdout))) { 17 21 DWORD written; … … 19 23 char* utf8 = RSTRING_PTR(obj); 20 24 int wlen = MultiByteToWideChar(CP_UTF8, 0, utf8, mlen, NULL, 0); 21 wchar_t* utf16 = mrb_malloc(mrb, (wlen+1) * sizeof(wchar_t));25 wchar_t* utf16 = (wchar_t*)mrb_malloc(mrb, (wlen+1) * sizeof(wchar_t)); 22 26 if (utf16 == NULL) return; 23 27 if (MultiByteToWideChar(CP_UTF8, 0, utf8, mlen, utf16, wlen) > 0) {
Note:
See TracChangeset
for help on using the changeset viewer.