From 172bfc67efe567f11e216f1daa59544328fca2f9 Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Wed, 8 Mar 2006 06:25:44 +0000 Subject: [PATCH] minor mingw32 fixups git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@22616 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 7 +++++++ Source/win32/GSRunLoopCtxt.m | 19 +++++++++++++++++-- Source/win32/NSStreamWin32.m | 6 ++---- 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 36834c762..fe66808fc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-03-08 Richard Frith-Macdonald + + * Source/unix/GSRunLoopCtxt.m: Don't hanlde windows messages unless + required. + * Source/win32/NSStreamWin32.m: Use fileSystemRepresentation rather + than cStringUsingEncoding: + 2006-03-07 Richard Frith-Macdonald * Source/NSRunLoop.m: diff --git a/Source/win32/GSRunLoopCtxt.m b/Source/win32/GSRunLoopCtxt.m index 7d75d91ab..48a50f707 100644 --- a/Source/win32/GSRunLoopCtxt.m +++ b/Source/win32/GSRunLoopCtxt.m @@ -380,8 +380,23 @@ static const NSMapTableValueCallBacks WatcherMapValueCallBacks = wait_timeout = 0; // Processed something ... no need to wait. } - wait_return = MsgWaitForMultipleObjects(num_handles, handleArray, - NO, wait_timeout, QS_ALLINPUT); + if (num_winMsgs > 0) + { + /* + * Wait for signalled events or window messages. + */ + wait_return = MsgWaitForMultipleObjects(num_handles, handleArray, + NO, wait_timeout, QS_ALLINPUT); + } + else + { + /* + * We are not interested in windows messages ... just wait for + * signalled events. + */ + wait_return = WaitForMultipleObjects(num_handles, handleArray, + NO, wait_timeout); + } NSDebugMLLog(@"NSRunLoop", @"wait returned %d", wait_return); // if there are windows message diff --git a/Source/win32/NSStreamWin32.m b/Source/win32/NSStreamWin32.m index f2249f59c..51782278d 100644 --- a/Source/win32/NSStreamWin32.m +++ b/Source/win32/NSStreamWin32.m @@ -295,8 +295,7 @@ static void setNonblocking(SOCKET fd) { int fd; - fd = _wopen((unichar*)[_path cStringUsingEncoding: NSUnicodeStringEncoding], - O_RDONLY|O_BINARY); + fd = _wopen([_path fileSystemRepresentation], O_RDONLY|O_BINARY); if (fd < 0) { [self _recordError]; @@ -790,8 +789,7 @@ static void setNonblocking(SOCKET fd) flag = flag | O_APPEND; else flag = flag | O_TRUNC; - fd = _wopen((unichar*)[_path cStringUsingEncoding: NSUnicodeStringEncoding], - flag, mode); + fd = _wopen([_path fileSystemRepresentation], flag, mode); if (fd < 0) { // make an error [self _recordError];