]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/wxchar.cpp
__WXDEBUG__ is defined/undefined, not 0/1!
[wxWidgets.git] / src / common / wxchar.cpp
index e955415642816d70d075b02c3402beaf90e1eb34..b99c6c7eab048db99aa1cfbc9709f1f3405407a3 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)
 {
@@ -1093,16 +1109,16 @@ WXDLLEXPORT size_t      wxInternalWcstombs (char * out, const wchar_t * in, size_t ou
 
 #include <CoreFoundation/CoreFoundation.h>
 
-CFCharacterSetRef cfalnumset = CFCharacterSetGetPredefined(kCFCharacterSetAlphaNumeric);
-CFCharacterSetRef cfalphaset = CFCharacterSetGetPredefined(kCFCharacterSetLetter);
-CFCharacterSetRef cfcntrlset = CFCharacterSetGetPredefined(kCFCharacterSetControl);
-CFCharacterSetRef cfdigitset = CFCharacterSetGetPredefined(kCFCharacterSetDecimalDigit);
+#define cfalnumset CFCharacterSetGetPredefined(kCFCharacterSetAlphaNumeric)
+#define cfalphaset CFCharacterSetGetPredefined(kCFCharacterSetLetter)
+#define cfcntrlset CFCharacterSetGetPredefined(kCFCharacterSetControl)
+#define cfdigitset CFCharacterSetGetPredefined(kCFCharacterSetDecimalDigit)
 //CFCharacterSetRef cfgraphset = kCFCharacterSetControl && !' '
-CFCharacterSetRef cflowerset = CFCharacterSetGetPredefined(kCFCharacterSetLowercaseLetter);
+#define cflowerset CFCharacterSetGetPredefined(kCFCharacterSetLowercaseLetter)
 //CFCharacterSetRef cfprintset = !kCFCharacterSetControl
-CFCharacterSetRef cfpunctset = CFCharacterSetGetPredefined(kCFCharacterSetPunctuation);
-CFCharacterSetRef cfspaceset = CFCharacterSetGetPredefined(kCFCharacterSetWhitespaceAndNewline);
-CFCharacterSetRef cfupperset = CFCharacterSetGetPredefined(kCFCharacterSetUppercaseLetter);
+#define cfpunctset CFCharacterSetGetPredefined(kCFCharacterSetPunctuation)
+#define cfspaceset CFCharacterSetGetPredefined(kCFCharacterSetWhitespaceAndNewline)
+#define cfupperset CFCharacterSetGetPredefined(kCFCharacterSetUppercaseLetter)
 
 WXDLLEXPORT int wxIsalnum(wxChar ch) { return CFCharacterSetIsCharacterMember(cfalnumset, ch); }
 WXDLLEXPORT int wxIsalpha(wxChar ch) { return CFCharacterSetIsCharacterMember(cfalphaset, ch); }
@@ -1178,11 +1194,28 @@ WXDLLEXPORT wxWCharBuffer wxSetlocale(int category, const wxChar *locale)
 }
 #endif
 
+#if wxUSE_WCHAR_T && !defined(HAVE_WCSLEN)
+WXDLLEXPORT size_t wxWcslen(const wchar_t *s)
+{
+    size_t n = 0;
+    while ( *s++ )
+        n++;
+
+    return n;
+}
+#endif
+
 // ----------------------------------------------------------------------------
 // string.h functions
 // ----------------------------------------------------------------------------
 
 #ifdef wxNEED_WX_STRING_H
+
+// RN:  These need to be c externed for the regex lib
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 WXDLLEXPORT wxChar * wxStrcat(wxChar *dest, const wxChar *src)
 {
   wxChar *ret = dest;
@@ -1302,6 +1335,10 @@ WXDLLEXPORT const wxChar *wxStrstr(const wxChar *haystack, const wxChar *needle)
     return NULL;
 }
 
+#ifdef __cplusplus
+}
+#endif
+
 WXDLLEXPORT double wxStrtod(const wxChar *nptr, wxChar **endptr)
 {
   const wxChar *start = nptr;