Commit 49151c07 authored by Gildas Bazin's avatar Gildas Bazin

* modules/gui/wince: try to save up a bit on memory usage.

parent 75d3f2b6
...@@ -74,6 +74,10 @@ DllMain( HANDLE hModule, DWORD fdwReason, LPVOID lpReserved ) ...@@ -74,6 +74,10 @@ DllMain( HANDLE hModule, DWORD fdwReason, LPVOID lpReserved )
} }
#endif #endif
/* Global variables used by _TOMB() / _FROMB() */
wchar_t pwsz_mbtow_wince[2048];
char psz_wtomb_wince[2048];
/***************************************************************************** /*****************************************************************************
* Open: initialize interface * Open: initialize interface
*****************************************************************************/ *****************************************************************************/
......
...@@ -503,19 +503,19 @@ protected: ...@@ -503,19 +503,19 @@ protected:
* A small helper function for utf8 <-> unicode conversions * A small helper function for utf8 <-> unicode conversions
*****************************************************************************/ *****************************************************************************/
#ifdef UNICODE #ifdef UNICODE
static wchar_t pwsz_mbtow[2048]; extern wchar_t pwsz_mbtow_wince[2048];
static char psz_wtomb[2048]; extern char psz_wtomb_wince[2048];
static inline wchar_t *_FROMMB( const char *psz_in ) static inline wchar_t *_FROMMB( const char *psz_in )
{ {
mbstowcs( pwsz_mbtow, psz_in, 2048 ); mbstowcs( pwsz_mbtow_wince, psz_in, 2048 );
pwsz_mbtow[2048-1] = 0; pwsz_mbtow_wince[2048-1] = 0;
return pwsz_mbtow; return pwsz_mbtow_wince;
} }
static inline char *_TOMB( const wchar_t *pwsz_in ) static inline char *_TOMB( const wchar_t *pwsz_in )
{ {
wcstombs( psz_wtomb, pwsz_in, 2048 ); wcstombs( psz_wtomb_wince, pwsz_in, 2048 );
psz_wtomb[2048-1] = 0; psz_wtomb_wince[2048-1] = 0;
return psz_wtomb; return psz_wtomb_wince;
} }
#else #else
# define _FROMMB(a) a # define _FROMMB(a) a
......
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