Rafaël Carré <[email protected]>
* _mingw_print_push.h: Remove wprintf-defines.
* _mingw_print_pop.h: Likewise.
* stdio.h: Replace macro-wprintf override via alias.
* wchar.h: Likewise.
--
Rafaël Carré
Index: _mingw_print_push.h
===================================================================
--- _mingw_print_push.h (révision 4569)
+++ _mingw_print_push.h (copie de travail)
@@ -6,15 +6,6 @@
/* Undefine __mingw_<printf> macros. */
#if defined(__USE_MINGW_ANSI_STDIO) && ((__USE_MINGW_ANSI_STDIO + 0) != 0)
-#undef fwprintf
-#undef wprintf
-#undef vfwprintf
-#undef vwprintf
-#undef swprintf
-#undef vswprintf
-#undef snwprintf
-#undef vsnwprintf
-
#undef sscanf
#undef vsscanf
#undef scanf
Index: _mingw_print_pop.h
===================================================================
--- _mingw_print_pop.h (révision 4569)
+++ _mingw_print_pop.h (copie de travail)
@@ -17,24 +17,7 @@
#endif
#ifdef _WSTDIO_DEFINED
-#undef fwprintf
-#undef wprintf
-#undef vfwprintf
-#undef vwprintf
-#undef swprintf
-#undef vswprintf
-#undef snwprintf
-#undef vsnwprintf
-#define fwprintf __mingw_fwprintf
-#define wprintf __mingw_wprintf
-#define vfwprintf __mingw_vfwprintf
-#define vwprintf __mingw_vwprintf
-#define swprintf __mingw_swprintf
-#define vswprintf __mingw_vswprintf
-#define snwprintf __mingw_snwprintf
-#define vsnwprintf __mingw_vsnwprintf
-
#undef swscanf
#undef vswscanf
#undef wscanf
Index: stdio.h
===================================================================
--- stdio.h (révision 4569)
+++ stdio.h (copie de travail)
@@ -449,6 +449,119 @@
#ifndef _WSTDIO_DEFINED
#define _WSTDIO_DEFINED
+ int __cdecl __mingw_fwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...);
+ int __cdecl __mingw_wprintf(const wchar_t * __restrict__ _Format,...);
+ int __cdecl __mingw_vfwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,va_list _ArgList);
+ int __cdecl __mingw_vwprintf(const wchar_t * __restrict__ _Format,va_list _ArgList);
+ int __cdecl __mingw_swprintf(wchar_t * __restrict__ , const wchar_t * __restrict__ , ...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
+ int __cdecl __mingw_vswprintf(wchar_t * __restrict__ , const wchar_t * __restrict__ ,va_list) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
+ int __cdecl __mingw_snwprintf (wchar_t * __restrict__ s, size_t n, const wchar_t * __restrict__ format, ...);
+ int __cdecl __mingw_vsnwprintf (wchar_t * __restrict__ , size_t, const wchar_t * __restrict__ , va_list);
+
+#if __USE_MINGW_ANSI_STDIO
+/*
+ * User has expressed a preference for C99 conformance...
+ */
+__forceinline
+__attribute__((__format__ (gnu_printf, 2, 3))) __MINGW_ATTRIB_NONNULL(2)
+int fwprintf (FILE *__stream, const wchar_t *__format, ...)
+{
+ register int __retval;
+ __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format );
+ __retval = __mingw_vfwprintf( __stream, __format, __local_argv );
+ __builtin_va_end( __local_argv );
+ return __retval;
+}
+
+__forceinline
+__attribute__((__format__ (gnu_printf, 1, 2))) __MINGW_ATTRIB_NONNULL(1)
+int wprintf (const wchar_t *__format, ...)
+{
+ register int __retval;
+ __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format );
+ __retval = __mingw_vwprintf( __format, __local_argv );
+ __builtin_va_end( __local_argv );
+ return __retval;
+}
+
+__forceinline
+__attribute__((__format__ (gnu_printf, 2, 3))) __MINGW_ATTRIB_NONNULL(2)
+int swprintf (wchar_t *__stream, const wchar_t *__format, ...)
+{
+ register int __retval;
+ __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format );
+ __retval = __mingw_vswprintf( __stream, __format, __local_argv );
+ __builtin_va_end( __local_argv );
+ return __retval;
+}
+
+__forceinline
+__attribute__((__format__ (gnu_printf, 2, 0))) __MINGW_ATTRIB_NONNULL(2)
+int vfwprintf (FILE *__stream, const wchar_t *__format, __builtin_va_list __local_argv)
+{
+ return __mingw_vfwprintf( __stream, __format, __local_argv );
+}
+
+__forceinline
+__attribute__((__format__ (gnu_printf, 1, 0))) __MINGW_ATTRIB_NONNULL(1)
+int vwprintf (const wchar_t *__format, __builtin_va_list __local_argv)
+{
+ return __mingw_vwprintf( __format, __local_argv );
+}
+
+__forceinline
+__attribute__((__format__ (gnu_printf, 2, 0))) __MINGW_ATTRIB_NONNULL(2)
+int vswprintf (wchar_t *__stream, const wchar_t *__format, __builtin_va_list __local_argv)
+{
+ return __mingw_vswprintf( __stream, __format, __local_argv );
+}
+
+#ifndef __NO_ISOCEXT /* externs in libmingwex.a */
+__forceinline
+__attribute__((__format__ (gnu_printf, 3, 4))) __MINGW_ATTRIB_NONNULL(3)
+int snwprintf (wchar_t *__stream, size_t __n, const wchar_t *__format, ...)
+{
+ register int __retval;
+ __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format );
+ __retval = __mingw_vsnwprintf( __stream, __n, __format, __local_argv );
+ __builtin_va_end( __local_argv );
+ return __retval;
+}
+
+__forceinline
+__attribute__((__format__ (gnu_printf, 3, 0))) __MINGW_ATTRIB_NONNULL(3)
+int vsnwprintf (wchar_t *__stream, size_t __n, const wchar_t *__format, __builtin_va_list __local_argv)
+{
+ return __mingw_vsnwprintf( __stream, __n, __format, __local_argv );
+}
+#endif /* __NO_ISOCEXT */
+
+#else /* !__USE_MINGW_ANSI_STDIO */
+ int __cdecl fwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...);
+ int __cdecl wprintf(const wchar_t * __restrict__ _Format,...);
+ int __cdecl vfwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,va_list _ArgList);
+ int __cdecl vwprintf(const wchar_t * __restrict__ _Format,va_list _ArgList);
+ _CRTIMP int __cdecl swprintf(wchar_t * __restrict__ , const wchar_t * __restrict__ , ...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
+ _CRTIMP int __cdecl vswprintf(wchar_t * __restrict__ , const wchar_t * __restrict__ ,va_list) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
+#ifndef __NO_ISOCEXT /* externs in libmingwex.a */
+#pragma push_macro("snwprintf")
+#pragma push_macro("vsnwprintf")
+# undef snwprintf
+# undef vsnwprintf
+ int __cdecl snwprintf (wchar_t * __restrict__ s, size_t n, const wchar_t * __restrict__ format, ...);
+ int __cdecl vsnwprintf (wchar_t * __restrict__ , size_t, const wchar_t * __restrict__ , va_list);
+#ifndef __CRT__NO_INLINE
+ __CRT_INLINE int __cdecl vsnwprintf (wchar_t * __restrict__ s, size_t n, const wchar_t * __restrict__ format, va_list arg)
+ {
+ return _vsnwprintf(s,n,format,arg);
+ }
+#endif /* !__CRT__NO_INLINE */
+#pragma pop_macro ("vsnwprintf")
+#pragma pop_macro ("snwprintf")
+#endif /* ! __NO_ISOCEXT */
+
+#endif /* __USE_MINGW_ANSI_STDIO */
+
#ifndef WEOF
#define WEOF (wint_t)(0xFFFF)
#endif
@@ -473,44 +586,14 @@
_CRTIMP wchar_t *__cdecl _getws(wchar_t *_String) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
_CRTIMP int __cdecl _putws(const wchar_t *_Str);
- int __cdecl fwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...);
- int __cdecl wprintf(const wchar_t * __restrict__ _Format,...);
- int __cdecl vfwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,va_list _ArgList);
- int __cdecl vwprintf(const wchar_t * __restrict__ _Format,va_list _ArgList);
- _CRTIMP int __cdecl swprintf(wchar_t * __restrict__ , const wchar_t * __restrict__ , ...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
- _CRTIMP int __cdecl vswprintf(wchar_t * __restrict__ , const wchar_t * __restrict__ ,va_list) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
-
- int __cdecl __mingw_fwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...);
- int __cdecl __mingw_wprintf(const wchar_t * __restrict__ _Format,...);
- int __cdecl __mingw_vfwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,va_list _ArgList);
- int __cdecl __mingw_vwprintf(const wchar_t * __restrict__ _Format,va_list _ArgList);
- int __cdecl __mingw_swprintf(wchar_t * __restrict__ , const wchar_t * __restrict__ , ...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
- int __cdecl __mingw_vswprintf(wchar_t * __restrict__ , const wchar_t * __restrict__ ,va_list) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
- int __cdecl __mingw_snwprintf (wchar_t * __restrict__ s, size_t n, const wchar_t * __restrict__ format, ...);
- int __cdecl __mingw_vsnwprintf (wchar_t * __restrict__ , size_t, const wchar_t * __restrict__ , va_list);
-
_CRTIMP int __cdecl _scwprintf(const wchar_t * __restrict__ _Format,...);
_CRTIMP int __cdecl _swprintf_l(wchar_t * __restrict__ buffer,size_t count,const wchar_t * __restrict__ format,_locale_t locale,... ) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
_CRTIMP int __cdecl _swprintf_c(wchar_t * __restrict__ _DstBuf,size_t _SizeInWords,const wchar_t * __restrict__ _Format,...);
_CRTIMP int __cdecl _vswprintf_c(wchar_t * __restrict__ _DstBuf,size_t _SizeInWords,const wchar_t * __restrict__ _Format,va_list _ArgList);
_CRTIMP int __cdecl _snwprintf(wchar_t * __restrict__ _Dest,size_t _Count,const wchar_t * __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
_CRTIMP int __cdecl _vsnwprintf(wchar_t * __restrict__ _Dest,size_t _Count,const wchar_t * __restrict__ _Format,va_list _Args) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
+
#ifndef __NO_ISOCEXT /* externs in libmingwex.a */
-#pragma push_macro("snwprintf")
-#pragma push_macro("vsnwprintf")
-# undef snwprintf
-# undef vsnwprintf
- int __cdecl snwprintf (wchar_t * __restrict__ s, size_t n, const wchar_t * __restrict__ format, ...);
- int __cdecl vsnwprintf (wchar_t * __restrict__ , size_t, const wchar_t * __restrict__ , va_list);
-#ifndef __CRT__NO_INLINE
- __CRT_INLINE int __cdecl vsnwprintf (wchar_t * __restrict__ s, size_t n, const wchar_t * __restrict__ format, va_list arg)
- {
- return _vsnwprintf(s,n,format,arg);
- }
-#endif /* !__CRT__NO_INLINE */
-#pragma pop_macro ("vsnwprintf")
-#pragma pop_macro ("snwprintf")
-
int __cdecl __mingw_swscanf(const wchar_t * __restrict__ _Src,const wchar_t * __restrict__ _Format,...);
int __cdecl __mingw_vswscanf (const wchar_t * __restrict__ _Str,const wchar_t * __restrict__ Format,va_list argp);
int __cdecl __mingw_wscanf(const wchar_t * __restrict__ _Format,...);
Index: wchar.h
===================================================================
--- wchar.h (révision 4569)
+++ wchar.h (copie de travail)
@@ -418,6 +418,120 @@
#ifndef _WSTDIO_DEFINED
#define _WSTDIO_DEFINED
+ int __cdecl __mingw_fwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...);
+ int __cdecl __mingw_wprintf(const wchar_t * __restrict__ _Format,...);
+ int __cdecl __mingw_vfwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,va_list _ArgList);
+ int __cdecl __mingw_vwprintf(const wchar_t * __restrict__ _Format,va_list _ArgList);
+ int __cdecl __mingw_swprintf(wchar_t * __restrict__ , const wchar_t * __restrict__ , ...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
+ int __cdecl __mingw_vswprintf(wchar_t * __restrict__ , const wchar_t * __restrict__ ,va_list) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
+ int __cdecl __mingw_snwprintf (wchar_t * __restrict__ s, size_t n, const wchar_t * __restrict__ format, ...);
+ int __cdecl __mingw_vsnwprintf (wchar_t * __restrict__ , size_t, const wchar_t * __restrict__ , va_list);
+
+#if __USE_MINGW_ANSI_STDIO
+/*
+ * User has expressed a preference for C99 conformance...
+ */
+__forceinline
+__attribute__((__format__ (gnu_printf, 2, 3))) __MINGW_ATTRIB_NONNULL(2)
+int fwprintf (FILE *__stream, const wchar_t *__format, ...)
+{
+ register int __retval;
+ __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format );
+ __retval = __mingw_vfwprintf( __stream, __format, __local_argv );
+ __builtin_va_end( __local_argv );
+ return __retval;
+}
+
+__forceinline
+__attribute__((__format__ (gnu_printf, 1, 2))) __MINGW_ATTRIB_NONNULL(1)
+int wprintf (const wchar_t *__format, ...)
+{
+ register int __retval;
+ __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format );
+ __retval = __mingw_vwprintf( __format, __local_argv );
+ __builtin_va_end( __local_argv );
+ return __retval;
+}
+
+__forceinline
+__attribute__((__format__ (gnu_printf, 2, 3))) __MINGW_ATTRIB_NONNULL(2)
+int swprintf (wchar_t *__stream, const wchar_t *__format, ...)
+{
+ register int __retval;
+ __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format );
+ __retval = __mingw_vswprintf( __stream, __format, __local_argv );
+ __builtin_va_end( __local_argv );
+ return __retval;
+}
+
+__forceinline
+__attribute__((__format__ (gnu_printf, 2, 0))) __MINGW_ATTRIB_NONNULL(2)
+int vfwprintf (FILE *__stream, const wchar_t *__format, __builtin_va_list __local_argv)
+{
+ return __mingw_vfwprintf( __stream, __format, __local_argv );
+}
+
+__forceinline
+__attribute__((__format__ (gnu_printf, 1, 0))) __MINGW_ATTRIB_NONNULL(1)
+int vwprintf (const wchar_t *__format, __builtin_va_list __local_argv)
+{
+ return __mingw_vwprintf( __format, __local_argv );
+}
+
+__forceinline
+__attribute__((__format__ (gnu_printf, 2, 0))) __MINGW_ATTRIB_NONNULL(2)
+int vswprintf (wchar_t *__stream, const wchar_t *__format, __builtin_va_list __local_argv)
+{
+ return __mingw_vswprintf( __stream, __format, __local_argv );
+}
+
+#ifndef __NO_ISOCEXT /* externs in libmingwex.a */
+__forceinline
+__attribute__((__format__ (gnu_printf, 3, 4))) __MINGW_ATTRIB_NONNULL(3)
+int snwprintf (wchar_t *__stream, size_t __n, const wchar_t *__format, ...)
+{
+ register int __retval;
+ __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format );
+ __retval = __mingw_vsnwprintf( __stream, __n, __format, __local_argv );
+ __builtin_va_end( __local_argv );
+ return __retval;
+}
+
+__forceinline
+__attribute__((__format__ (gnu_printf, 3, 0))) __MINGW_ATTRIB_NONNULL(3)
+int vsnwprintf (wchar_t *__stream, size_t __n, const wchar_t *__format, __builtin_va_list __local_argv)
+{
+ return __mingw_vsnwprintf( __stream, __n, __format, __local_argv );
+}
+#endif /* __NO_ISOCEXT */
+
+#else /* !__USE_MINGW_ANSI_STDIO */
+ int __cdecl fwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...);
+ int __cdecl wprintf(const wchar_t * __restrict__ _Format,...);
+ int __cdecl vfwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,va_list _ArgList);
+ int __cdecl vwprintf(const wchar_t * __restrict__ _Format,va_list _ArgList);
+ _CRTIMP int __cdecl swprintf(wchar_t * __restrict__ , const wchar_t * __restrict__ , ...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
+ _CRTIMP int __cdecl vswprintf(wchar_t * __restrict__ , const wchar_t * __restrict__ ,va_list) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
+#ifndef __NO_ISOCEXT /* externs in libmingwex.a */
+#pragma push_macro("snwprintf")
+#pragma push_macro("vsnwprintf")
+# undef snwprintf
+# undef vsnwprintf
+ int __cdecl snwprintf (wchar_t * __restrict__ s, size_t n, const wchar_t * __restrict__ format, ...);
+ int __cdecl vsnwprintf (wchar_t * __restrict__ , size_t, const wchar_t * __restrict__ , va_list);
+#ifndef __CRT__NO_INLINE
+ __CRT_INLINE int __cdecl vsnwprintf (wchar_t * __restrict__ s, size_t n, const wchar_t * __restrict__ format, va_list arg)
+ {
+ return _vsnwprintf(s,n,format,arg);
+ }
+#endif /* !__CRT__NO_INLINE */
+#pragma pop_macro ("vsnwprintf")
+#pragma pop_macro ("snwprintf")
+#endif /* ! __NO_ISOCEXT */
+
+#endif /* __USE_MINGW_ANSI_STDIO */
+
+
#ifndef WEOF
#define WEOF (wint_t)(0xFFFF)
#endif
@@ -441,37 +555,12 @@
int __cdecl fputws(const wchar_t * __restrict__ _Str,FILE * __restrict__ _File);
_CRTIMP wchar_t *__cdecl _getws(wchar_t *_String) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
_CRTIMP int __cdecl _putws(const wchar_t *_Str);
- int __cdecl fwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...);
- int __cdecl wprintf(const wchar_t * __restrict__ _Format,...);
_CRTIMP int __cdecl _scwprintf(const wchar_t * __restrict__ _Format,...);
- int __cdecl vfwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,va_list _ArgList);
- int __cdecl vwprintf(const wchar_t * __restrict__ _Format,va_list _ArgList);
- _CRTIMP int __cdecl swprintf(wchar_t * __restrict__ , const wchar_t * __restrict__ , ...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
_CRTIMP int __cdecl _swprintf_l(wchar_t * __restrict__ ,size_t _SizeInWords,const wchar_t * __restrict__ _Format,_locale_t _Locale,... ) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
- _CRTIMP int __cdecl vswprintf(wchar_t * __restrict__ , const wchar_t * __restrict__ ,va_list) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
_CRTIMP int __cdecl _swprintf_c(wchar_t * __restrict__ _DstBuf,size_t _SizeInWords,const wchar_t * __restrict__ _Format,...);
_CRTIMP int __cdecl _vswprintf_c(wchar_t * __restrict__ _DstBuf,size_t _SizeInWords,const wchar_t * __restrict__ _Format,va_list _ArgList);
_CRTIMP int __cdecl _snwprintf(wchar_t * __restrict__ _Dest,size_t _Count,const wchar_t * __restrict__ _Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
_CRTIMP int __cdecl _vsnwprintf(wchar_t * __restrict__ _Dest,size_t _Count,const wchar_t * __restrict__ _Format,va_list _Args) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
-#ifndef __NO_ISOCEXT /* externs in libmingwex.a */
- int __cdecl snwprintf (wchar_t * __restrict__ s, size_t n, const wchar_t * __restrict__ format, ...);
- int __cdecl vsnwprintf (wchar_t * __restrict__ , size_t, const wchar_t * __restrict__ , va_list);
-
- int __cdecl __mingw_fwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...);
- int __cdecl __mingw_wprintf(const wchar_t * __restrict__ _Format,...);
- int __cdecl __mingw_vfwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,va_list _ArgList);
- int __cdecl __mingw_vwprintf(const wchar_t * __restrict__ _Format,va_list _ArgList);
- int __cdecl __mingw_swprintf(wchar_t * __restrict__ , const wchar_t * __restrict__ , ...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
- int __cdecl __mingw_vswprintf(wchar_t * __restrict__ , const wchar_t * __restrict__ ,va_list) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
- int __cdecl __mingw_snwprintf (wchar_t * __restrict__ s, size_t n, const wchar_t * __restrict__ format, ...);
- int __cdecl __mingw_vsnwprintf (wchar_t * __restrict__ , size_t, const wchar_t * __restrict__ , va_list);
-
-#ifndef __CRT__NO_INLINE
- __CRT_INLINE int __cdecl vsnwprintf (wchar_t * __restrict__ s, size_t n, const wchar_t * __restrict__ format, va_list arg)
- {
- return _vsnwprintf(s,n,format,arg);
- }
-#endif /* !__CRT__NO_INLINE */
int __cdecl vwscanf (const wchar_t * __restrict__ , va_list);
int __cdecl vfwscanf (FILE * __restrict__ ,const wchar_t * __restrict__ ,va_list);
int __cdecl vswscanf (const wchar_t * __restrict__ ,const wchar_t * __restrict__ ,va_list);
------------------------------------------------------------------------------
RSA® 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