[CMAKE]
[reactos.git] / lib / rtl / sprintf.c
index a00ff41..5146114 100644 (file)
@@ -1,3 +1,5 @@
+
+#ifndef USE_NEW_SPRINTF
 /*
  * PROGRAMMERS:     David Welch
  *                  Eric Kohl
@@ -226,7 +228,9 @@ numberf(char * buf, char * end, double num, int base, int size, int precision, i
     {
         x = num;
                tmp[i++] = digits[do_div(&x,base)];
+#ifndef _M_ARM // Missing __floatdidf in CeGCC 0.55 -- GCC 4.4
                num=x;
+#endif
     }
        if (i > precision)
                precision = i;
@@ -461,7 +465,10 @@ int __cdecl _vsnprintf(char *buf, size_t cnt, const char *fmt, va_list args)
 
                /* get the conversion qualifier */
                qualifier = -1;
-               if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || *fmt == 'w') {
+        if (*fmt == 'l' && *(fmt+1) == 'l') {
+            qualifier = 'I';
+            fmt += 2;
+               } else if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || *fmt == 'w') {
                        qualifier = *fmt;
                        ++fmt;
                } else if (*fmt == 'I' && *(fmt+1) == '6' && *(fmt+2) == '4') {
@@ -577,7 +584,7 @@ int __cdecl _vsnprintf(char *buf, size_t cnt, const char *fmt, va_list args)
                                flags |= ZEROPAD;
                        }
                        str = number(str, end,
-                               (unsigned long) va_arg(args, void *), 16,
+                               (ULONG_PTR) va_arg(args, void *), 16,
                                field_width, precision, flags);
                        continue;
 
@@ -736,3 +743,5 @@ int __cdecl vsprintf(char *buf, const char *fmt, va_list args)
 }
 
 /* EOF */
+#endif
+