windows tweaks

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29468 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2010-02-03 09:31:59 +00:00
parent 59114c78f1
commit 612ed04160
3 changed files with 11 additions and 7 deletions

View file

@ -1,3 +1,9 @@
2010-02-03 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSThread.m:
Don't use usleep() on windows .. it performas a busy wait so the
Sleep() function is better.
2010-02-01 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSAutoreleasePool.m:

View file

@ -99,7 +99,7 @@ GSPrivateBaseAddress(void *addr, void **base)
*/
if (VirtualQuery (addr, &info, sizeof(info)) != 0)
{
HMODULE handle = (HMODULE) mbi.AllocationBase;
HMODULE handle = (HMODULE) info.AllocationBase;
unichar path[MAX_PATH+1];
if (GetModuleFileNameW(handle, path, sizeof(path)-1) != 0)
@ -107,7 +107,7 @@ GSPrivateBaseAddress(void *addr, void **base)
path[sizeof(path)-1] = '\0';
*base = info.BaseAddress;
return [[NSString stringWithCharacters: path length: wcslen(path)]];
return [NSString stringWithCharacters: path length: wcslen(path)];
}
}
return nil;

View file

@ -220,14 +220,12 @@ GSSleepUntilIntervalSinceReferenceDate(NSTimeInterval when)
*/
while (delay > 0)
{
#ifdef HAVE_USLEEP
#if defined(__MINGW32__)
Sleep ((NSInteger)(delay*1000));
#elif defined(HAVE_USLEEP)
usleep ((NSInteger)(delay*1000000));
#else
#if defined(__MINGW32__)
Sleep (delay*1000);
#else
sleep ((NSInteger)delay);
#endif
#endif
delay = when - GSTimeNow();
}