Home | History | Annotate | Download | only in include
      1 /**
      2  * This file has no copyright assigned and is placed in the Public Domain.
      3  * This file is part of the mingw-w64 runtime package.
      4  * No warranty is given; refer to the file DISCLAIMER.PD within this package.
      5  */
      6 #ifndef _INC_STDIO
      7 #define _INC_STDIO
      8 
      9 #include <crtdefs.h>
     10 
     11 #include <_mingw_print_push.h>
     12 
     13 #pragma pack(push,_CRT_PACKING)
     14 
     15 #ifdef __cplusplus
     16 extern "C" {
     17 #endif
     18 
     19 #define BUFSIZ 512
     20 #define _NFILE _NSTREAM_
     21 #define _NSTREAM_ 512
     22 #define _IOB_ENTRIES 20
     23 #define EOF (-1)
     24 
     25 #ifndef _FILE_DEFINED
     26   struct _iobuf {
     27     char *_ptr;
     28     int _cnt;
     29     char *_base;
     30     int _flag;
     31     int _file;
     32     int _charbuf;
     33     int _bufsiz;
     34     char *_tmpfname;
     35   };
     36   typedef struct _iobuf FILE;
     37 #define _FILE_DEFINED
     38 #endif
     39 
     40 #ifdef _POSIX_
     41 #define _P_tmpdir "/"
     42 #define _wP_tmpdir L"/"
     43 #else
     44 #define _P_tmpdir "\\"
     45 #define _wP_tmpdir L"\\"
     46 #endif
     47 
     48 #define L_tmpnam (sizeof(_P_tmpdir) + 12)
     49 
     50 #ifdef _POSIX_
     51 #define L_ctermid 9
     52 #define L_cuserid 32
     53 #endif
     54 
     55 #define SEEK_CUR 1
     56 #define SEEK_END 2
     57 #define SEEK_SET 0
     58 
     59 #define	STDIN_FILENO	0
     60 #define	STDOUT_FILENO	1
     61 #define	STDERR_FILENO	2
     62 
     63 #define FILENAME_MAX 260
     64 #define FOPEN_MAX 20
     65 #define _SYS_OPEN 20
     66 #define TMP_MAX 32767
     67 
     68 #ifndef NULL
     69 #ifdef __cplusplus
     70 #ifndef _WIN64
     71 #define NULL 0
     72 #else
     73 #define NULL 0LL
     74 #endif  /* W64 */
     75 #else
     76 #define NULL ((void *)0)
     77 #endif
     78 #endif
     79 
     80 #include <_mingw_off_t.h>
     81 
     82 #ifndef _STDIO_DEFINED
     83 #ifdef _WIN64
     84   _CRTIMP FILE *__cdecl __iob_func(void);
     85 #define _iob  __iob_func()
     86 #else
     87 #ifdef _MSVCRT_
     88 extern FILE _iob[];	/* A pointer to an array of FILE */
     89 #define __iob_func()	(_iob)
     90 #else
     91 extern FILE (* __MINGW_IMP_SYMBOL(_iob))[];	/* A pointer to an array of FILE */
     92 #define __iob_func()	(* __MINGW_IMP_SYMBOL(_iob))
     93 #define _iob __iob_func()
     94 #endif
     95 #endif
     96 #endif
     97 
     98 #ifndef _FPOS_T_DEFINED
     99 #define _FPOS_T_DEFINED
    100 #undef _FPOSOFF
    101 
    102 #if (!defined(NO_OLDNAMES) || defined(__GNUC__))
    103   __MINGW_EXTENSION typedef __int64 fpos_t;
    104 #define _FPOSOFF(fp) ((long)(fp))
    105 #else
    106   __MINGW_EXTENSION typedef long long fpos_t;
    107 #define _FPOSOFF(fp) ((long)(fp))
    108 #endif
    109 
    110 #endif
    111 
    112 #ifndef _STDSTREAM_DEFINED
    113 #define _STDSTREAM_DEFINED
    114 
    115 #define stdin (&__iob_func()[0])
    116 #define stdout (&__iob_func()[1])
    117 #define stderr (&__iob_func()[2])
    118 #endif
    119 
    120 #define _IOREAD 0x0001
    121 #define _IOWRT 0x0002
    122 
    123 #define _IOFBF 0x0000
    124 #define _IOLBF 0x0040
    125 #define _IONBF 0x0004
    126 
    127 #define _IOMYBUF 0x0008
    128 #define _IOEOF 0x0010
    129 #define _IOERR 0x0020
    130 #define _IOSTRG 0x0040
    131 #define _IORW 0x0080
    132 #ifdef _POSIX_
    133 #define _IOAPPEND 0x0200
    134 #endif
    135 
    136 #define _TWO_DIGIT_EXPONENT 0x1
    137 
    138 #ifndef _STDIO_DEFINED
    139 extern
    140   __attribute__((__format__ (gnu_scanf, 2, 3))) __MINGW_ATTRIB_NONNULL(2)
    141   int __cdecl __mingw_sscanf(const char * __restrict__ _Src,const char * __restrict__ _Format,...);
    142 extern
    143   __attribute__((__format__ (gnu_scanf, 2, 0))) __MINGW_ATTRIB_NONNULL(2)
    144   int __cdecl __mingw_vsscanf (const char * __restrict__ _Str,const char * __restrict__ Format,va_list argp);
    145 extern
    146   __attribute__((__format__ (gnu_scanf, 1, 2))) __MINGW_ATTRIB_NONNULL(1)
    147   int __cdecl __mingw_scanf(const char * __restrict__ _Format,...);
    148 extern
    149   __attribute__((__format__ (gnu_scanf, 1, 0))) __MINGW_ATTRIB_NONNULL(1)
    150   int __cdecl __mingw_vscanf(const char * __restrict__ Format, va_list argp);
    151 extern
    152   __attribute__((__format__ (gnu_scanf, 2, 3))) __MINGW_ATTRIB_NONNULL(2)
    153   int __cdecl __mingw_fscanf(FILE * __restrict__ _File,const char * __restrict__ _Format,...);
    154 extern
    155   __attribute__((__format__ (gnu_scanf, 2, 0))) __MINGW_ATTRIB_NONNULL(2)
    156   int __cdecl __mingw_vfscanf (FILE * __restrict__ fp, const char * __restrict__ Format,va_list argp);
    157 
    158 extern
    159   __attribute__((__format__ (gnu_printf, 3, 0))) __MINGW_ATTRIB_NONNULL(3)
    160   int __cdecl __mingw_vsnprintf(char * __restrict__ _DstBuf,size_t _MaxCount,const char * __restrict__ _Format,
    161                                va_list _ArgList);
    162 extern
    163   __attribute__((__format__ (gnu_printf, 3, 4))) __MINGW_ATTRIB_NONNULL(3)
    164   int __cdecl __mingw_snprintf(char * __restrict__ s, size_t n, const char * __restrict__  format, ...);
    165 extern
    166   __attribute__((__format__ (gnu_printf, 1, 2))) __MINGW_ATTRIB_NONNULL(1)
    167   int __cdecl __mingw_printf(const char * __restrict__ , ... ) __MINGW_NOTHROW;
    168 extern
    169   __attribute__((__format__ (gnu_printf, 1, 0))) __MINGW_ATTRIB_NONNULL(1)
    170   int __cdecl __mingw_vprintf (const char * __restrict__ , va_list) __MINGW_NOTHROW;
    171 extern
    172   __attribute__((__format__ (gnu_printf, 2, 3))) __MINGW_ATTRIB_NONNULL(2)
    173   int __cdecl __mingw_fprintf (FILE * __restrict__ , const char * __restrict__ , ...) __MINGW_NOTHROW;
    174 extern
    175   __attribute__((__format__ (gnu_printf, 2, 0))) __MINGW_ATTRIB_NONNULL(2)
    176   int __cdecl __mingw_vfprintf (FILE * __restrict__ , const char * __restrict__ , va_list) __MINGW_NOTHROW;
    177 extern
    178   __attribute__((__format__ (gnu_printf, 2, 3))) __MINGW_ATTRIB_NONNULL(2)
    179   int __cdecl __mingw_sprintf (char * __restrict__ , const char * __restrict__ , ...) __MINGW_NOTHROW;
    180 extern
    181   __attribute__((__format__ (gnu_printf, 2, 0))) __MINGW_ATTRIB_NONNULL(2)
    182   int __cdecl __mingw_vsprintf (char * __restrict__ , const char * __restrict__ , va_list) __MINGW_NOTHROW;
    183 extern
    184   __attribute__((__format__ (gnu_printf, 2, 3))) __attribute__((nonnull (1,2)))
    185   int __cdecl __mingw_asprintf(char ** __restrict__ , const char * __restrict__ , ...) __MINGW_NOTHROW;
    186 extern
    187   __attribute__((__format__ (gnu_printf, 2, 0))) __attribute__((nonnull (1,2)))
    188   int __cdecl __mingw_vasprintf(char ** __restrict__ , const char * __restrict__ , va_list) __MINGW_NOTHROW;
    189 
    190 #if __USE_MINGW_ANSI_STDIO
    191 /*
    192  * User has expressed a preference for C99 conformance...
    193  */
    194 #undef __MINGW_PRINTF_FORMAT
    195 #undef __MINGW_SCANF_FORMAT
    196 #define __MINGW_PRINTF_FORMAT gnu_printf
    197 #define __MINGW_SCANF_FORMAT  gnu_scanf
    198 
    199 #ifdef _GNU_SOURCE
    200 __mingw_ovr
    201 __attribute__ ((__format__ (gnu_printf, 2, 3))) __attribute__((nonnull (1,2)))
    202 int asprintf(char **__ret, const char *__format, ...)
    203 {
    204   register int __retval;
    205   __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format );
    206   __retval = __mingw_vasprintf( __ret, __format, __local_argv );
    207   __builtin_va_end( __local_argv );
    208   return __retval;
    209 }
    210 
    211 __mingw_ovr
    212 __attribute__ ((__format__ (gnu_printf, 2, 0))) __attribute__((nonnull (1,2)))
    213 int vasprintf(char **__ret, const char *__format, __builtin_va_list __local_argv)
    214 {
    215   return __mingw_vasprintf( __ret, __format, __local_argv );
    216 }
    217 #endif /* _GNU_SOURCE */
    218 
    219 /* There seems to be a bug about builtins and static overrides of them
    220    in g++.  So we need to do here some trickery.  */
    221 #ifdef __cplusplus
    222 extern "C++" {
    223 #endif
    224 
    225 __mingw_ovr
    226 __attribute__((__format__ (gnu_scanf, 2, 3))) __MINGW_ATTRIB_NONNULL(2)
    227 int sscanf(const char *__source, const char *__format, ...)
    228 {
    229   register int __retval;
    230   __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format );
    231   __retval = __mingw_vsscanf( __source, __format, __local_argv );
    232   __builtin_va_end( __local_argv );
    233   return __retval;
    234 }
    235 
    236 __mingw_ovr
    237 __attribute__((__format__ (gnu_scanf, 1, 2))) __MINGW_ATTRIB_NONNULL(1)
    238 int scanf(const char *__format, ...)
    239 {
    240   register int __retval;
    241   __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format );
    242   __retval = __mingw_vscanf( __format, __local_argv );
    243   __builtin_va_end( __local_argv );
    244   return __retval;
    245 }
    246 
    247 __mingw_ovr
    248 __attribute__((__format__ (gnu_scanf, 2, 3))) __MINGW_ATTRIB_NONNULL(2)
    249 int fscanf(FILE *__stream, const char *__format, ...)
    250 {
    251   register int __retval;
    252   __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format );
    253   __retval = __mingw_vfscanf( __stream, __format, __local_argv );
    254   __builtin_va_end( __local_argv );
    255   return __retval;
    256 }
    257 
    258 #ifndef __NO_ISOCEXT  /* externs in libmingwex.a */
    259 __mingw_ovr
    260 __attribute__((__format__ (gnu_scanf, 2, 0))) __MINGW_ATTRIB_NONNULL(2)
    261 int vsscanf (const char *__source, const char *__format, __builtin_va_list __local_argv)
    262 {
    263   return __mingw_vsscanf( __source, __format, __local_argv );
    264 }
    265 
    266 __mingw_ovr
    267 __attribute__((__format__ (gnu_scanf, 1, 0))) __MINGW_ATTRIB_NONNULL(1)
    268 int vscanf(const char *__format,  __builtin_va_list __local_argv)
    269 {
    270   return __mingw_vscanf( __format, __local_argv );
    271 }
    272 
    273 __mingw_ovr
    274 __attribute__((__format__ (gnu_scanf, 2, 0))) __MINGW_ATTRIB_NONNULL(2)
    275 int vfscanf (FILE *__stream,  const char *__format, __builtin_va_list __local_argv)
    276 {
    277   return __mingw_vfscanf( __stream, __format, __local_argv );
    278 }
    279 #endif /* __NO_ISOCEXT */
    280 
    281 
    282 
    283 __mingw_ovr
    284 __attribute__((__format__ (gnu_printf, 2, 3))) __MINGW_ATTRIB_NONNULL(2)
    285 int fprintf (FILE *__stream, const char *__format, ...)
    286 {
    287   register int __retval;
    288   __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format );
    289   __retval = __mingw_vfprintf( __stream, __format, __local_argv );
    290   __builtin_va_end( __local_argv );
    291   return __retval;
    292 }
    293 
    294 __mingw_ovr
    295 __attribute__((__format__ (gnu_printf, 1, 2))) __MINGW_ATTRIB_NONNULL(1)
    296 int printf (const char *__format, ...)
    297 {
    298   register int __retval;
    299   __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format );
    300   __retval = __mingw_vprintf( __format, __local_argv );
    301   __builtin_va_end( __local_argv );
    302   return __retval;
    303 }
    304 
    305 __mingw_ovr
    306 __attribute__((__format__ (gnu_printf, 2, 3))) __MINGW_ATTRIB_NONNULL(2)
    307 int sprintf (char *__stream, const char *__format, ...)
    308 {
    309   register int __retval;
    310   __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format );
    311   __retval = __mingw_vsprintf( __stream, __format, __local_argv );
    312   __builtin_va_end( __local_argv );
    313   return __retval;
    314 }
    315 
    316 __mingw_ovr
    317 __attribute__((__format__ (gnu_printf, 2, 0))) __MINGW_ATTRIB_NONNULL(2)
    318 int vfprintf (FILE *__stream, const char *__format, __builtin_va_list __local_argv)
    319 {
    320   return __mingw_vfprintf( __stream, __format, __local_argv );
    321 }
    322 
    323 __mingw_ovr
    324 __attribute__((__format__ (gnu_printf, 1, 0))) __MINGW_ATTRIB_NONNULL(1)
    325 int vprintf (const char *__format, __builtin_va_list __local_argv)
    326 {
    327   return __mingw_vprintf( __format, __local_argv );
    328 }
    329 
    330 __mingw_ovr
    331 __attribute__((__format__ (gnu_printf, 2, 0))) __MINGW_ATTRIB_NONNULL(2)
    332 int vsprintf (char *__stream, const char *__format, __builtin_va_list __local_argv)
    333 {
    334   return __mingw_vsprintf( __stream, __format, __local_argv );
    335 }
    336 /* #ifndef __NO_ISOCEXT */  /* externs in libmingwex.a */
    337 __mingw_ovr
    338 __attribute__((__format__ (gnu_printf, 3, 4))) __MINGW_ATTRIB_NONNULL(3)
    339 int snprintf (char *__stream, size_t __n, const char *__format, ...)
    340 {
    341   register int __retval;
    342   __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format );
    343   __retval = __mingw_vsnprintf( __stream, __n, __format, __local_argv );
    344   __builtin_va_end( __local_argv );
    345   return __retval;
    346 }
    347 
    348 __mingw_ovr
    349 __attribute__((__format__ (gnu_printf, 3, 0))) __MINGW_ATTRIB_NONNULL(3)
    350 int vsnprintf (char *__stream, size_t __n, const char *__format, __builtin_va_list __local_argv)
    351 {
    352   return __mingw_vsnprintf( __stream, __n, __format, __local_argv );
    353 }
    354 
    355 /* Override __builtin_printf-routines ... Kludge for libstdc++ ...*/
    356 #define __builtin_vsnprintf __mingw_vsnprintf
    357 #define __builtin_vsprintf __mingw_vsprintf
    358 
    359 /* #endif */ /* __NO_ISOCEXT */
    360 
    361 #ifdef __cplusplus
    362 }
    363 #endif
    364 
    365 #else /* !__USE_MINGW_ANSI_STDIO */
    366 
    367 #undef __MINGW_PRINTF_FORMAT
    368 #undef __MINGW_SCANF_FORMAT
    369 #define __MINGW_PRINTF_FORMAT ms_printf
    370 #define __MINGW_SCANF_FORMAT  ms_scanf
    371 #undef __builtin_vsnprintf
    372 #undef __builtin_vsprintf
    373 
    374 /*
    375  * Default configuration: simply direct all calls to MSVCRT...
    376  */
    377   __attribute__((__format__ (ms_printf, 2, 3))) __MINGW_ATTRIB_NONNULL(2)
    378   int __cdecl fprintf(FILE * __restrict__ _File,const char * __restrict__ _Format,...);
    379   __attribute__((__format__ (ms_printf, 1, 2))) __MINGW_ATTRIB_NONNULL(1)
    380   int __cdecl printf(const char * __restrict__ _Format,...);
    381   __attribute__((__format__ (ms_printf, 2, 3))) __MINGW_ATTRIB_NONNULL(2)
    382   int __cdecl sprintf(char * __restrict__ _Dest,const char * __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
    383 
    384   __attribute__((__format__ (ms_printf, 2, 0))) __MINGW_ATTRIB_NONNULL(2)
    385   int __cdecl vfprintf(FILE * __restrict__ _File,const char * __restrict__ _Format,va_list _ArgList);
    386   __attribute__((__format__ (ms_printf, 1, 0))) __MINGW_ATTRIB_NONNULL(1)
    387   int __cdecl vprintf(const char * __restrict__ _Format,va_list _ArgList);
    388   __attribute__((__format__ (ms_printf, 2, 0))) __MINGW_ATTRIB_NONNULL(2)
    389   int __cdecl vsprintf(char * __restrict__ _Dest,const char * __restrict__ _Format,va_list _Args) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
    390 
    391   __attribute__((__format__ (ms_scanf, 2, 3))) __MINGW_ATTRIB_NONNULL(2)
    392   int __cdecl fscanf(FILE * __restrict__ _File,const char * __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
    393   __attribute__((__format__ (ms_scanf, 1, 2))) __MINGW_ATTRIB_NONNULL(1)
    394   int __cdecl scanf(const char * __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
    395   __attribute__((__format__ (ms_scanf, 2, 3))) __MINGW_ATTRIB_NONNULL(2)
    396   int __cdecl sscanf(const char * __restrict__ _Src,const char * __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
    397 #ifdef _GNU_SOURCE
    398   int __cdecl vasprintf(char ** __restrict__ ret,const char * __restrict__ format,va_list ap)  __attribute__ ((format (__MINGW_PRINTF_FORMAT, 2, 0)));;
    399   int __cdecl asprintf(char ** __restrict__ ret,const char * __restrict__ format,...) __attribute__ ((format (__MINGW_PRINTF_FORMAT, 2, 3)));
    400 #endif /*_GNU_SOURCE*/
    401 #ifndef __NO_ISOCEXT  /* externs in libmingwex.a */
    402   __attribute__((__format__ (ms_scanf, 1, 0))) __MINGW_ATTRIB_NONNULL(1)
    403   int __cdecl __ms_vscanf(const char * __restrict__ Format, va_list argp);
    404   __attribute__((__format__ (ms_scanf, 2, 0))) __MINGW_ATTRIB_NONNULL(2)
    405   int __cdecl __ms_vfscanf (FILE * __restrict__ fp, const char * __restrict__ Format,va_list argp);
    406   __attribute__((__format__ (ms_scanf, 2, 0))) __MINGW_ATTRIB_NONNULL(2)
    407   int __cdecl __ms_vsscanf (const char * __restrict__ _Str,const char * __restrict__ Format,va_list argp);
    408 
    409   __mingw_ovr
    410   __attribute__((__format__ (ms_scanf, 2, 0))) __MINGW_ATTRIB_NONNULL(2)
    411   int vfscanf (FILE *__stream,  const char *__format, __builtin_va_list __local_argv)
    412   {
    413     return __ms_vfscanf (__stream, __format, __local_argv);
    414   }
    415 
    416   __mingw_ovr
    417   __attribute__((__format__ (ms_scanf, 2, 0))) __MINGW_ATTRIB_NONNULL(2)
    418   int vsscanf (const char * __restrict__ __source, const char * __restrict__ __format, __builtin_va_list __local_argv)
    419   {
    420     return __ms_vsscanf( __source, __format, __local_argv );
    421   }
    422   __mingw_ovr
    423   __attribute__((__format__ (ms_scanf, 1, 0))) __MINGW_ATTRIB_NONNULL(1)
    424   int vscanf(const char *__format,  __builtin_va_list __local_argv)
    425   {
    426     return __ms_vscanf (__format, __local_argv);
    427   }
    428 
    429 #endif /* __NO_ISOCEXT */
    430 #endif /* __USE_MINGW_ANSI_STDIO */
    431 
    432   _CRTIMP int __cdecl _filbuf(FILE *_File);
    433   _CRTIMP int __cdecl _flsbuf(int _Ch,FILE *_File);
    434 #ifdef _POSIX_
    435   _CRTIMP FILE *__cdecl _fsopen(const char *_Filename,const char *_Mode);
    436 #else
    437   _CRTIMP FILE *__cdecl _fsopen(const char *_Filename,const char *_Mode,int _ShFlag);
    438 #endif
    439   void __cdecl clearerr(FILE *_File);
    440   int __cdecl fclose(FILE *_File);
    441   _CRTIMP int __cdecl _fcloseall(void);
    442 #ifdef _POSIX_
    443   FILE *__cdecl fdopen(int _FileHandle,const char *_Mode) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    444 #else
    445   _CRTIMP FILE *__cdecl _fdopen(int _FileHandle,const char *_Mode);
    446 #endif
    447   int __cdecl feof(FILE *_File);
    448   int __cdecl ferror(FILE *_File);
    449   int __cdecl fflush(FILE *_File);
    450   int __cdecl fgetc(FILE *_File);
    451   _CRTIMP int __cdecl _fgetchar(void);
    452   int __cdecl fgetpos(FILE * __restrict__ _File ,fpos_t * __restrict__ _Pos); /* 64bit only, no 32bit version */
    453   int __cdecl fgetpos64(FILE * __restrict__ _File ,fpos_t * __restrict__ _Pos); /* fgetpos already 64bit */
    454   char *__cdecl fgets(char * __restrict__ _Buf,int _MaxCount,FILE * __restrict__ _File);
    455   _CRTIMP int __cdecl _fileno(FILE *_File);
    456 #ifdef _POSIX_
    457   int __cdecl fileno(FILE *_File) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    458 #endif
    459   _CRTIMP char *__cdecl _tempnam(const char *_DirName,const char *_FilePrefix);
    460   _CRTIMP int __cdecl _flushall(void);
    461   FILE *__cdecl fopen(const char * __restrict__ _Filename,const char * __restrict__ _Mode) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
    462   FILE *fopen64(const char * __restrict__ filename,const char * __restrict__  mode);
    463   int __cdecl fputc(int _Ch,FILE *_File);
    464   _CRTIMP int __cdecl _fputchar(int _Ch);
    465   int __cdecl fputs(const char * __restrict__ _Str,FILE * __restrict__ _File);
    466   size_t __cdecl fread(void * __restrict__ _DstBuf,size_t _ElementSize,size_t _Count,FILE * __restrict__ _File);
    467   FILE *__cdecl freopen(const char * __restrict__ _Filename,const char * __restrict__ _Mode,FILE * __restrict__ _File) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
    468   int __cdecl fsetpos(FILE *_File,const fpos_t *_Pos);
    469   int __cdecl fsetpos64(FILE *_File,const fpos_t *_Pos); /* fsetpos already 64bit */
    470   int __cdecl fseek(FILE *_File,long _Offset,int _Origin);
    471 
    472   /* Shouldn't be any fseeko32 in glibc, 32bit to 64bit casting should be fine */
    473   /* int fseeko32(FILE* stream, _off_t offset, int whence);*/ /* fseeko32 redirects to fseeko64 */
    474   int fseeko64(FILE* stream, _off64_t offset, int whence);
    475   int fseeko(FILE* stream, _off_t offset, int whence);
    476 
    477 #ifndef _FILE_OFFSET_BITS_SET_FSEEKO
    478 #define _FILE_OFFSET_BITS_SET_FSEEKO
    479 #if (defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64))
    480 #define fseeko fseeko64
    481 #endif /* (defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64)) */
    482 #endif /* _FILE_OFFSET_BITS_SET_FSEEKO */
    483 
    484   long __cdecl ftell(FILE *_File);
    485   /* Returns truncated 64bit off_t */
    486   _off_t ftello(FILE * stream);
    487   _off64_t ftello64(FILE * stream);
    488 
    489 #ifndef _FILE_OFFSET_BITS_SET_FTELLO
    490 #define _FILE_OFFSET_BITS_SET_FTELLO
    491 #if (defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64))
    492 #define ftello ftello64
    493 #endif /* (defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64)) */
    494 #endif /* _FILE_OFFSET_BITS_SET_FTELLO */
    495 
    496   __MINGW_EXTENSION int __cdecl _fseeki64(FILE *_File,__int64 _Offset,int _Origin);
    497   __MINGW_EXTENSION __int64 __cdecl _ftelli64(FILE *_File);
    498   size_t __cdecl fwrite(const void * __restrict__ _Str,size_t _Size,size_t _Count,FILE * __restrict__ _File);
    499   int __cdecl getc(FILE *_File);
    500   int __cdecl getchar(void);
    501   _CRTIMP int __cdecl _getmaxstdio(void);
    502   char *__cdecl gets(char *_Buffer) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
    503   int __cdecl _getw(FILE *_File);
    504 #ifndef _CRT_PERROR_DEFINED
    505 #define _CRT_PERROR_DEFINED
    506   void __cdecl perror(const char *_ErrMsg);
    507 #endif
    508   _CRTIMP int __cdecl _pclose(FILE *_File);
    509   _CRTIMP FILE *__cdecl _popen(const char *_Command,const char *_Mode);
    510 #if !defined(NO_OLDNAMES) && !defined(popen)
    511 #define popen	_popen
    512 #define pclose	_pclose
    513 #endif
    514   int __cdecl putc(int _Ch,FILE *_File);
    515   int __cdecl putchar(int _Ch);
    516   int __cdecl puts(const char *_Str);
    517   _CRTIMP int __cdecl _putw(int _Word,FILE *_File);
    518 #ifndef _CRT_DIRECTORY_DEFINED
    519 #define _CRT_DIRECTORY_DEFINED
    520   int __cdecl remove(const char *_Filename);
    521   int __cdecl rename(const char *_OldFilename,const char *_NewFilename);
    522   _CRTIMP int __cdecl _unlink(const char *_Filename);
    523 #ifndef	NO_OLDNAMES
    524   int __cdecl unlink(const char *_Filename) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    525 #endif
    526 #endif
    527   void __cdecl rewind(FILE *_File);
    528   _CRTIMP int __cdecl _rmtmp(void);
    529   void __cdecl setbuf(FILE * __restrict__ _File,char * __restrict__ _Buffer) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
    530   _CRTIMP int __cdecl _setmaxstdio(int _Max);
    531   _CRTIMP unsigned int __cdecl _set_output_format(unsigned int _Format);
    532   _CRTIMP unsigned int __cdecl _get_output_format(void);
    533   int __cdecl setvbuf(FILE * __restrict__ _File,char * __restrict__ _Buf,int _Mode,size_t _Size);
    534   _CRTIMP int __cdecl _scprintf(const char * __restrict__ _Format,...);
    535   _CRTIMP int __cdecl _snscanf(const char * __restrict__ _Src,size_t _MaxCount,const char * __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
    536   FILE *__cdecl tmpfile(void) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
    537   char *__cdecl tmpnam(char *_Buffer);
    538   int __cdecl ungetc(int _Ch,FILE *_File);
    539 
    540   __attribute__((__format__ (ms_printf, 3, 4))) __MINGW_ATTRIB_NONNULL(3)
    541   _CRTIMP int __cdecl _snprintf(char * __restrict__ _Dest,size_t _Count,const char * __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
    542   __attribute__((__format__ (ms_printf, 3, 0))) __MINGW_ATTRIB_NONNULL(3)
    543   _CRTIMP int __cdecl _vsnprintf(char * __restrict__ _Dest,size_t _Count,const char * __restrict__ _Format,va_list _Args) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
    544 
    545 #if !defined (__USE_MINGW_ANSI_STDIO) || __USE_MINGW_ANSI_STDIO == 0
    546 /* this is here to deal with software defining
    547  * vsnprintf as _vsnprintf, eg. libxml2.  */
    548 #pragma push_macro("snprintf")
    549 #pragma push_macro("vsnprintf")
    550 # undef snprintf
    551 # undef vsnprintf
    552   __attribute__((__format__ (ms_printf, 3, 0))) __MINGW_ATTRIB_NONNULL(3)
    553   int __cdecl __ms_vsnprintf(char * __restrict__ d,size_t n,const char * __restrict__ format,va_list arg)
    554     __MINGW_ATTRIB_DEPRECATED_MSVC2005 __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
    555 
    556   __mingw_ovr
    557   __attribute__((__format__ (ms_printf, 3, 0))) __MINGW_ATTRIB_NONNULL(3)
    558   int vsnprintf (char * __restrict__ __stream, size_t __n, const char * __restrict__ __format, va_list __local_argv)
    559   {
    560     return __ms_vsnprintf (__stream, __n, __format, __local_argv);
    561   }
    562 
    563   __attribute__((__format__ (ms_printf, 3, 4))) __MINGW_ATTRIB_NONNULL(3)
    564   int __cdecl __ms_snprintf(char * __restrict__ s, size_t n, const char * __restrict__  format, ...);
    565 
    566 #ifndef __NO_ISOCEXT
    567 __mingw_ovr
    568 __attribute__((__format__ (ms_printf, 3, 4))) __MINGW_ATTRIB_NONNULL(3)
    569 int snprintf (char * __restrict__ __stream, size_t __n, const char * __restrict__ __format, ...)
    570 {
    571   register int __retval;
    572   __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format );
    573   __retval = __ms_vsnprintf (__stream, __n, __format, __local_argv);
    574   __builtin_va_end( __local_argv );
    575   return __retval;
    576 }
    577 #endif /* !__NO_ISOCEXT */
    578 
    579 #pragma pop_macro ("vsnprintf")
    580 #pragma pop_macro ("snprintf")
    581 #endif
    582 
    583   _CRTIMP int __cdecl _vscprintf(const char * __restrict__ _Format,va_list _ArgList);
    584   _CRTIMP int __cdecl _set_printf_count_output(int _Value);
    585   _CRTIMP int __cdecl _get_printf_count_output(void);
    586 
    587 #ifndef _WSTDIO_DEFINED
    588 #define _WSTDIO_DEFINED
    589 
    590 /* __attribute__((__format__ (gnu_wscanf, 2, 3))) */ __MINGW_ATTRIB_NONNULL(2)
    591   int __cdecl __mingw_swscanf(const wchar_t * __restrict__ _Src,const wchar_t * __restrict__ _Format,...);
    592 /* __attribute__((__format__ (gnu_wscanf, 2, 0))) */ __MINGW_ATTRIB_NONNULL(2)
    593   int __cdecl __mingw_vswscanf (const wchar_t * __restrict__ _Str,const wchar_t * __restrict__ Format,va_list argp);
    594 /* __attribute__((__format__ (gnu_wscanf, 1, 2))) */ __MINGW_ATTRIB_NONNULL(1)
    595   int __cdecl __mingw_wscanf(const wchar_t * __restrict__ _Format,...);
    596 /* __attribute__((__format__ (gnu_wscanf, 1, 0))) */ __MINGW_ATTRIB_NONNULL(1)
    597   int __cdecl __mingw_vwscanf(const wchar_t * __restrict__ Format, va_list argp);
    598 /* __attribute__((__format__ (gnu_wscanf, 2, 3))) */ __MINGW_ATTRIB_NONNULL(2)
    599   int __cdecl __mingw_fwscanf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...);
    600 /* __attribute__((__format__ (gnu_wscanf, 2, 0))) */ __MINGW_ATTRIB_NONNULL(2)
    601   int __cdecl __mingw_vfwscanf (FILE * __restrict__ fp, const wchar_t * __restrict__ Format,va_list argp);
    602 
    603 /* __attribute__((__format__ (gnu_wprintf, 2, 3))) */ __MINGW_ATTRIB_NONNULL(2)
    604   int __cdecl __mingw_fwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...);
    605 /* __attribute__((__format__ (gnu_wprintf, 1, 2))) */ __MINGW_ATTRIB_NONNULL(1)
    606   int __cdecl __mingw_wprintf(const wchar_t * __restrict__ _Format,...);
    607 /* __attribute__((__format__ (gnu_wprintf, 2, 0))) */__MINGW_ATTRIB_NONNULL(2)
    608   int __cdecl __mingw_vfwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,va_list _ArgList);
    609 /*__attribute__((__format__ (gnu_wprintf, 1, 0))) */ __MINGW_ATTRIB_NONNULL(1)
    610   int __cdecl __mingw_vwprintf(const wchar_t * __restrict__ _Format,va_list _ArgList);
    611 /* __attribute__((__format__ (gnu_wprintf, 3, 4))) */ __MINGW_ATTRIB_NONNULL(3)
    612   int __cdecl __mingw_snwprintf (wchar_t * __restrict__ s, size_t n, const wchar_t * __restrict__ format, ...);
    613 /* __attribute__((__format__ (gnu_wprintf, 3, 0))) */ __MINGW_ATTRIB_NONNULL(3)
    614   int __cdecl __mingw_vsnwprintf (wchar_t * __restrict__ , size_t, const wchar_t * __restrict__ , va_list);
    615 /* __attribute__((__format__ (gnu_wprintf, 2, 3))) */ __MINGW_ATTRIB_NONNULL(2)
    616   int __cdecl __mingw_swprintf(wchar_t * __restrict__ , const wchar_t * __restrict__ , ...);
    617 /* __attribute__((__format__ (gnu_wprintf, 2, 0))) */ __MINGW_ATTRIB_NONNULL(2)
    618   int __cdecl __mingw_vswprintf(wchar_t * __restrict__ , const wchar_t * __restrict__ ,va_list);
    619 
    620 #if __USE_MINGW_ANSI_STDIO
    621 /*
    622  * User has expressed a preference for C99 conformance...
    623  */
    624 
    625 __mingw_ovr
    626 /* __attribute__((__format__ (gnu_wscanf, 2, 3))) */ __MINGW_ATTRIB_NONNULL(2)
    627 int swscanf(const wchar_t *__source, const wchar_t *__format, ...)
    628 {
    629   register int __retval;
    630   __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format );
    631   __retval = __mingw_vswscanf( __source, __format, __local_argv );
    632   __builtin_va_end( __local_argv );
    633   return __retval;
    634 }
    635 
    636 __mingw_ovr
    637 /* __attribute__((__format__ (gnu_wscanf, 1, 2))) */ __MINGW_ATTRIB_NONNULL(1)
    638 int wscanf(const wchar_t *__format, ...)
    639 {
    640   register int __retval;
    641   __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format );
    642   __retval = __mingw_vwscanf( __format, __local_argv );
    643   __builtin_va_end( __local_argv );
    644   return __retval;
    645 }
    646 
    647 __mingw_ovr
    648 /* __attribute__((__format__ (gnu_wscanf, 2, 3))) */ __MINGW_ATTRIB_NONNULL(2)
    649 int fwscanf(FILE *__stream, const wchar_t *__format, ...)
    650 {
    651   register int __retval;
    652   __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format );
    653   __retval = __mingw_vfwscanf( __stream, __format, __local_argv );
    654   __builtin_va_end( __local_argv );
    655   return __retval;
    656 }
    657 
    658 #ifndef __NO_ISOCEXT  /* externs in libmingwex.a */
    659 __mingw_ovr
    660 /* __attribute__((__format__ (gnu_wscanf, 2, 0))) */ __MINGW_ATTRIB_NONNULL(2)
    661 int vswscanf (const wchar_t * __restrict__ __source, const wchar_t * __restrict__ __format, __builtin_va_list __local_argv)
    662 {
    663   return __mingw_vswscanf( __source, __format, __local_argv );
    664 }
    665 
    666 __mingw_ovr
    667 /* __attribute__((__format__ (gnu_wscanf, 1, 0))) */ __MINGW_ATTRIB_NONNULL(1)
    668 int vwscanf(const wchar_t *__format,  __builtin_va_list __local_argv)
    669 {
    670   return __mingw_vwscanf( __format, __local_argv );
    671 }
    672 
    673 __mingw_ovr
    674 /* __attribute__((__format__ (gnu_wscanf, 2, 0))) */ __MINGW_ATTRIB_NONNULL(2)
    675 int vfwscanf (FILE *__stream,  const wchar_t *__format, __builtin_va_list __local_argv)
    676 {
    677   return __mingw_vfwscanf( __stream, __format, __local_argv );
    678 }
    679 #endif /* __NO_ISOCEXT */
    680 
    681 
    682 
    683 __mingw_ovr
    684 /* __attribute__((__format__ (gnu_wprintf, 2, 3))) */ __MINGW_ATTRIB_NONNULL(2)
    685 int fwprintf (FILE *__stream, const wchar_t *__format, ...)
    686 {
    687   register int __retval;
    688   __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format );
    689   __retval = __mingw_vfwprintf( __stream, __format, __local_argv );
    690   __builtin_va_end( __local_argv );
    691   return __retval;
    692 }
    693 
    694 __mingw_ovr
    695 /* __attribute__((__format__ (gnu_wprintf, 1, 2))) */ __MINGW_ATTRIB_NONNULL(1)
    696 int wprintf (const wchar_t *__format, ...)
    697 {
    698   register int __retval;
    699   __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format );
    700   __retval = __mingw_vwprintf( __format, __local_argv );
    701   __builtin_va_end( __local_argv );
    702   return __retval;
    703 }
    704 
    705 __mingw_ovr
    706 /* __attribute__((__format__ (gnu_wprintf, 2, 0))) */ __MINGW_ATTRIB_NONNULL(2)
    707 int vfwprintf (FILE *__stream, const wchar_t *__format, __builtin_va_list __local_argv)
    708 {
    709   return __mingw_vfwprintf( __stream, __format, __local_argv );
    710 }
    711 
    712 __mingw_ovr
    713 /* __attribute__((__format__ (gnu_wprintf, 1, 0))) */ __MINGW_ATTRIB_NONNULL(1)
    714 int vwprintf (const wchar_t *__format, __builtin_va_list __local_argv)
    715 {
    716   return __mingw_vwprintf( __format, __local_argv );
    717 }
    718 
    719 #ifndef __NO_ISOCEXT  /* externs in libmingwex.a */
    720 __mingw_ovr
    721 /* __attribute__((__format__ (gnu_wprintf, 3, 4))) */ __MINGW_ATTRIB_NONNULL(3)
    722 int snwprintf (wchar_t *__stream, size_t __n, const wchar_t *__format, ...)
    723 {
    724   register int __retval;
    725   __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format );
    726   __retval = __mingw_vsnwprintf( __stream, __n, __format, __local_argv );
    727   __builtin_va_end( __local_argv );
    728   return __retval;
    729 }
    730 
    731 __mingw_ovr
    732 /* __attribute__((__format__ (gnu_wprintf, 3, 0))) */ __MINGW_ATTRIB_NONNULL(3)
    733 int vsnwprintf (wchar_t *__stream, size_t __n, const wchar_t *__format, __builtin_va_list __local_argv)
    734 {
    735   return __mingw_vsnwprintf( __stream, __n, __format, __local_argv );
    736 }
    737 #endif /* __NO_ISOCEXT */
    738 
    739 #else /* !__USE_MINGW_ANSI_STDIO */
    740 
    741   int __cdecl fwscanf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
    742   int __cdecl swscanf(const wchar_t * __restrict__ _Src,const wchar_t * __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
    743   int __cdecl wscanf(const wchar_t * __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
    744 #ifndef __NO_ISOCEXT  /* externs in libmingwex.a */
    745   int __cdecl __ms_vwscanf (const wchar_t * __restrict__ , va_list);
    746   int __cdecl __ms_vfwscanf (FILE * __restrict__ ,const wchar_t * __restrict__ ,va_list);
    747   int __cdecl __ms_vswscanf (const wchar_t * __restrict__ ,const wchar_t * __restrict__ ,va_list);
    748 
    749   __mingw_ovr
    750   __MINGW_ATTRIB_NONNULL(2)
    751   int vfwscanf (FILE *__stream,  const wchar_t *__format, __builtin_va_list __local_argv)
    752   {
    753     return __ms_vfwscanf (__stream, __format, __local_argv);
    754   }
    755 
    756   __mingw_ovr
    757   __MINGW_ATTRIB_NONNULL(2)
    758   int vswscanf (const wchar_t * __restrict__ __source, const wchar_t * __restrict__ __format, __builtin_va_list __local_argv)
    759   {
    760     return __ms_vswscanf( __source, __format, __local_argv );
    761   }
    762   __mingw_ovr
    763   __MINGW_ATTRIB_NONNULL(1)
    764   int vwscanf(const wchar_t *__format,  __builtin_va_list __local_argv)
    765   {
    766     return __ms_vwscanf (__format, __local_argv);
    767   }
    768 
    769 #endif /* __NO_ISOCEXT */
    770 
    771   int __cdecl fwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...);
    772   int __cdecl wprintf(const wchar_t * __restrict__ _Format,...);
    773   int __cdecl vfwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,va_list _ArgList);
    774   int __cdecl vwprintf(const wchar_t * __restrict__ _Format,va_list _ArgList);
    775 #endif /* __USE_MINGW_ANSI_STDIO */
    776 
    777 #ifndef WEOF
    778 #define WEOF (wint_t)(0xFFFF)
    779 #endif
    780 
    781 #ifdef _POSIX_
    782   _CRTIMP FILE *__cdecl _wfsopen(const wchar_t *_Filename,const wchar_t *_Mode);
    783 #else
    784   _CRTIMP FILE *__cdecl _wfsopen(const wchar_t *_Filename,const wchar_t *_Mode,int _ShFlag);
    785 #endif
    786 
    787   wint_t __cdecl fgetwc(FILE *_File);
    788   _CRTIMP wint_t __cdecl _fgetwchar(void);
    789   wint_t __cdecl fputwc(wchar_t _Ch,FILE *_File);
    790   _CRTIMP wint_t __cdecl _fputwchar(wchar_t _Ch);
    791   wint_t __cdecl getwc(FILE *_File);
    792   wint_t __cdecl getwchar(void);
    793   wint_t __cdecl putwc(wchar_t _Ch,FILE *_File);
    794   wint_t __cdecl putwchar(wchar_t _Ch);
    795   wint_t __cdecl ungetwc(wint_t _Ch,FILE *_File);
    796   wchar_t *__cdecl fgetws(wchar_t * __restrict__ _Dst,int _SizeInWords,FILE * __restrict__ _File);
    797   int __cdecl fputws(const wchar_t * __restrict__ _Str,FILE * __restrict__ _File);
    798   _CRTIMP wchar_t *__cdecl _getws(wchar_t *_String) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
    799   _CRTIMP int __cdecl _putws(const wchar_t *_Str);
    800 
    801   _CRTIMP int __cdecl _scwprintf(const wchar_t * __restrict__ _Format,...);
    802   _CRTIMP int __cdecl _swprintf_c(wchar_t * __restrict__ _DstBuf,size_t _SizeInWords,const wchar_t * __restrict__ _Format,...);
    803   _CRTIMP int __cdecl _vswprintf_c(wchar_t * __restrict__ _DstBuf,size_t _SizeInWords,const wchar_t * __restrict__ _Format,va_list _ArgList);
    804   _CRTIMP int __cdecl _snwprintf(wchar_t * __restrict__ _Dest,size_t _Count,const wchar_t * __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
    805   _CRTIMP int __cdecl _vsnwprintf(wchar_t * __restrict__ _Dest,size_t _Count,const wchar_t * __restrict__ _Format,va_list _Args) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
    806 
    807 #ifndef __NO_ISOCEXT  /* externs in libmingwex.a */
    808 
    809 #if !defined (__USE_MINGW_ANSI_STDIO) || __USE_MINGW_ANSI_STDIO == 0
    810 #pragma push_macro("snwprintf")
    811 #pragma push_macro("vsnwprintf")
    812 # undef snwprintf
    813 # undef vsnwprintf
    814   int __cdecl __ms_snwprintf (wchar_t * __restrict__ s, size_t n, const wchar_t * __restrict__ format, ...);
    815   int __cdecl __ms_vsnwprintf (wchar_t * __restrict__ , size_t, const wchar_t * __restrict__ , va_list);
    816   __mingw_ovr
    817   int snwprintf (wchar_t * __restrict__ s, size_t n, const wchar_t * __restrict__ format, ...)
    818   {
    819     int r;
    820     va_list argp;
    821     __builtin_va_start (argp, format);
    822     r = _vsnwprintf (s, n, format, argp);
    823     __builtin_va_end (argp);
    824     return r;
    825   }
    826   __mingw_ovr
    827   int __cdecl vsnwprintf (wchar_t * __restrict__ s, size_t n, const wchar_t * __restrict__ format, va_list arg)
    828   {
    829     return _vsnwprintf(s,n,format,arg);
    830   }
    831 #pragma pop_macro ("vsnwprintf")
    832 #pragma pop_macro ("snwprintf")
    833 #endif
    834 
    835 #endif /* ! __NO_ISOCEXT */
    836   _CRTIMP int __cdecl _swprintf(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Format,...);
    837   _CRTIMP int __cdecl _vswprintf(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Format,va_list _Args);
    838 
    839 #ifndef RC_INVOKED
    840 #include <swprintf.inl>
    841 #endif
    842 
    843 #ifdef _CRT_NON_CONFORMING_SWPRINTFS
    844 #ifndef __cplusplus
    845 #define _swprintf_l __swprintf_l
    846 #define _vswprintf_l __vswprintf_l
    847 #endif
    848 #endif
    849 
    850   _CRTIMP wchar_t *__cdecl _wtempnam(const wchar_t *_Directory,const wchar_t *_FilePrefix);
    851   _CRTIMP int __cdecl _vscwprintf(const wchar_t * __restrict__ _Format,va_list _ArgList);
    852   _CRTIMP int __cdecl _snwscanf(const wchar_t * __restrict__ _Src,size_t _MaxCount,const wchar_t * __restrict__ _Format,...);
    853   _CRTIMP FILE *__cdecl _wfdopen(int _FileHandle ,const wchar_t *_Mode);
    854   _CRTIMP FILE *__cdecl _wfopen(const wchar_t * __restrict__ _Filename,const wchar_t *__restrict__  _Mode) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
    855   _CRTIMP FILE *__cdecl _wfreopen(const wchar_t * __restrict__ _Filename,const wchar_t * __restrict__ _Mode,FILE * __restrict__ _OldFile) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
    856 
    857 #ifndef _CRT_WPERROR_DEFINED
    858 #define _CRT_WPERROR_DEFINED
    859   _CRTIMP void __cdecl _wperror(const wchar_t *_ErrMsg);
    860 #endif
    861   _CRTIMP FILE *__cdecl _wpopen(const wchar_t *_Command,const wchar_t *_Mode);
    862 #if !defined(NO_OLDNAMES) && !defined(wpopen)
    863 #define wpopen	_wpopen
    864 #endif
    865 
    866   _CRTIMP int __cdecl _wremove(const wchar_t *_Filename);
    867   _CRTIMP wchar_t *__cdecl _wtmpnam(wchar_t *_Buffer);
    868   _CRTIMP wint_t __cdecl _fgetwc_nolock(FILE *_File);
    869   _CRTIMP wint_t __cdecl _fputwc_nolock(wchar_t _Ch,FILE *_File);
    870   _CRTIMP wint_t __cdecl _ungetwc_nolock(wint_t _Ch,FILE *_File);
    871 
    872 #undef _CRT_GETPUTWCHAR_NOINLINE
    873 
    874 #if !defined(__cplusplus) || defined(_CRT_GETPUTWCHAR_NOINLINE) || defined (__CRT__NO_INLINE)
    875 #define getwchar() fgetwc(stdin)
    876 #define putwchar(_c) fputwc((_c),stdout)
    877 #else
    878   __CRT_INLINE wint_t __cdecl getwchar() {return (fgetwc(stdin)); }
    879   __CRT_INLINE wint_t __cdecl putwchar(wchar_t _C) {return (fputwc(_C,stdout)); }
    880 #endif
    881 
    882 #define getwc(_stm) fgetwc(_stm)
    883 #define putwc(_c,_stm) fputwc(_c,_stm)
    884 #define _putwc_nolock(_c,_stm) _fputwc_nolock(_c,_stm)
    885 #define _getwc_nolock(_c) _fgetwc_nolock(_c)
    886 #endif
    887 
    888 #define _STDIO_DEFINED
    889 #endif
    890 
    891 #define _fgetc_nolock(_stream) (--(_stream)->_cnt >= 0 ? 0xff & *(_stream)->_ptr++ : _filbuf(_stream))
    892 #define _fputc_nolock(_c,_stream) (--(_stream)->_cnt >= 0 ? 0xff & (*(_stream)->_ptr++ = (char)(_c)) : _flsbuf((_c),(_stream)))
    893 #define _getc_nolock(_stream) _fgetc_nolock(_stream)
    894 #define _putc_nolock(_c,_stream) _fputc_nolock(_c,_stream)
    895 #define _getchar_nolock() _getc_nolock(stdin)
    896 #define _putchar_nolock(_c) _putc_nolock((_c),stdout)
    897 #define _getwchar_nolock() _getwc_nolock(stdin)
    898 #define _putwchar_nolock(_c) _putwc_nolock((_c),stdout)
    899 
    900   _CRTIMP void __cdecl _lock_file(FILE *_File);
    901   _CRTIMP void __cdecl _unlock_file(FILE *_File);
    902   _CRTIMP int __cdecl _fclose_nolock(FILE *_File);
    903   _CRTIMP int __cdecl _fflush_nolock(FILE *_File);
    904   _CRTIMP size_t __cdecl _fread_nolock(void * __restrict__ _DstBuf,size_t _ElementSize,size_t _Count,FILE * __restrict__ _File);
    905   _CRTIMP int __cdecl _fseek_nolock(FILE *_File,long _Offset,int _Origin);
    906   _CRTIMP long __cdecl _ftell_nolock(FILE *_File);
    907   __MINGW_EXTENSION _CRTIMP int __cdecl _fseeki64_nolock(FILE *_File,__int64 _Offset,int _Origin);
    908   __MINGW_EXTENSION _CRTIMP __int64 __cdecl _ftelli64_nolock(FILE *_File);
    909   _CRTIMP size_t __cdecl _fwrite_nolock(const void * __restrict__ _DstBuf,size_t _Size,size_t _Count,FILE * __restrict__ _File);
    910   _CRTIMP int __cdecl _ungetc_nolock(int _Ch,FILE *_File);
    911 
    912 #if !defined(NO_OLDNAMES) || !defined(_POSIX)
    913 #define P_tmpdir _P_tmpdir
    914 #define SYS_OPEN _SYS_OPEN
    915 
    916   char *__cdecl tempnam(const char *_Directory,const char *_FilePrefix) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    917   int __cdecl fcloseall(void) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    918   FILE *__cdecl fdopen(int _FileHandle,const char *_Format) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    919   int __cdecl fgetchar(void) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    920   int __cdecl fileno(FILE *_File) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    921   int __cdecl flushall(void) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    922   int __cdecl fputchar(int _Ch) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    923   int __cdecl getw(FILE *_File) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    924   int __cdecl putw(int _Ch,FILE *_File) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    925   int __cdecl rmtmp(void) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
    926 #endif
    927 
    928 #ifndef __MINGW_MBWC_CONVERT_DEFINED
    929 #define __MINGW_MBWC_CONVERT_DEFINED
    930 
    931 /**
    932  * __mingw_str_wide_utf8
    933  * Converts a null terminated UCS-2 string to a multibyte (UTF-8) equivalent.
    934  * Caller is supposed to free allocated buffer with __mingw_str_free().
    935  * @param[in] wptr Pointer to wide string.
    936  * @param[out] mbptr Pointer to multibyte string.
    937  * @param[out] buflen Optional parameter for length of allocated buffer.
    938  * @return Number of characters converted, 0 for failure.
    939  *
    940  * WideCharToMultiByte - http://msdn.microsoft.com/en-us/library/dd374130(VS.85).aspx
    941  */
    942 int __cdecl __mingw_str_wide_utf8 (const wchar_t * const wptr, char **mbptr, size_t * buflen);
    943 
    944 /**
    945  * __mingw_str_utf8_wide
    946  * Converts a null terminated UTF-8 string to a UCS-2 equivalent.
    947  * Caller is supposed to free allocated buffer with __mingw_str_free().
    948  * @param[out] mbptr Pointer to multibyte string.
    949  * @param[in] wptr Pointer to wide string.
    950  * @param[out] buflen Optional parameter for length of allocated buffer.
    951  * @return Number of characters converted, 0 for failure.
    952  *
    953  * MultiByteToWideChar - http://msdn.microsoft.com/en-us/library/dd319072(VS.85).aspx
    954  */
    955 
    956 int __cdecl __mingw_str_utf8_wide (const char *const mbptr, wchar_t ** wptr, size_t * buflen);
    957 
    958 /**
    959  * __mingw_str_free
    960  * Frees buffer create by __mingw_str_wide_utf8 and __mingw_str_utf8_wide.
    961  * @param[in] ptr memory block to free.
    962  *
    963  */
    964 
    965 void __cdecl __mingw_str_free(void *ptr);
    966 
    967 #endif /* __MINGW_MBWC_CONVERT_DEFINED */
    968 
    969 #ifndef _WSPAWN_DEFINED
    970 #define _WSPAWN_DEFINED
    971   _CRTIMP intptr_t __cdecl _wspawnl(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...);
    972   _CRTIMP intptr_t __cdecl _wspawnle(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...);
    973   _CRTIMP intptr_t __cdecl _wspawnlp(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...);
    974   _CRTIMP intptr_t __cdecl _wspawnlpe(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...);
    975   _CRTIMP intptr_t __cdecl _wspawnv(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList);
    976   _CRTIMP intptr_t __cdecl _wspawnve(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList,const wchar_t *const *_Env);
    977   _CRTIMP intptr_t __cdecl _wspawnvp(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList);
    978   _CRTIMP intptr_t __cdecl _wspawnvpe(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList,const wchar_t *const *_Env);
    979 #endif
    980 
    981 #ifndef _P_WAIT
    982 #define _P_WAIT 0
    983 #define _P_NOWAIT 1
    984 #define _OLD_P_OVERLAY 2
    985 #define _P_NOWAITO 3
    986 #define _P_DETACH 4
    987 #define _P_OVERLAY 2
    988 
    989 #define _WAIT_CHILD 0
    990 #define _WAIT_GRANDCHILD 1
    991 #endif
    992 
    993 #ifndef _SPAWNV_DEFINED
    994 #define _SPAWNV_DEFINED
    995   _CRTIMP intptr_t __cdecl _spawnv(int _Mode,const char *_Filename,const char *const *_ArgList);
    996   _CRTIMP intptr_t __cdecl _spawnve(int _Mode,const char *_Filename,const char *const *_ArgList,const char *const *_Env);
    997   _CRTIMP intptr_t __cdecl _spawnvp(int _Mode,const char *_Filename,const char *const *_ArgList);
    998   _CRTIMP intptr_t __cdecl _spawnvpe(int _Mode,const char *_Filename,const char *const *_ArgList,const char *const *_Env);
    999 #endif
   1000 
   1001 #ifdef __cplusplus
   1002 }
   1003 #endif
   1004 
   1005 #pragma pack(pop)
   1006 
   1007 #include <sec_api/stdio_s.h>
   1008 
   1009 #include <_mingw_print_pop.h>
   1010 
   1011 #endif
   1012