]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/chartype.h
fix MDI child sizing, which was working more or less by accident before I broke it...
[wxWidgets.git] / include / wx / chartype.h
index 0395e000a541311afdb118c17ba98f13db1b4984..a326f0691cd0f40a67cc6e258e4d04a3bdb41652 100644 (file)
     #ifdef HAVE_WIDEC_H
         #include <widec.h>
     #endif
-
-    #if !defined(__GNUC__) || defined(__DARWIN__)
-        #define wxWINT_T_IS_TYPEDEF
-    #endif
 #endif /* wxUSE_WCHAR_T */
 
 /* -------------------------------------------------------------------------- */
     /* Sun's SunPro compiler supports the wchar_t type and wide character    */
     /* functions, but does not define __WCHAR_TYPE__. Define it here to      */
     /* allow unicode enabled builds.                                         */
-    #if defined(__SUNPRO_CC) || defined(__SUNPRO_C)
-    #define __WCHAR_TYPE__ wxchar_t
+    #if (defined(__SUNPRO_CC) || defined(__SUNPRO_C)) && !defined(__WCHAR_TYPE__)
+        #define __WCHAR_TYPE__ wxchar_t
     #endif
 
     /* GNU libc has __WCHAR_TYPE__ which requires special treatment, see */
     #endif /* __WCHAR_TYPE__ */
 #endif /* ASCII/Unicode */
 
+/* ------------------------------------------------------------------------- */
+/* define wxStringCharType                                                   */
+/* ------------------------------------------------------------------------- */
+
+/* depending on the platform, Unicode build can either store wxStrings as
+   wchar_t* or UTF-8 encoded char*: */
+#if wxUSE_UNICODE
+    /* FIXME-UTF8: what would be better place for this? */
+    #if defined(wxUSE_UTF8_LOCALE_ONLY) && !defined(wxUSE_UNICODE_UTF8)
+        #error "wxUSE_UTF8_LOCALE_ONLY only makes sense with wxUSE_UNICODE_UTF8"
+    #endif
+    #ifndef wxUSE_UTF8_LOCALE_ONLY
+        #define wxUSE_UTF8_LOCALE_ONLY 0
+    #endif
+
+    #ifndef wxUSE_UNICODE_UTF8
+        #define wxUSE_UNICODE_UTF8 0
+    #endif
+
+    #if wxUSE_UNICODE_UTF8
+        #define wxUSE_UNICODE_WCHAR 0
+    #else
+        #define wxUSE_UNICODE_WCHAR 1
+    #endif
+#else
+    #define wxUSE_UNICODE_WCHAR 0
+    #define wxUSE_UNICODE_UTF8  0
+    #define wxUSE_UTF8_LOCALE_ONLY 0
+#endif
+
+/* define char type used by wxString internal representation: */
+#if wxUSE_UNICODE_UTF8
+    typedef char wxStringCharType;
+#elif wxUSE_UNICODE_WCHAR
+    typedef wchar_t wxStringCharType;
+#else
+    typedef char wxStringCharType;
+#endif
+
+
 /* ------------------------------------------------------------------------- */
 /* define _T() and related macros                                            */
 /* ------------------------------------------------------------------------- */