• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include <windows.h>
2 #include <malloc.h>
3 #include <errno.h>
4 #include <msvcrt.h>
5 #include <sec_api/conio_s.h>
6 
7 static int __cdecl _int_vcprintf_s (const char *, va_list);
8 static int __cdecl _stub (const char *, va_list);
9 
10 int __cdecl (*__MINGW_IMP_SYMBOL(_vcprintf_s))(const char *, va_list) =
11  _stub;
12 
13 static int __cdecl
_stub(const char * s,va_list argp)14 _stub (const char *s, va_list argp)
15 {
16   int __cdecl (*f)(const char *, va_list) = __MINGW_IMP_SYMBOL(_vcprintf_s);
17 
18   if (f == _stub)
19     {
20 	f = (int __cdecl (*)(const char *, va_list))
21 	    GetProcAddress (__mingw_get_msvcrt_handle (), "_vcprintf_s");
22 	if (!f)
23 	  f = _int_vcprintf_s;
24 	__MINGW_IMP_SYMBOL(_vcprintf_s) = f;
25     }
26   return (*f)(s, argp);
27 }
28 
29 int __cdecl
_vcprintf_s(const char * s,va_list argp)30 _vcprintf_s (const char *s, va_list argp)
31 {
32   return _stub (s, argp);
33 }
34 
35 static int __cdecl
_int_vcprintf_s(const char * s,va_list argp)36 _int_vcprintf_s (const char *s, va_list argp)
37 {
38   return _vcprintf (s, argp);
39 }
40