Always check for wide char IO functions, they are used regardless of wxUSE_UNICODE setting

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76470 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Paul Cornett
2014-05-06 16:34:47 +00:00
parent 9a44838055
commit 6fc2e956cf
3 changed files with 33 additions and 39 deletions

13
configure vendored
View File

@@ -30050,11 +30050,9 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_compiler_gnu=$ac_cv_c_compiler_gnu
if test "$wxUSE_UNICODE" = yes; then wchar_headers="#include <stdio.h>
wchar_headers="#include <stdio.h>
#include <wchar.h>" #include <wchar.h>"
case "${host}" in case "${host}" in
*-*-solaris2* ) *-*-solaris2* )
for ac_header in widec.h for ac_header in widec.h
do : do :
@@ -30073,7 +30071,7 @@ done
wchar_headers="$wchar_headers wchar_headers="$wchar_headers
#include <widec.h>" #include <widec.h>"
fi fi
esac esac
for wx_func in putws fputws wprintf vswprintf vswscanf for wx_func in putws fputws wprintf vswprintf vswscanf
@@ -30132,9 +30130,9 @@ _ACEOF
done done
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _vsnwprintf" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _vsnwprintf" >&5
$as_echo_n "checking for _vsnwprintf... " >&6; } $as_echo_n "checking for _vsnwprintf... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */ /* end confdefs.h. */
#include <wchar.h> #include <wchar.h>
int int
@@ -30155,7 +30153,6 @@ else
$as_echo "no" >&6; } $as_echo "no" >&6; }
fi fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext; rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext;
fi
if test "$wxUSE_FILE" = "yes"; then if test "$wxUSE_FILE" = "yes"; then

View File

@@ -4273,34 +4273,31 @@ if test "$ac_cv_func_vsscanf" = "yes"; then
fi fi
AC_LANG_POP() AC_LANG_POP()
if test "$wxUSE_UNICODE" = yes; then dnl also look if we have wide char IO functions, notice that [f]putws are
dnl declared in special widec.h under Solaris
dnl also look if we have wide char IO functions, notice that [f]putws are wchar_headers="#include <stdio.h>
dnl declared in special widec.h under Solaris
wchar_headers="#include <stdio.h>
#include <wchar.h>" #include <wchar.h>"
case "${host}" in case "${host}" in
*-*-solaris2* ) *-*-solaris2* )
AC_CHECK_HEADERS(widec.h,,, [AC_INCLUDES_DEFAULT()]) AC_CHECK_HEADERS(widec.h,,, [AC_INCLUDES_DEFAULT()])
if test "$ac_cv_header_widec_h" = "yes"; then if test "$ac_cv_header_widec_h" = "yes"; then
wchar_headers="$wchar_headers wchar_headers="$wchar_headers
#include <widec.h>" #include <widec.h>"
fi fi
esac esac
WX_CHECK_FUNCS(putws fputws wprintf vswprintf vswscanf,,, WX_CHECK_FUNCS(putws fputws wprintf vswprintf vswscanf,,,
[$wchar_headers]) [$wchar_headers])
dnl MinGW has a vswprintf with a different prototype, and dnl MinGW has a vswprintf with a different prototype, and
dnl a _vsnwprintf with the correct prototype, but AC_CHECK_FUNCS dnl a _vsnwprintf with the correct prototype, but AC_CHECK_FUNCS
dnl finds it even if it is not declared in some versions... dnl finds it even if it is not declared in some versions...
AC_MSG_CHECKING([for _vsnwprintf]) AC_MSG_CHECKING([for _vsnwprintf])
AC_TRY_COMPILE([#include <wchar.h>], AC_TRY_COMPILE([#include <wchar.h>],
[&_vsnwprintf;], [&_vsnwprintf;],
[AC_MSG_RESULT([yes]) [AC_MSG_RESULT([yes])
AC_DEFINE(HAVE__VSNWPRINTF)], AC_DEFINE(HAVE__VSNWPRINTF)],
[AC_MSG_RESULT([no])]); [AC_MSG_RESULT([no])]);
fi
if test "$wxUSE_FILE" = "yes"; then if test "$wxUSE_FILE" = "yes"; then
WX_CHECK_FUNCS(fsync) WX_CHECK_FUNCS(fsync)

View File

@@ -202,7 +202,7 @@
so on but not all systems have them so use our own implementations in this so on but not all systems have them so use our own implementations in this
case. case.
*/ */
#if wxUSE_UNICODE && !defined(wxHAVE_TCHAR_SUPPORT) && !defined(HAVE_WPRINTF) #if !defined(wxHAVE_TCHAR_SUPPORT) && !defined(HAVE_WPRINTF)
#define wxNEED_WPRINTF #define wxNEED_WPRINTF
#endif #endif
#if !defined(wxHAVE_TCHAR_SUPPORT) && !defined(HAVE_VSWSCANF) #if !defined(wxHAVE_TCHAR_SUPPORT) && !defined(HAVE_VSWSCANF)