]> git.saurik.com Git - wxWidgets.git/commitdiff
vsscanf test corrected (?)
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 18 Aug 1999 17:03:20 +0000 (17:03 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 18 Aug 1999 17:03:20 +0000 (17:03 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3415 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

configure.in

index 361250ba45c4bbc49550d98ad864493adc887ca2..e1a9eb023d99302dccd43f17c5ab845e4fc6bd45 100644 (file)
@@ -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 <stdio.h>
                 #include <stdarg.h>
-             ],
-             [
-                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