2011-11-01  Kai Tietz  <ktietz@redhat.com>

        * stdio.h: Fix broken handling for snprintf/vsnprintf
        due recent patch.



git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/trunk@4564 4407c894-4637-0410-b4f5-ada5f102cad1
diff --git a/mingw-w64-headers/crt/ChangeLog b/mingw-w64-headers/crt/ChangeLog
index 9ed1c93..177ed42 100644
--- a/mingw-w64-headers/crt/ChangeLog
+++ b/mingw-w64-headers/crt/ChangeLog
@@ -1,3 +1,8 @@
+2011-11-01  Kai Tietz  <ktietz@redhat.com>
+
+	* stdio.h: Fix broken handling for snprintf/vsnprintf
+	due recent patch.
+
 2011-10-31  Rafal Carr  <funman@videolan.org>
 
 	* _mingw_print_push.h: Remove printf-defines.
diff --git a/mingw-w64-headers/crt/stdio.h b/mingw-w64-headers/crt/stdio.h
index c9e521d..51e7602 100644
--- a/mingw-w64-headers/crt/stdio.h
+++ b/mingw-w64-headers/crt/stdio.h
@@ -274,22 +274,6 @@
   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;
-
-#ifndef __NO_ISOCEXT  /* externs in libmingwex.a */
-/* this is here to deal with software defining
- * vsnprintf as _vsnprintf, eg. libxml2.  */
-#pragma push_macro("snprintf")
-#pragma push_macro("vsnprintf")
-# undef snprintf
-# undef vsnprintf
-  int __cdecl snprintf(char * __restrict__ s, size_t n, const char * __restrict__  format, ...);
-#ifndef __CRT__NO_INLINE
-  __CRT__INLINE int __cdecl vsnprintf(char * __restrict__ _DstBuf,size_t _MaxCount,const char * __restrict__ _Format,va_list _ArgList) __MINGW_ATTRIB_DEPRECATED_MSVC2005 __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
-#endif /* __CRT__NO_INLINE */
-#pragma pop_macro ("vsnprintf")
-#pragma pop_macro ("snprintf")
-#endif /* __NO_ISOCEXT */
-
 #endif /* __USE_MINGW_ANSI_STDIO */
 
   _CRTIMP int __cdecl _filbuf(FILE *_File);
@@ -423,6 +407,28 @@
   _CRTIMP int __cdecl _vsnprintf_l(char * __restrict__ buffer,size_t count,const char * __restrict__ format,_locale_t locale,va_list argptr) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
   int __cdecl _sprintf_l(char * __restrict__ buffer,const char * __restrict__ format,_locale_t locale,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
 
+#if !defined (__USE_MINGW_ANSI_STDIO) || __USE_MINGW_ANSI_STDIO == 0
+/* this is here to deal with software defining
+ * vsnprintf as _vsnprintf, eg. libxml2.  */
+#pragma push_macro("snprintf")
+#pragma push_macro("vsnprintf")
+# undef snprintf
+# undef vsnprintf
+  int __cdecl vsnprintf(char * __restrict__ d,size_t n,const char * __restrict__ format,va_list arg)
+    __MINGW_ATTRIB_DEPRECATED_MSVC2005 __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
+
+#ifndef __NO_ISOCEXT
+  int __cdecl snprintf(char * __restrict__ s, size_t n, const char * __restrict__  format, ...);
+#ifndef __CRT__NO_INLINE
+  __CRT__INLINE int __cdecl vsnprintf(char * __restrict__ d,size_t n,const char * __restrict__ format,va_list arg)
+  {
+    return _vsnprintf (d, n, format, arg); $$$$
+  }
+#endif /* !__CRT__NO_INLINE */
+#endif /* !__NO_ISOCEXT */
+#pragma pop_macro ("vsnprintf")
+#pragma pop_macro ("snprintf")
+#endif
 
 #ifndef __NO_ISOCEXT  /* externs in libmingwex.a */
   int __cdecl vscanf(const char * __restrict__ Format, va_list argp);