debug-only function for logging wchar_t strings

This commit is contained in:
ehouse 2006-04-20 04:38:40 +00:00
parent ed1bac4a16
commit 23e26a3ba9
2 changed files with 18 additions and 0 deletions

View file

@ -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

View file

@ -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