]> git.saurik.com Git - wxWidgets.git/commitdiff
wxPuts() should output a trailing newline even in Unix/Unicode builds
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 11 Oct 2004 23:49:15 +0000 (23:49 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 11 Oct 2004 23:49:15 +0000 (23:49 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29793 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
include/wx/wxchar.h
src/common/wxchar.cpp

index ad81c9d99e4db595985dc092ca06a934512ba1d4..18c3a3426cf1ab770d62f7f76a096295b0b5baf0 100644 (file)
@@ -199,6 +199,13 @@ versions, please update your code to not use them.
 OTHER CHANGES
 =============
 
+2.5.4
+-----
+
+Unix:
+
+- wxPuts() now correctly outputs trailing new line in Unicode build
+
 2.5.3
 -----
 
index a5a03e38a096b3dd20f9c0cbdcc3398ddd4384f7..cd87652f6dd1547c6f220d02fd60828f1e2ae7da 100644 (file)
         #define wxNEED_UNGETC
 
         #define wxNEED_FPUTS
+        #define wxNEED_PUTS
         #define wxNEED_PUTC
  
         int wxFputs(const wxChar *ch, FILE *stream);
+        int wxPuts(const wxChar *ws);
         int wxPutc(wxChar ch, FILE *stream);
         
         #ifdef __cplusplus
         #endif
 
         #define wxPutchar(wch) wxPutc(wch, stdout)
-        #define wxPuts(ws) wxFputs(ws, stdout)
             
         #define wxNEED_PRINTF_CONVERSION
         #define wxNEED_WX_STDIO_H
             #ifdef HAVE_PUTWS
                 #define wxPuts      putws
             #else
-                #define wxPuts(ws) wxFputs(ws, stdout)
+                #define wxNEED_PUTS
+                int wxPuts(const wxChar *ws)
             #endif
 
             /* we need %s to %ls conversion for printf and scanf etc */
index 1b861219294c7e7ef90fa7375a880df9f7dbc0fc..9f12a7b58274f930b3dd5f53759978b7c3171ee5 100644 (file)
@@ -613,6 +613,22 @@ int wxFputs(const wchar_t *ws, FILE *stream)
 }
 #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
 int /* not wint_t */ wxPutc(wchar_t wc, FILE *stream)
 {