Include function name in assertion failure message; always print to

file before putting up warning.
This commit is contained in:
ehouse 2009-01-17 18:44:45 +00:00
parent d58d9bedd7
commit dd1f9aa8ca
2 changed files with 8 additions and 4 deletions

View file

@ -2699,9 +2699,11 @@ RECTtoXPR( XP_Rect* dest, const RECT* src )
void
wince_assert( XP_UCHAR* XP_UNUSED_LOG(s), int XP_UNUSED_LOG(line),
char* XP_UNUSED_LOG(fileName) )
const char* XP_UNUSED_LOG(fileName),
const char* XP_UNUSED_LOG(func) )
{
XP_WARNF( "ASSERTION FAILED %s: file %s, line %d\n", s, fileName, line );
XP_WARNF( "ASSERTION FAILED %s: %s in file %s, line %d\n", s,
func, fileName, line );
} /* wince_assert */
#ifdef ENABLE_LOGGING
@ -2730,6 +2732,8 @@ wince_warnf(const XP_UCHAR* format, ...)
vsnprintf( buf, sizeof(buf), format, ap );
va_end(ap);
wince_debugf( "%s", buf );
slen = strlen(buf)+1;
wchar_t widebuf[slen];

View file

@ -78,7 +78,7 @@ typedef XP_U32 XP_Time;
#ifdef DEBUG
#define XP_ASSERT(b) if(!(b)) { wince_assert(#b, __LINE__, __FILE__); }
#define XP_ASSERT(b) if(!(b)) { wince_assert(#b, __LINE__, __FILE__, __func__); }
#else
# define XP_ASSERT(b)
#endif
@ -100,7 +100,7 @@ typedef XP_U32 XP_Time;
extern "C" {
#endif
void wince_assert(XP_UCHAR* s, int line, char* fileName );
void wince_assert(XP_UCHAR* s, int line, const char* fileName, const char* func );
void wince_debugf(const XP_UCHAR*, ...)
__attribute__ ((format (printf, 1, 2)));
void wince_warnf(const XP_UCHAR*, ...)