Bug 456449: Checked in some more WinMobile WinCE porting changes from

Brad Lassey <bugmail@lassey.us>.  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
This commit is contained in:
wtc%google.com
2009-02-04 17:52:11 +00:00
parent 9d2ab5d90b
commit 987ddff467
4 changed files with 18 additions and 4 deletions

View File

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

View File

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

View File

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

View File

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