aboutsummaryrefslogtreecommitdiffstats
path: root/vsnprintf.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-11-24 03:50:03 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-11-24 03:50:03 +0000
commit7329f4e92c90709fe57115f16a8ac9784a51b509 (patch)
tree2039412a02a52cd761e765b64a55f601ffd4f7a4 /vsnprintf.c
parent220d07d2fcf5b8d66327e2c78770448c43c33db5 (diff)
downloadruby-7329f4e92c90709fe57115f16a8ac9784a51b509.tar.gz
* vsnprintf (BSD_vfprintf): added VC++ compatible size specifications
(I, I32, I64). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vsnprintf.c')
-rw-r--r--vsnprintf.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/vsnprintf.c b/vsnprintf.c
index 6778b90d8f..a68b0d05dc 100644
--- a/vsnprintf.c
+++ b/vsnprintf.c
@@ -758,6 +758,24 @@ reswitch: switch (ch) {
flags |= QUADINT;
goto rflag;
#endif /* _HAVE_SANE_QUAD_ */
+#if _WIN32
+ case 'I':
+ if (*fmt == '3' && *(fmt + 1) == '2') {
+ fmt += 2;
+ flags |= LONGINT;
+ }
+ else if (*fmt == '6' && *(fmt + 1) == '4') {
+ fmt += 2;
+ flags |= QUADINT;
+ }
+ else
+#if SIZEOF_SIZE_T == SIZEOF_LONG_LONG
+ flags |= QUADINT;
+#else
+ flags |= LONGINT;
+#endif
+ goto rflag;
+#endif
case 'c':
cp = buf;
*buf = (char)va_arg(ap, int);