From 53d1f81e7f3137fb9fa60c1d54fff481549d81c1 Mon Sep 17 00:00:00 2001 From: CaS Date: Tue, 7 Jan 2003 18:33:51 +0000 Subject: [PATCH] Minor mingw fixes git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@15539 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 6 ++++++ Source/NSLock.m | 12 ++++++++++++ Source/NSPage.m | 6 +++--- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 56a08ce5b..d9263b308 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2003-01-07 Richard Frith-Macdonald + + * Source/NSLock.m: + * Source/NSPage.m: + Mingw fixes ... problems reported by Fred. + 2003-01-04 Richard Frith-Macdonald * Source/NSConcreteNumber.m: ([compare:]) explicitly cast to promote diff --git a/Source/NSLock.m b/Source/NSLock.m index 9878ef933..cd25f25a6 100644 --- a/Source/NSLock.m +++ b/Source/NSLock.m @@ -162,11 +162,15 @@ NSString *NSRecursiveLockException = @"NSRecursiveLockException"; { return NO; } +#if defined(__MINGW__) + Sleep(250); // 0.25 second +#else /* * This should probably be more accurate like usleep(250) * but usleep is known to NOT be thread safe under all architectures. */ sleep(1); +#endif } return YES; } @@ -386,11 +390,15 @@ NSString *NSRecursiveLockException = @"NSRecursiveLockException"; { return NO; } +#if defined(__MINGW__) + Sleep(250); // 0.25 second +#else /* * This should probably be more accurate like usleep(250) * but usleep is known to NOT be thread safe under all architectures. */ sleep(1); +#endif } return YES; } @@ -560,11 +568,15 @@ NSString *NSRecursiveLockException = @"NSRecursiveLockException"; { return NO; } +#if defined(__MINGW__) + Sleep(250); // 0.25 second +#else /* * This should probably be more accurate like usleep(250) * but usleep is known to NOT be thread safe under all architectures. */ sleep(1); +#endif } return YES; } diff --git a/Source/NSPage.m b/Source/NSPage.m index f594fb2a5..949794f8c 100644 --- a/Source/NSPage.m +++ b/Source/NSPage.m @@ -68,7 +68,7 @@ getpagesize(void) #define getpagesize vm_page_size #endif -#if __BEOS__ +#ifdef __BEOS__ #include #define getpagesize() B_PAGE_SIZE #endif @@ -142,12 +142,12 @@ NSRealMemoryAvailable () if ((sysinfo(&info)) != 0) return 0; return (unsigned) info.freeram; -#elif __MINGW__ +#elif defined(__MINGW__) MEMORYSTATUS memory; GlobalMemoryStatus(&memory); return (unsigned)memory.dwAvailPhys; -#elif __BEOS__ +#elif defined(__BEOS__) system_info info; if (get_system_info(&info) != B_OK)