Ignore:
Timestamp:
Jul 9, 2020, 8:51:43 AM (4 years ago)
Author:
coas-nagasima
Message:

mrubyを2.1.1に更新

Location:
EcnlProtoTool/trunk/mruby-2.1.1
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • EcnlProtoTool/trunk/mruby-2.1.1/mrbgems/mruby-print/src/print.c

    r331 r439  
    11#include <mruby.h>
     2
     3#ifdef MRB_DISABLE_STDIO
     4# error print conflicts 'MRB_DISABLE_STDIO' configuration in your 'build_config.rb'
     5#endif
     6
    27#include <mruby/string.h>
    3 #include <stdio.h>
    48#include <string.h>
    59#include <stdlib.h>
     
    2024    if (isatty(fileno(stdout))) {
    2125      DWORD written;
    22       int mlen = RSTRING_LEN(obj);
     26      int mlen = (int)RSTRING_LEN(obj);
    2327      char* utf8 = RSTRING_PTR(obj);
    2428      int wlen = MultiByteToWideChar(CP_UTF8, 0, utf8, mlen, NULL, 0);
    2529      wchar_t* utf16 = (wchar_t*)mrb_malloc(mrb, (wlen+1) * sizeof(wchar_t));
    26       if (utf16 == NULL) return;
    2730      if (MultiByteToWideChar(CP_UTF8, 0, utf8, mlen, utf16, wlen) > 0) {
    2831        utf16[wlen] = 0;
     
    3437#endif
    3538      fwrite(RSTRING_PTR(obj), RSTRING_LEN(obj), 1, stdout);
     39    fflush(stdout);
    3640  }
    3741}
Note: See TracChangeset for help on using the changeset viewer.