merged HAVE_VSNPRINTF fix from 2.2 branch

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9494 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2001-03-10 17:48:09 +00:00
parent c12bc4de58
commit 9d8deca0bd
2 changed files with 230 additions and 215 deletions

426
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -2333,6 +2333,11 @@ dnl end...
dnl if we fail to find vsnprintf, also try for _vsnprintf as that is what
dnl we'll find under MSW if it exists.
dnl final note: AC_TRY_COMPILE will only be executed if there is nothing in
dnl the cache so we have to do AC_DEFINE(HAVE_VSNPRINTF) below and not inside
dnl it or the symbol wouldn't be defined for the 2nd and subsequent configure
dnl runs
dnl check for vsnprintf() - a safe version of vsprintf()
AC_CACHE_CHECK([for vsnprintf], wx_cv_func_vsnprintf,
[
@ -2355,7 +2360,6 @@ AC_CACHE_CHECK([for vsnprintf], wx_cv_func_vsnprintf,
vsnprintf(s, 42, fmt, argp);
va_end(argp);
], [
AC_DEFINE(HAVE_VSNPRINTF)
wx_cv_func_vsnprintf=yes
], [
AC_TRY_COMPILE([
@ -2377,15 +2381,19 @@ AC_CACHE_CHECK([for vsnprintf], wx_cv_func_vsnprintf,
_vsnprintf(s, 42, fmt, argp);
va_end(argp);
], [
AC_DEFINE(HAVE_VSNPRINTF)
wx_cv_func_vsnprintf=yes
], [
AC_MSG_WARN(unsafe function sprintf will be used instead of snprintf)
wx_cv_func_vsnprintf=no
])
])
])
if test "$wx_cv_func_vsnprintf" = yes; then
AC_DEFINE(HAVE_VSNPRINTF)
else
AC_MSG_WARN(unsafe function sprintf will be used instead of snprintf)
fi
dnl check for vsscanf()
AC_CACHE_CHECK([for vsscanf], wx_cv_func_vsscanf,
[
@ -2406,13 +2414,16 @@ AC_CACHE_CHECK([for vsscanf], wx_cv_func_vsscanf,
vsscanf("42", fmt, argp);
va_end(argp);
], [
AC_DEFINE(HAVE_VSSCANF)
wx_cv_func_vsscanf=yes
], [
wx_cv_func_vsscanf=no
])
])
if test "$wx_cv_func_vsscanf" = yes; then
AC_DEFINE(HAVE_VSSCANF)
fi
AC_LANG_RESTORE
dnl the following tests are for Unix(like) systems only