From 987ddff46763ca8792dfa47d57ac482e8dbaf06a Mon Sep 17 00:00:00 2001 From: "wtc%google.com" Date: Wed, 4 Feb 2009 17:52:11 +0000 Subject: [PATCH] Bug 456449: Checked in some more WinMobile WinCE porting changes from Brad Lassey . r=wtc. Modified Files: pr/src/Makefile.in prfile.c prio.c prlog.c git-svn-id: svn://10.0.0.236/trunk@256091 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/nsprpub/pr/src/Makefile.in | 4 ++++ mozilla/nsprpub/pr/src/io/prfile.c | 2 +- mozilla/nsprpub/pr/src/io/prio.c | 2 +- mozilla/nsprpub/pr/src/io/prlog.c | 14 ++++++++++++-- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/mozilla/nsprpub/pr/src/Makefile.in b/mozilla/nsprpub/pr/src/Makefile.in index 44df1f6fd46..d6c38fad194 100644 --- a/mozilla/nsprpub/pr/src/Makefile.in +++ b/mozilla/nsprpub/pr/src/Makefile.in @@ -201,6 +201,10 @@ OS_LIBS = advapi32.lib wsock32.lib winmm.lib endif endif +ifeq ($(OS_TARGET),WINCE) +OS_LIBS = Ws2.lib +endif + ifeq ($(OS_TARGET),MacOSX) OS_LIBS = -framework CoreServices -framework CoreFoundation endif diff --git a/mozilla/nsprpub/pr/src/io/prfile.c b/mozilla/nsprpub/pr/src/io/prfile.c index 545fa712f7b..6545a48a4ad 100644 --- a/mozilla/nsprpub/pr/src/io/prfile.c +++ b/mozilla/nsprpub/pr/src/io/prfile.c @@ -719,7 +719,7 @@ PR_IMPLEMENT(PRStatus) PR_CreatePipe( #pragma unused (readPipe, writePipe) #endif -#ifdef WIN32 +#if defined(WIN32) && !defined(WINCE) HANDLE readEnd, writeEnd; SECURITY_ATTRIBUTES pipeAttributes; diff --git a/mozilla/nsprpub/pr/src/io/prio.c b/mozilla/nsprpub/pr/src/io/prio.c index be187756aba..29fcd9b4728 100644 --- a/mozilla/nsprpub/pr/src/io/prio.c +++ b/mozilla/nsprpub/pr/src/io/prio.c @@ -54,7 +54,7 @@ void _PR_InitIO(void) _pr_flock_lock = PR_NewLock(); _pr_flock_cv = PR_NewCondVar(_pr_flock_lock); -#ifdef WIN32 +#if defined(WIN32) && !defined(WINCE) _pr_stdin = PR_AllocFileDesc((PROsfd)GetStdHandle(STD_INPUT_HANDLE), methods); _pr_stdout = PR_AllocFileDesc((PROsfd)GetStdHandle(STD_OUTPUT_HANDLE), diff --git a/mozilla/nsprpub/pr/src/io/prlog.c b/mozilla/nsprpub/pr/src/io/prlog.c index 744340644fe..1f87d9918b5 100644 --- a/mozilla/nsprpub/pr/src/io/prlog.c +++ b/mozilla/nsprpub/pr/src/io/prlog.c @@ -99,6 +99,16 @@ static PRLock *_pr_logLock; #define WIN32_DEBUG_FILE (FILE*)-2 #endif +#ifdef WINCE +static void OutputDebugStringA(const char* msg) { + int len = MultiByteToWideChar(CP_ACP, 0, msg, -1, 0, 0); + WCHAR *wMsg = (WCHAR *)PR_Malloc(len * sizeof(WCHAR)); + MultiByteToWideChar(CP_ACP, 0, msg, -1, wMsg, len); + OutputDebugStringW(wMsg); + PR_Free(wMsg); +} +#endif + /* Macros used to reduce #ifdef pollution */ #if defined(_PR_USE_STDIO_FOR_LOGGING) && defined(XP_PC) @@ -107,7 +117,7 @@ static PRLock *_pr_logLock; if (logFile == WIN32_DEBUG_FILE) { \ char savebyte = buf[nb]; \ buf[nb] = '\0'; \ - OutputDebugString(buf); \ + OutputDebugStringA(buf); \ buf[nb] = savebyte; \ } else { \ fwrite(buf, 1, nb, fd); \ @@ -254,7 +264,7 @@ void _PR_InitLog(void) #ifdef XP_PC char* str = PR_smprintf("Unable to create nspr log file '%s'\n", ev); if (str) { - OutputDebugString(str); + OutputDebugStringA(str); PR_smprintf_free(str); } #else