]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/wxchar.h
Wrappers for *ToText
[wxWidgets.git] / include / wx / wxchar.h
index 99cf662689e12fdbebaa24056eff305cc37cfca9..dd6ca93a71f45789fb7fd4756a2589f40e0b1a8f 100644 (file)
     #define  wxIsspace   _istspace
     #define  wxIsupper   _istupper
     #define  wxIsxdigit  _istxdigit
     #define  wxIsspace   _istspace
     #define  wxIsupper   _istupper
     #define  wxIsxdigit  _istxdigit
-    #define  wxTolower   _totlower
-    #define  wxToupper   _totupper
+
+    /*
+       There is a bug in VC6 C RTL: toxxx() functions dosn't do anything with
+       signed chars < 0, so "fix" it here.
+     */
+    #define  wxTolower(c) _totlower((wxUChar)(c))
+    #define  wxToupper(c) _totupper((wxUChar)(c))
 
     /* locale.h functons */
     #define  wxSetlocale _tsetlocale
 
     /* locale.h functons */
     #define  wxSetlocale _tsetlocale
             #define  wxGets      getws
             #define  wxUngetc    ungetwc
 
             #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
             #else
-                #define wxNEED_FPUTWC
-
+                #define wxNEED_FPUTS
                 #include <stdio.h>
                 #include <stdio.h>
-
                 int wxFputs(const wxChar *ch, FILE *stream);
                 int wxFputs(const wxChar *ch, FILE *stream);
+            #endif
+
+            #ifdef HAVE_WPUTC
+                #define wxPutc      wputc
+            #else
+                #define wxNEED_PUTC
+                #include <stdio.h>
                 int wxPutc(wxChar ch, FILE *stream);
                 int wxPutc(wxChar ch, FILE *stream);
+            #endif
 
 
-                #define wxPuts(ws) wxFputs(ws, stdout)
+            #ifdef HAVE_WPUTCHAR
+                #define wxPutchar   wputchar
+            #else
                 #define wxPutchar(wch) wxPutc(wch, stdout)
             #endif
                 #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
 
             /* we need %s to %ls conversion for printf and scanf etc */
             #define wxNEED_PRINTF_CONVERSION