check for wputc wputchar putws fputws availability

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27913 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík 2004-06-20 17:18:50 +00:00
parent 290e4c83d9
commit fbe47c7b5c
6 changed files with 52 additions and 20 deletions

5
configure vendored
View File

@ -30215,7 +30215,10 @@ if test "$wxUSE_UNICODE" = yes; then
for ac_func in fputwc wprintf vswprintf
for ac_func in wputc wputchar putws fputws wprintf vswprintf
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5

View File

@ -3709,7 +3709,7 @@ fi
if test "$wxUSE_UNICODE" = yes; then
dnl also look if we have wide char IO functions
AC_CHECK_FUNCS(fputwc wprintf vswprintf)
AC_CHECK_FUNCS(wputc wputchar putws fputws wprintf vswprintf)
dnl MinGW has a vswprintf with a different prototype, and
dnl a _vsnwprintf with the correct prototype, but AC_CHECK_FUNCS

View File

@ -415,22 +415,33 @@
#define wxGets getws
#define wxUngetc ungetwc
#ifdef HAVE_FPUTWC
#define wxPutc wputc
#define wxPutchar wputchar
#define wxPuts putws
#define wxFputs fputws
#ifdef HAVE_FPUTWS
#define wxFputs fputws
#else
#define wxNEED_FPUTWC
#define wxNEED_FPUTS
#include <stdio.h>
int wxFputs(const wxChar *ch, FILE *stream);
int wxPutc(wxChar ch, FILE *stream);
#endif
#define wxPuts(ws) wxFputs(ws, stdout)
#ifdef HAVE_WPUTC
#define wxPutc wputc
#else
#define wxNEED_PUTC
#include <stdio.h>
int wxPutc(wxChar ch, FILE *stream);
#endif
#ifdef HAVE_WPUTCHAR
#define wxPutchar wputchar
#else
#define wxPutchar(wch) wxPutc(wch, stdout)
#endif
#ifdef HAVE_PUTWS
#define wxPuts putws
#else
#define wxPuts(ws) wxFputs(ws, stdout)
#endif
/* we need %s to %ls conversion for printf and scanf etc */
#define wxNEED_PRINTF_CONVERSION

View File

@ -1229,8 +1229,17 @@
/* Define if you have wcsrtombs() function */
#undef HAVE_WCSRTOMBS
/* Define this if you have fputws() and putwc() */
#undef HAVE_FPUTWC
/* Define this if you have wputc() */
#undef HAVE_WPUTC
/* Define this if you have wputchar() */
#undef HAVE_WPUTCHAR
/* Define this if you have putws() */
#undef HAVE_PUTWS
/* Define this if you have fputws() */
#undef HAVE_FPUTWS
/* Define this if you have strcasecmp() function in <string.h> */
#undef HAVE_STRCASECMP_IN_STRING_H

View File

@ -1244,8 +1244,17 @@
/* Define if you have wcsrtombs() function */
#define HAVE_WCSRTOMBS 1
/* Define this if you have fputws() and putwc() */
#define HAVE_FPUTWC 1
/* Define this if you have wputc() */
#define HAVE_WPUTC 1
/* Define this if you have wputchar() */
#define HAVE_WPUTCHAR 1
/* Define this if you have putws() */
#define HAVE_PUTWS 1
/* Define this if you have fputws() */
#define HAVE_FPUTWS 1
/* Define this if you have strcasecmp() function in <string.h> */
#define HAVE_STRCASECMP_IN_STRING_H 1

View File

@ -604,23 +604,23 @@ int WXDLLEXPORT wxSnprintf_(wxChar *buf, size_t len, const wxChar *format, ...)
// implement the standard IO functions for wide char if libc doesn't have them
// ----------------------------------------------------------------------------
#ifdef wxNEED_FPUTWC
#ifdef wxNEED_FPUTS
int wxFputs(const wchar_t *ws, FILE *stream)
{
// counting the number of wide characters written isn't worth the trouble,
// simply distinguish between ok and error
return fputs(wxConvLibc.cWC2MB(ws), stream) == -1 ? -1 : 0;
}
#endif // wxNEED_FPUTS
#ifdef wxNEED_PUTC
int /* not wint_t */ wxPutc(wchar_t wc, FILE *stream)
{
wchar_t ws[2] = { wc, L'\0' };
return wxFputs(ws, stream);
}
#endif // wxNEED_FPUTWC
#endif // wxNEED_PUTC
// NB: we only implement va_list functions here, the ones taking ... are
// defined below for wxNEED_PRINTF_CONVERSION case anyhow and we reuse