ruby-changes:46384
From: nobu <ko1@a...>
Date: Fri, 28 Apr 2017 14:08:50 +0900 (JST)
Subject: [ruby-changes:46384] nobu:r58498 (trunk): sprintf.c: ruby_ultoa
nobu 2017-04-28 14:08:44 +0900 (Fri, 28 Apr 2017) New Revision: 58498 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58498 Log: sprintf.c: ruby_ultoa * sprintf.c (ruby_ultoa): prefixed to get rid of conflict with a MSVC library function. Modified files: trunk/sprintf.c Index: sprintf.c =================================================================== --- sprintf.c (revision 58497) +++ sprintf.c (revision 58498) @@ -24,7 +24,7 @@ https://github.com/ruby/ruby/blob/trunk/sprintf.c#L24 #define BIT_DIGITS(N) (((N)*146)/485 + 1) /* log2(10) =~ 146/485 */ static char *fmt_setup(char*,size_t,int,int,int,int); -static char *ultoa(unsigned long val, char *endp, int base, int octzero); +static char *ruby_ultoa(unsigned long val, char *endp, int base, int octzero); static char sign_bits(int base, const char *p) @@ -939,7 +939,7 @@ rb_str_format(int argc, const VALUE *arg https://github.com/ruby/ruby/blob/trunk/sprintf.c#L939 sc = ' '; width--; } - s = ultoa((unsigned long)v, nbuf + sizeof(nbuf), 10, 0); + s = ruby_ultoa((unsigned long)v, nbuf + sizeof(nbuf), 10, 0); len = (int)(nbuf + sizeof(nbuf) - s); } else { @@ -1200,12 +1200,12 @@ fmt_setup(char *buf, size_t size, int c, https://github.com/ruby/ruby/blob/trunk/sprintf.c#L1200 *--buf = c; if (flags & FPREC) { - buf = ultoa(prec, buf, 10, 0); + buf = ruby_ultoa(prec, buf, 10, 0); *--buf = '.'; } if (flags & FWIDTH) { - buf = ultoa(width, buf, 10, 0); + buf = ruby_ultoa(width, buf, 10, 0); } if (flags & FSPACE) *--buf = ' '; @@ -1248,7 +1248,7 @@ fmt_setup(char *buf, size_t size, int c, https://github.com/ruby/ruby/blob/trunk/sprintf.c#L1248 #include "vsnprintf.c" static char * -ultoa(unsigned long val, char *endp, int base, int flags) +ruby_ultoa(unsigned long val, char *endp, int base, int flags) { const char *xdigs = lower_hexdigits; int octzero = flags & FSHARP; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/