From 41c0f38748d688de4d2f39606ea57f3b1fdf9238 Mon Sep 17 00:00:00 2001 From: Hiroyuki Ikezoe Date: Thu, 18 Jun 2009 07:31:12 -0400 Subject: [PATCH] bug 491972 - error building SimpleTypeLib.c due to perror() call r=bsmedberg --- xpcom/typelib/xpt/tests/SimpleTypeLib.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/xpcom/typelib/xpt/tests/SimpleTypeLib.c b/xpcom/typelib/xpt/tests/SimpleTypeLib.c index 8b62461cf554..993a3e6fa527 100644 --- a/xpcom/typelib/xpt/tests/SimpleTypeLib.c +++ b/xpcom/typelib/xpt/tests/SimpleTypeLib.c @@ -58,6 +58,23 @@ #define TRY(msg, cond) TRY_(msg, cond, 0) #define TRY_Q(msg, cond) TRY_(msg, cond, 1); +#ifdef WINCE +#include +static void +perror(const char *message) +{ + LPVOID msgBuf; + FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM, + NULL, + GetLastError(), + 0, + (LPTSTR)&msgBuf, 0, NULL); + wprintf(L"%s: %s\n", message, msgBuf); + LocalFree(msgBuf); +} +#endif /* WINCE */ + struct nsID iid = { 0x00112233, 0x4455,