Ticket #2041: ugly_patch_to_compile_ruby.diff

File ugly_patch_to_compile_ruby.diff, 666 bytes (added by oco, 16 years ago)
  • mbrtowc.c

     
    3535size_t
    3636__mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
    3737{
     38    // ToDo: this is a dummy implementation to get it going
     39    if (s == NULL)
     40        n = 1, s = "";
     41
     42    if (n == 0)
     43        return 0;
     44
     45    if (pwc == NULL)
     46        return strlen(s);
     47 
     48    if (ps == NULL)
     49        ps = &state;
     50 
     51    pwc[0] = s[0];
     52    return s[0] == 0 ? 0 : 1;
     53#if 0
    3854  wchar_t buf[1];
    3955  struct __gconv_step_data data;
    4056  int status;
     
    103119    }
    104120
    105121  return result;
     122#endif
    106123}
    107124weak_alias (__mbrtowc, mbrtowc)