From: Vadim Zeitlin Date: Wed, 18 Aug 1999 17:03:20 +0000 (+0000) Subject: vsscanf test corrected (?) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/3a3eed31f0f081073571f25ea39cacbecdad91e2 vsscanf test corrected (?) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3415 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/configure.in b/configure.in index 361250ba45..e1a9eb023d 100644 --- a/configure.in +++ b/configure.in @@ -198,20 +198,21 @@ AC_DEFUN(WX_CPP_BOOL, AC_LANG_SAVE AC_LANG_CPLUSPLUS - AC_TRY_RUN([ - int main() - { - bool b = true; + AC_TRY_COMPILE( + [ + ], + [ + bool b = true; - return 0; - } + return 0; ], [ AC_DEFINE(HAVE_BOOL) wx_cv_cpp_bool=yes ], - wx_cv_cpp_bool=no, - wx_cv_cpp_bool=no + [ + wx_cv_cpp_bool=no + ] ) AC_LANG_RESTORE @@ -1755,20 +1756,34 @@ AC_LANG_CPLUSPLUS AC_CACHE_CHECK([for vsscanf], wx_cv_func_vsscanf, [ - AC_TRY_COMPILE( + AC_TRY_RUN( [ #include #include - ], - [ - va_list ap; - vsscanf("", "", ap); + + int try_vsscanf(const char *format, ...) + { + va_list ap; + va_start(ap, format); + + vsscanf("17", format, ap); + + va_end(ap); + } + + int main() + { + int i; + try_vsscanf("%d", &i); + return i == 17 ? 0 : 1; + } ], [ - wx_cv_func_vsscanf=yes AC_DEFINE(HAVE_VSSCANF) - ], [ - wx_cv_func_vsscanf=no - ]) + wx_cv_func_vsscanf=yes + ], + wx_cv_func_vsscanf=no, + wx_cv_func_vsscanf=no + ) ]) AC_LANG_RESTORE