zig/lib/libc/mingw/secapi/_vcprintf_s_l.c
Andrew Kelley 49d1a4c562 move lib dirs to lib subdir
also start prefering NtDll API. so far:
 * NtQueryInformationFile
 * NtClose

adds a performance workaround for windows unicode conversion. but that
should probably be removed before merging
2019-07-15 17:54:50 -04:00

41 lines
1.0 KiB
C

#define MINGW_HAS_SECURE_API 1
#include <windows.h>
#include <malloc.h>
#include <errno.h>
#include <msvcrt.h>
#include <sec_api/conio_s.h>
static int __cdecl _int_vcprintf_s_l (const char *, _locale_t, va_list);
static int __cdecl _stub (const char *, _locale_t, va_list);
int __cdecl (*__MINGW_IMP_SYMBOL(_vcprintf_s_l))(const char *, _locale_t, va_list) =
_stub;
static int __cdecl
_stub (const char *s, _locale_t loc, va_list argp)
{
int __cdecl (*f)(const char *, _locale_t, va_list) = __MINGW_IMP_SYMBOL(_vcprintf_s_l);
if (f == _stub)
{
f = (int __cdecl (*)(const char *, _locale_t, va_list))
GetProcAddress (__mingw_get_msvcrt_handle (), "_vcprintf_s_l");
if (!f)
f = _int_vcprintf_s_l;
__MINGW_IMP_SYMBOL(_vcprintf_s_l) = f;
}
return (*f)(s, loc, argp);
}
int __cdecl
_vcprintf_s_l (const char *s, _locale_t loc, va_list argp)
{
return _stub (s, loc, argp);
}
static int __cdecl
_int_vcprintf_s_l (const char *s, _locale_t loc, va_list argp)
{
return _vcprintf_l (s, loc, argp);
}