wxPuts() should output a trailing newline even in Unix/Unicode builds

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29793 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2004-10-11 23:49:15 +00:00
parent 8d6f95db28
commit 19b65a3033
3 changed files with 27 additions and 2 deletions

View File

@ -199,6 +199,13 @@ versions, please update your code to not use them.
OTHER CHANGES OTHER CHANGES
============= =============
2.5.4
-----
Unix:
- wxPuts() now correctly outputs trailing new line in Unicode build
2.5.3 2.5.3
----- -----

View File

@ -393,9 +393,11 @@
#define wxNEED_UNGETC #define wxNEED_UNGETC
#define wxNEED_FPUTS #define wxNEED_FPUTS
#define wxNEED_PUTS
#define wxNEED_PUTC #define wxNEED_PUTC
int wxFputs(const wxChar *ch, FILE *stream); int wxFputs(const wxChar *ch, FILE *stream);
int wxPuts(const wxChar *ws);
int wxPutc(wxChar ch, FILE *stream); int wxPutc(wxChar ch, FILE *stream);
#ifdef __cplusplus #ifdef __cplusplus
@ -407,7 +409,6 @@
#endif #endif
#define wxPutchar(wch) wxPutc(wch, stdout) #define wxPutchar(wch) wxPutc(wch, stdout)
#define wxPuts(ws) wxFputs(ws, stdout)
#define wxNEED_PRINTF_CONVERSION #define wxNEED_PRINTF_CONVERSION
#define wxNEED_WX_STDIO_H #define wxNEED_WX_STDIO_H
@ -498,7 +499,8 @@
#ifdef HAVE_PUTWS #ifdef HAVE_PUTWS
#define wxPuts putws #define wxPuts putws
#else #else
#define wxPuts(ws) wxFputs(ws, stdout) #define wxNEED_PUTS
int wxPuts(const wxChar *ws)
#endif #endif
/* we need %s to %ls conversion for printf and scanf etc */ /* we need %s to %ls conversion for printf and scanf etc */

View File

@ -613,6 +613,22 @@ int wxFputs(const wchar_t *ws, FILE *stream)
} }
#endif // wxNEED_FPUTS #endif // wxNEED_FPUTS
#ifdef wxNEED_PUTS
int wxPuts(const wxChar *ws)
{
int rc = wxFputs(ws, stdout);
if ( rc != -1 )
{
if ( wxFputs(L"\n", stdout) == -1 )
return -1;
rc++;
}
return rc;
}
#endif // wxNEED_PUTS
#ifdef wxNEED_PUTC #ifdef wxNEED_PUTC
int /* not wint_t */ wxPutc(wchar_t wc, FILE *stream) int /* not wint_t */ wxPutc(wchar_t wc, FILE *stream)
{ {