From 23e26a3ba9641bc8ccf2b7e9742359b002348acb Mon Sep 17 00:00:00 2001 From: ehouse Date: Thu, 20 Apr 2006 04:38:40 +0000 Subject: [PATCH] debug-only function for logging wchar_t strings --- wince/ceutil.c | 11 +++++++++++ wince/ceutil.h | 7 +++++++ 2 files changed, 18 insertions(+) diff --git a/wince/ceutil.c b/wince/ceutil.c index a43226430..56067f134 100755 --- a/wince/ceutil.c +++ b/wince/ceutil.c @@ -191,3 +191,14 @@ ceCenterCtl( HWND hDlg, XP_U16 resID ) XP_LOGF( "MoveWindow=>%d", GetLastError() ); } } /* ceCenterCtl */ + +#ifdef DEBUG +void +XP_LOGW( const XP_UCHAR* prefix, const wchar_t* arg ) +{ + XP_UCHAR buf[512]; + (void)WideCharToMultiByte( CP_ACP, 0, arg, -1, + buf, sizeof(buf), NULL, NULL ); + XP_LOGF( "%s: %s", prefix, buf ); +} +#endif diff --git a/wince/ceutil.h b/wince/ceutil.h index 1a0669b76..3c9131e2e 100755 --- a/wince/ceutil.h +++ b/wince/ceutil.h @@ -42,4 +42,11 @@ XP_Bool ceGetChecked( HWND hDlg, XP_U16 resID ); void ceSetChecked( HWND hDlg, XP_U16 resID, XP_Bool check ); void ceCenterCtl( HWND hDlg, XP_U16 resID ); + +#ifdef DEBUG +void XP_LOGW( const XP_UCHAR* prefix, const wchar_t* arg ); +#else +# define XP_LOGW( prefix, arg ) +#endif + #endif