f6b7e9d55da94463f5c9968ee0cbd44f2d42fc1f
[reactos.git] / sdk / lib / crt / printf / _vscwprintf.c
1 /*
2 * COPYRIGHT: GNU GPL, see COPYING in the top level directory
3 * PROJECT: ReactOS crt library
4 * FILE: lib/sdk/crt/printf/_vscwprintf.c
5 * PURPOSE: Implementation of _vscprintf
6 */
7
8 #include <stdio.h>
9 #include <stdarg.h>
10
11 #ifdef _LIBCNT_
12 #include <ntddk.h>
13 #endif
14
15 int __cdecl wstreamout(FILE *stream, const wchar_t *format, va_list argptr);
16
17 int
18 __cdecl
19 _vscwprintf(
20 const wchar_t *format,
21 va_list argptr)
22 {
23 int ret;
24 #ifndef _LIBCNT_
25 FILE* nulfile;
26 nulfile = fopen("nul", "w");
27 if(nulfile == NULL)
28 {
29 /* This should never happen... */
30 return -1;
31 }
32 ret = wstreamout(nulfile, format, argptr);
33 fclose(nulfile);
34 #else
35 ret = -1;
36 #endif
37 return ret;
38 }