-dnl check for vsnprintf() - a safe version of vsprintf()
-AC_CACHE_CHECK([for vsnprintf], wx_cv_func_vsnprintf,
-[
- AC_TRY_LINK([
- #include <stdio.h>
- #include <stdarg.h>
- ], [
- int wx_test_vsnprintf(const char *, ...);
-
- wx_test_vsnprintf("%s");
- return 0;
- }
-
- int wx_test_vsnprintf(const char *fmt, ...)
- {
- char *s;
-
- va_list argp;
- va_start(argp, fmt);
- vsnprintf(s, 42, fmt, argp);
- va_end(argp);
- ], [
- wx_cv_func_vsnprintf=yes
- ], [
- AC_TRY_LINK([
- #include <stdio.h>
- #include <stdarg.h>
- ], [
- int wx_test_vsnprintf(const char *, ...);
-
- wx_test_vsnprintf("%s");
- return 0;
- }
-
- int wx_test_vsnprintf(const char *fmt, ...)
- {
- char *s;
-
- va_list argp;
- va_start(argp, fmt);
- _vsnprintf(s, 42, fmt, argp);
- va_end(argp);
- ], [
- wx_cv_func_vsnprintf=yes
- ], [
- wx_cv_func_vsnprintf=no
- ])
- ])
-])
-
-if test "$wx_cv_func_vsnprintf" = yes; then
- AC_DEFINE(HAVE_VSNPRINTF)
-else
- AC_MSG_WARN(unsafe function vsprintf will be used instead of vsnprintf)
+if test "$wxUSE_UNICODE" = yes; then
+ dnl also look if we have wide char IO functions
+ AC_CHECK_FUNCS(fputwc wprintf vswprintf)