Commit a7cfd58b authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont
parent e68bba76
...@@ -93,19 +93,22 @@ DECLARE_LOCAL_EVENT_TYPE( wxEVT_INTF, 1 ); ...@@ -93,19 +93,22 @@ DECLARE_LOCAL_EVENT_TYPE( wxEVT_INTF, 1 );
* Note that if you want to use non-ANSI code page characters on Windows, * Note that if you want to use non-ANSI code page characters on Windows,
* you MUST build WxWidgets in “Unicode” mode. * you MUST build WxWidgets in “Unicode” mode.
*/ */
static inline char *wxFromLocale (const wxString& string)
{
#if defined( wxUSE_UNICODE ) #if defined( wxUSE_UNICODE )
# if defined( WIN32 ) # if defined( WIN32 )
# define wxFromLocale(wxstring) FromWide((wxstring).c_str()) return FromWide ((wchar_t *)string.c_str());
# define wxLocaleFree(string) free(string) # define wxLocaleFree free
# else # else
# define wxFromLocale(wxstring) FromLocale((wxstring).mb_str()) return FromLocale (string.mb_str());
# define wxLocaleFree(string) LocaleFree(string) # define wxLocaleFree LocaleFree
# endif # endif
#else #else
# warning Please use WxWidgets with Unicode. # warning Please use WxWidgets with Unicode.
# define wxFromLocale(wxstring) FromLocale((wxstring).c_str()) return FromLocale (string.c_str());
# define wxLocaleFree(string) LocaleFree(string) # define wxLocaleFree LocaleFree
#endif #endif
}
/* From Locale functions to use for File Drop targets ... go figure */ /* From Locale functions to use for File Drop targets ... go figure */
#if defined( wxUSE_UNICODE ) && !defined( WIN32 ) #if defined( wxUSE_UNICODE ) && !defined( WIN32 )
...@@ -135,10 +138,10 @@ static inline char *wxDnDFromLocale( const wxChar *stupid ) ...@@ -135,10 +138,10 @@ static inline char *wxDnDFromLocale( const wxChar *stupid )
return FromLocaleDup( psz_local ); return FromLocaleDup( psz_local );
} }
# define wxDnDLocaleFree( string ) free( string ) # define wxDnDLocaleFree free
#else #else
# define wxDnDFromLocale( string ) wxFromLocale( string ) # define wxDnDFromLocale wxFromLocale
# define wxDnDLocaleFree( string ) wxLocaleFree( string ) # define wxDnDLocaleFree wxLocaleFree
#endif #endif
#define WRAPCOUNT 80 #define WRAPCOUNT 80
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment