]> git.saurik.com Git - wxWidgets.git/commitdiff
test for vsscanf enhanced, added HAVE_VSSCANF to acconfig.h
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 7 Aug 1999 14:44:58 +0000 (14:44 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 7 Aug 1999 14:44:58 +0000 (14:44 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3309 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

acconfig.h
configure.in

index 203fec51bc4c041c0b6e2a2ca7f0a1e12cef9a54..29c6edee8fdaa0295bd408c18ddec5e0760b819f 100644 (file)
 /* Define if you have wcslen function  */
 #undef HAVE_WCSLEN
 
+/* define if you have vsscanf function */
+#undef HAVE_VSSCANF
+
 @BOTTOM@
 
 #endif /* __WX_SETUP_H__ */
index 4d6975506f9a9038f0311e9fa57d9a30b48f965d..6e7fa23fe5266f7902d1f86b848fb09dea087c63 100644 (file)
@@ -1277,6 +1277,32 @@ AC_CHECK_FUNCS(vsnprintf,
                AC_MSG_WARN(unsafe function sprintf will be used instead of snprintf)
               )
 
+dnl check for vsscanf() - on some platforms (Linux, glibc 2.1.1) it's
+dnl available in the library but the prototype is missing, so we can't use
+dnl AC_CHECK_FUNCS here, do it manually
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+
+AC_CACHE_CHECK([for vsscanf], wx_cv_func_vsscanf,
+[
+  AC_TRY_COMPILE(
+             [
+                #include <stdio.h>
+                #include <stdarg.h>
+             ],
+             [
+                va_list ap;
+                vsscanf("", "", ap);
+             ], [
+                wx_cv_func_vsscanf=yes
+                AC_DEFINE(HAVE_VSSCANF)
+             ], [
+                wx_cv_func_vsscanf=no
+             ])
+])
+
+AC_LANG_RESTORE
+
 dnl check for vfork() (even if it's the same as fork() in modern Unices)
 AC_CHECK_FUNCS(vfork)
 
@@ -1344,11 +1370,11 @@ if test "$wxUSE_THREADS" = "yes" ; then
                 ])
             ])
         ])
-fi
 
-if test -z "$THREADS_OBJ" ; then
-    wxUSE_THREADS=no
-    AC_MSG_WARN(No thread support on this system)
+    if test -z "$THREADS_OBJ" ; then
+        wxUSE_THREADS=no
+        AC_MSG_WARN(No thread support on this system)
+    fi
 fi
 
 dnl do other tests only if we are using threads
@@ -1738,9 +1764,6 @@ if test "$wxUSE_JOYSTICK" = 1; then
   fi
 fi
 
-
-AC_CHECK_FUNCS(vsscanf)
-
 dnl ------------------------------------------------------------------------
 dnl DLL support
 dnl ------------------------------------------------------------------------