[CRT] Implement the missing CRT _sc(w)printf() functions. CORE-14497
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Fri, 23 Mar 2018 21:30:18 +0000 (22:30 +0100)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Fri, 23 Mar 2018 21:30:18 +0000 (22:30 +0100)
dll/win32/msvcrt/msvcrt.spec
sdk/lib/crt/crt.cmake
sdk/lib/crt/printf/_scprintf.c [new file with mode: 0644]
sdk/lib/crt/printf/_scwprintf.c [new file with mode: 0644]

index 368c97e..202bf7e 100644 (file)
 @ cdecl -arch=i386 _safe_fprem()
 @ cdecl -arch=i386 _safe_fprem1()
 @ cdecl _scalb(double long)
-# stub _scprintf
-# stub _scwprintf
+@ varargs _scprintf(str)
+@ varargs _scwprintf(wstr)
 @ cdecl _searchenv(str str ptr)
 @ stdcall -i386 _seh_longjmp_unwind(ptr)
 # stub _set_SSE2_enable
index 66c5b52..a6a7e5d 100644 (file)
@@ -135,6 +135,8 @@ list(APPEND CRT_SOURCE
     misc/tls.c
     printf/_cprintf.c
     printf/_cwprintf.c
+    printf/_scprintf.c
+    printf/_scwprintf.c
     printf/_snprintf.c
     printf/_snprintf_s.c
     printf/_snwprintf.c
diff --git a/sdk/lib/crt/printf/_scprintf.c b/sdk/lib/crt/printf/_scprintf.c
new file mode 100644 (file)
index 0000000..9eb30ca
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * COPYRIGHT:       GNU GPL, see COPYING in the top level directory
+ * PROJECT:         ReactOS crt library
+ * FILE:            lib/sdk/crt/printf/_scprintf.c
+ * PURPOSE:         Implementation of _scprintf
+ */
+
+#include <stdio.h>
+#include <stdarg.h>
+
+int
+__cdecl
+_scprintf(
+    const char *format,
+    ...)
+{
+    int len;
+    va_list args;
+
+    va_start(args, format);
+    len = _vscprintf(format, args);
+    va_end(args);
+
+    return len;
+}
diff --git a/sdk/lib/crt/printf/_scwprintf.c b/sdk/lib/crt/printf/_scwprintf.c
new file mode 100644 (file)
index 0000000..78c4c9e
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * COPYRIGHT:       GNU GPL, see COPYING in the top level directory
+ * PROJECT:         ReactOS crt library
+ * FILE:            lib/sdk/crt/printf/_scwprintf.c
+ * PURPOSE:         Implementation of _scwprintf
+ */
+
+#include <stdio.h>
+#include <stdarg.h>
+
+int
+__cdecl
+_scwprintf(
+    const wchar_t *format,
+    ...)
+{
+    int len;
+    va_list args;
+
+    va_start(args, format);
+    len = _vscwprintf(format, args);
+    va_end(args);
+
+    return len;
+}