+ dnl we know there is a vsnprintf declaration, but some old headers
+ dnl may have one taking a "char *" format instead of "const char *"
+ AC_CACHE_CHECK([if vsnprintf declaration is broken], wx_cv_func_broken_vsnprintf_decl,
+ [
+ AC_TRY_COMPILE(
+ [
+ #include <stdio.h>
+ #include <stdarg.h>
+ #ifdef __MSL__
+ #if __MSL__ >= 0x6000
+ namespace std {}
+ using namespace std;
+ #endif
+ #endif
+ ],
+ [
+ char *buf;
+ va_list ap;
+ const char *fmt = "%s";
+ vsnprintf(buf, 10u, fmt, ap);
+ ],
+ wx_cv_func_broken_vsnprintf_decl=no,
+ wx_cv_func_broken_vsnprintf_decl=yes
+ )
+ ]
+ )
+
+ if test "$wx_cv_func_broken_vsnprintf_decl" = "yes"; then
+ AC_DEFINE(HAVE_BROKEN_VSNPRINTF_DECL)
+ fi
+ fi
+fi
+
+dnl the same as above but for snprintf() now: it's not present in at least AIX
+dnl 4.2 headers
+if test "$ac_cv_func_snprintf" = "yes"; then
+ AC_CACHE_CHECK([for snprintf declaration], wx_cv_func_snprintf_decl,
+ [
+ AC_TRY_COMPILE(
+ [
+ #include <stdio.h>
+ #include <stdarg.h>
+ #ifdef __MSL__
+ #if __MSL__ >= 0x6000
+ namespace std {}
+ using namespace std;
+ #endif
+ #endif
+ ],
+ [
+ char *buf;
+ snprintf(buf, 10u, "%s", "wx");
+ ],
+ wx_cv_func_snprintf_decl=yes,
+ wx_cv_func_snprintf_decl=no
+ )
+ ]
+ )
+
+ if test "$wx_cv_func_snprintf_decl" = "yes"; then
+ AC_DEFINE(HAVE_SNPRINTF_DECL)
+
+ dnl we know there is an snprintf declaration, but some old headers
+ dnl may have one taking a "char *" format instead of "const char *"
+ AC_CACHE_CHECK([if snprintf declaration is broken], wx_cv_func_broken_snprintf_decl,
+ [
+ AC_TRY_COMPILE(
+ [
+ #include <stdio.h>
+ #include <stdarg.h>
+ #ifdef __MSL__
+ #if __MSL__ >= 0x6000
+ namespace std {}
+ using namespace std;
+ #endif
+ #endif
+ ],
+ [
+ char *buf;
+ const char *fmt = "%s";
+ snprintf(buf, 10u, fmt, "wx");
+ ],
+ wx_cv_func_broken_snprintf_decl=no,
+ wx_cv_func_broken_snprintf_decl=yes
+ )
+ ]
+ )
+
+ if test "$wx_cv_func_broken_snprintf_decl" = "yes"; then
+ AC_DEFINE(HAVE_BROKEN_SNPRINTF_DECL)
+ fi
+ fi
+fi
+
+if test "$wxUSE_UNICODE" = yes; then
+ dnl also look if we have wide char IO functions
+ AC_CHECK_FUNCS(wputc wputchar putws fputws wprintf vswprintf)
+
+ dnl MinGW has a vswprintf with a different prototype, and
+ dnl a _vsnwprintf with the correct prototype, but AC_CHECK_FUNCS
+ dnl finds it even if it is not declared in some versions...
+ AC_MSG_CHECKING([for _vsnwprintf])
+ AC_TRY_COMPILE([#include <wchar.h>],
+ [&_vsnwprintf;],