2011/11/3 Rafaël Carré <[email protected]>:
> ---
>  trunk/mingw-w64-headers/crt/_mingw_print_pop.h  |    9 --
>  trunk/mingw-w64-headers/crt/_mingw_print_push.h |    6 --
>  trunk/mingw-w64-headers/crt/stdio.h             |  102 
> +++++++++++++++++++----
>  3 files changed, 87 insertions(+), 30 deletions(-)
>
> diff --git a/trunk/mingw-w64-headers/crt/_mingw_print_pop.h 
> b/trunk/mingw-w64-headers/crt/_mingw_print_pop.h
> index 474e6cf..56aa8b0 100644
> --- a/trunk/mingw-w64-headers/crt/_mingw_print_pop.h
> +++ b/trunk/mingw-w64-headers/crt/_mingw_print_pop.h
> @@ -6,15 +6,6 @@
>
>  /* Define __mingw_<printf> macros.  */
>  #if defined(__USE_MINGW_ANSI_STDIO) && (defined(_INC_STDIO) || 
> defined(_WSTDIO_DEFINED)) && ((__USE_MINGW_ANSI_STDIO + 0) != 0)
> -#ifdef _INC_STDIO
> -#define sscanf __mingw_sscanf
> -#define vsscanf __mingw_vsscanf
> -#define scanf __mingw_scanf
> -#define vscanf __mingw_vscanf
> -#define fscanf __mingw_fscanf
> -#define vfscanf __mingw_vfscanf
> -
> -#endif
>
>  #ifdef _WSTDIO_DEFINED
>
> diff --git a/trunk/mingw-w64-headers/crt/_mingw_print_push.h 
> b/trunk/mingw-w64-headers/crt/_mingw_print_push.h
> index 26430f9..29db3a8 100644
> --- a/trunk/mingw-w64-headers/crt/_mingw_print_push.h
> +++ b/trunk/mingw-w64-headers/crt/_mingw_print_push.h
> @@ -6,12 +6,6 @@
>
>  /* Undefine __mingw_<printf> macros.  */
>  #if defined(__USE_MINGW_ANSI_STDIO) && ((__USE_MINGW_ANSI_STDIO + 0) != 0)
> -#undef sscanf
> -#undef vsscanf
> -#undef scanf
> -#undef vscanf
> -#undef fscanf
> -#undef vfscanf
>
>  #undef swscanf
>  #undef vswscanf
> diff --git a/trunk/mingw-w64-headers/crt/stdio.h 
> b/trunk/mingw-w64-headers/crt/stdio.h
> index 84a6b3b..5873b48 100644
> --- a/trunk/mingw-w64-headers/crt/stdio.h
> +++ b/trunk/mingw-w64-headers/crt/stdio.h
> @@ -137,6 +137,25 @@ extern FILE (* __MINGW_IMP_SYMBOL(_iob))[];        /* A 
> pointer to an array of FILE */
>
>  #ifndef _STDIO_DEFINED
>  extern
> +  __attribute__((__format__ (gnu_printf, 2, 3))) __MINGW_ATTRIB_NONNULL(2)
> +  int __cdecl __mingw_sscanf(const char * __restrict__ _Src,const char * 
> __restrict__ _Format,...);
> +extern
> +  __attribute__((__format__ (gnu_printf, 2, 0))) __MINGW_ATTRIB_NONNULL(2)
> +  int __cdecl __mingw_vsscanf (const char * __restrict__ _Str,const char * 
> __restrict__ Format,va_list argp);
> +extern
> +  __attribute__((__format__ (gnu_printf, 1, 2))) __MINGW_ATTRIB_NONNULL(1)
> +  int __cdecl __mingw_scanf(const char * __restrict__ _Format,...);
> +extern
> +  __attribute__((__format__ (gnu_printf, 1, 0))) __MINGW_ATTRIB_NONNULL(1)
> +  int __cdecl __mingw_vscanf(const char * __restrict__ Format, va_list argp);
> +extern
> +  __attribute__((__format__ (gnu_printf, 2, 3))) __MINGW_ATTRIB_NONNULL(2)
> +  int __cdecl __mingw_fscanf(FILE * __restrict__ _File,const char * 
> __restrict__ _Format,...);
> +extern
> +  __attribute__((__format__ (gnu_printf, 2, 0))) __MINGW_ATTRIB_NONNULL(2)
> +  int __cdecl __mingw_vfscanf (FILE * __restrict__ fp, const char * 
> __restrict__ Format,va_list argp);
> +
> +extern
>   __attribute__((__format__ (gnu_printf, 3, 0))) __MINGW_ATTRIB_NONNULL(3)
>   int __cdecl __mingw_vsnprintf(char * __restrict__ _DstBuf,size_t 
> _MaxCount,const char * __restrict__ _Format,
>                                va_list _ArgList);
> @@ -172,6 +191,65 @@ extern
>  /*
>  * User has expressed a preference for C99 conformance...
>  */
> +
> +__forceinline
> +__attribute__((__format__ (gnu_printf, 2, 3))) __MINGW_ATTRIB_NONNULL(2)
> +int sscanf(const char *__source, const char *__format, ...)
> +{
> +  register int __retval;
> +  __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format 
> );
> +  __retval = __mingw_vsscanf( __source, __format, __local_argv );
> +  __builtin_va_end( __local_argv );
> +  return __retval;
> +}
> +
> +__forceinline
> +__attribute__((__format__ (gnu_printf, 1, 2))) __MINGW_ATTRIB_NONNULL(1)
> +int scanf(const char *__format, ...)
> +{
> +  register int __retval;
> +  __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format 
> );
> +  __retval = __mingw_vscanf( __format, __local_argv );
> +  __builtin_va_end( __local_argv );
> +  return __retval;
> +}
> +
> +__forceinline
> +__attribute__((__format__ (gnu_printf, 2, 3))) __MINGW_ATTRIB_NONNULL(2)
> +int fscanf(FILE *__stream, const char *__format, ...)
> +{
> +  register int __retval;
> +  __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format 
> );
> +  __retval = __mingw_vfscanf( __stream, __format, __local_argv );
> +  __builtin_va_end( __local_argv );
> +  return __retval;
> +}
> +
> +#ifndef __NO_ISOCEXT  /* externs in libmingwex.a */
> +__forceinline
> +__attribute__((__format__ (gnu_printf, 2, 0))) __MINGW_ATTRIB_NONNULL(2)
> +int vsscanf (const char *__source, const char *__format, __builtin_va_list 
> __local_argv)
> +{
> +  return __mingw_vsscanf( __source, __format, __local_argv );
> +}
> +
> +__forceinline
> +__attribute__((__format__ (gnu_printf, 1, 0))) __MINGW_ATTRIB_NONNULL(1)
> +int vscanf(const char *__format,  __builtin_va_list __local_argv)
> +{
> +  return __mingw_vscanf( __format, __local_argv );
> +}
> +
> +__forceinline
> +__attribute__((__format__ (gnu_printf, 2, 0))) __MINGW_ATTRIB_NONNULL(2)
> +int vfscanf (FILE *__stream,  const char *__format, __builtin_va_list 
> __local_argv)
> +{
> +  return __mingw_vfscanf( __stream, __format, __local_argv );
> +}
> +#endif /* __NO_ISOCEXT */
> +
> +
> +
>  __forceinline
>  __attribute__((__format__ (gnu_printf, 2, 3))) __MINGW_ATTRIB_NONNULL(2)
>  int fprintf (FILE *__stream, const char *__format, ...)
> @@ -274,6 +352,15 @@ int vsnprintf (char *__stream, size_t __n, const char 
> *__format, __builtin_va_li
>   int __cdecl vfprintf(FILE * __restrict__ _File,const char * __restrict__ 
> _Format,va_list _ArgList);
>   int __cdecl vprintf(const char * __restrict__ _Format,va_list _ArgList);
>   int __cdecl vsprintf(char * __restrict__ _Dest,const char * __restrict__ 
> _Format,va_list _Args) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
> +
> +  int __cdecl fscanf(FILE * __restrict__ _File,const char * __restrict__ 
> _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
> +  int __cdecl scanf(const char * __restrict__ _Format,...) 
> __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
> +  int __cdecl sscanf(const char * __restrict__ _Src,const char * 
> __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
> +#ifndef __NO_ISOCEXT  /* externs in libmingwex.a */
> +  int __cdecl vscanf(const char * __restrict__ Format, va_list argp);
> +  int __cdecl vfscanf (FILE * __restrict__ fp, const char * __restrict__ 
> Format,va_list argp);
> +  int __cdecl vsscanf (const char * __restrict__ _Str,const char * 
> __restrict__ Format,va_list argp);
> +#endif
>  #endif /* __USE_MINGW_ANSI_STDIO */
>
>   _CRTIMP int __cdecl _filbuf(FILE *_File);
> @@ -312,7 +399,6 @@ int vsnprintf (char *__stream, size_t __n, const char 
> *__format, __builtin_va_li
>   int __cdecl fputs(const char * __restrict__ _Str,FILE * __restrict__ _File);
>   size_t __cdecl fread(void * __restrict__ _DstBuf,size_t _ElementSize,size_t 
> _Count,FILE * __restrict__ _File);
>   FILE *__cdecl freopen(const char * __restrict__ _Filename,const char * 
> __restrict__ _Mode,FILE * __restrict__ _File) 
> __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
> -  int __cdecl fscanf(FILE * __restrict__ _File,const char * __restrict__ 
> _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
>   int __cdecl _fscanf_l(FILE * __restrict__ _File,const char * __restrict__ 
> _Format,_locale_t locale,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
>   int __cdecl fsetpos(FILE *_File,const fpos_t *_Pos);
>   int __cdecl fsetpos64(FILE *_File,const fpos_t *_Pos); /* fsetpos already 
> 64bit */
> @@ -379,7 +465,6 @@ int vsnprintf (char *__stream, size_t __n, const char 
> *__format, __builtin_va_li
>  #endif
>   void __cdecl rewind(FILE *_File);
>   _CRTIMP int __cdecl _rmtmp(void);
> -  int __cdecl scanf(const char * __restrict__ _Format,...) 
> __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
>   int __cdecl _scanf_l(const char * __restrict__ format,_locale_t locale,... 
> ) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
>   void __cdecl setbuf(FILE * __restrict__ _File,char * __restrict__ _Buffer) 
> __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
>   _CRTIMP int __cdecl _setmaxstdio(int _Max);
> @@ -393,7 +478,6 @@ int vsnprintf (char *__stream, size_t __n, const char 
> *__format, __builtin_va_li
>  #endif
>   int __cdecl setvbuf(FILE * __restrict__ _File,char * __restrict__ _Buf,int 
> _Mode,size_t _Size);
>   _CRTIMP int __cdecl _scprintf(const char * __restrict__ _Format,...);
> -  int __cdecl sscanf(const char * __restrict__ _Src,const char * 
> __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
>   int __cdecl _sscanf_l(const char * __restrict__ buffer,const char * 
> __restrict__ format,_locale_t locale,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
>   _CRTIMP int __cdecl _snscanf(const char * __restrict__ _Src,size_t 
> _MaxCount,const char * __restrict__ _Format,...) 
> __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
>   _CRTIMP int __cdecl _snscanf_l(const char * __restrict__ input,size_t 
> length,const char * __restrict__ format,_locale_t locale,...) 
> __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
> @@ -430,22 +514,10 @@ int vsnprintf (char *__stream, size_t __n, const char 
> *__format, __builtin_va_li
>  #pragma pop_macro ("snprintf")
>  #endif
>
> -#ifndef __NO_ISOCEXT  /* externs in libmingwex.a */
> -  int __cdecl vscanf(const char * __restrict__ Format, va_list argp);
> -  int __cdecl vfscanf (FILE * __restrict__ fp, const char * __restrict__ 
> Format,va_list argp);
> -  int __cdecl vsscanf (const char * __restrict__ _Str,const char * 
> __restrict__ Format,va_list argp);
> -#endif
>   _CRTIMP int __cdecl _vscprintf(const char * __restrict__ _Format,va_list 
> _ArgList);
>   _CRTIMP int __cdecl _set_printf_count_output(int _Value);
>   _CRTIMP int __cdecl _get_printf_count_output(void);
>
> -  int __cdecl __mingw_sscanf(const char * __restrict__ _Src,const char * 
> __restrict__ _Format,...);
> -  int __cdecl __mingw_vsscanf (const char * __restrict__ _Str,const char * 
> __restrict__ Format,va_list argp);
> -  int __cdecl __mingw_scanf(const char * __restrict__ _Format,...);
> -  int __cdecl __mingw_vscanf(const char * __restrict__ Format, va_list argp);
> -  int __cdecl __mingw_fscanf(FILE * __restrict__ _File,const char * 
> __restrict__ _Format,...);
> -  int __cdecl __mingw_vfscanf (FILE * __restrict__ fp, const char * 
> __restrict__ Format,va_list argp);
> -
>  #ifndef _WSTDIO_DEFINED
>  #define _WSTDIO_DEFINED
>
> --
> 1.7.5.4

Patch looks ok.  Could you please put diff as attachment and provide a
changelog for it.

Thanks,
Kai

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to