X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/57f6da0dec3bae2f9e635085561779d18df752b8..f924129679e25bdc0bb8d4accf47bc420d4b802d:/include/wx/wxchar.h?ds=sidebyside diff --git a/include/wx/wxchar.h b/include/wx/wxchar.h index c7a3dbdc6f..96db64a224 100644 --- a/include/wx/wxchar.h +++ b/include/wx/wxchar.h @@ -186,7 +186,7 @@ typedef _TUCHAR wxUChar; #if defined(__VISUALC__) && (__VISUALC__ < 900) #define wxUSE_WCHAR_T 0 // wchar_t is not available for MSVC++ 1.5 #elif defined(__UNIX__) - #if defined(HAVE_WCSTR_H) || defined(HAVE_WCHAR_H) + #if defined(HAVE_WCSTR_H) || defined(HAVE_WCHAR_H) || defined(__FreeBSD__) #define wxUSE_WCHAR_T 1 #else #define wxUSE_WCHAR_T 0 @@ -200,11 +200,16 @@ typedef _TUCHAR wxUChar; #endif//wxUSE_UNICODE #if wxUSE_WCHAR_T -#ifdef HAVE_WCSTR_H -#include -#else -#include -#endif + #ifdef HAVE_WCSTR_H + #include + #else + #ifndef __FreeBSD__ + #include + #else + #include + #define wxNEED_WCSLEN + #endif + #endif #endif // check whether we are doing Unicode @@ -288,6 +293,9 @@ typedef unsigned char wxUChar; #define wxUChar unsigned char #endif +#ifdef __FreeBSD__ + #undef _T +#endif #define _T(x) x // ctype.h functions @@ -441,7 +449,16 @@ size_t WXDLLEXPORT wxWC2MB(char *buf, const wchar_t *psz, size_t n); #define wxWC2WX wxWC2MB #define wxWX2WC wxMB2WC #endif +#else +// No wxUSE_WCHAR_T: we have to do something (JACS) +#define wxMB2WC wxStrncpy +#define wxWC2MB wxStrncpy +#define wxMB2WX wxStrncpy +#define wxWX2MB wxStrncpy +#define wxWC2WX wxWC2MB +#define wxWX2WC wxMB2WC #endif + bool WXDLLEXPORT wxOKlibc(); // for internal use // if libc versions are not available, use replacements defined in wxchar.cpp