From 9aea3b2d31037a22bed5869e669c15b8fe5f6675 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Fri, 9 Jun 2006 11:52:50 +0200 Subject: [PATCH] kernel: Added support for GlobalMemoryStatus on MacOS. --- dlls/kernel/heap.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dlls/kernel/heap.c b/dlls/kernel/heap.c index 7e7625c6e08..06f6aa26306 100644 --- a/dlls/kernel/heap.c +++ b/dlls/kernel/heap.c @@ -1171,13 +1171,12 @@ BOOL WINAPI GlobalMemoryStatusEx( LPMEMORYSTATUSEX lpmemex ) SYSTEM_INFO si; #ifdef linux FILE *f; -#endif -#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) - int *tmp; - int size_sys; - int mib[2] = { CTL_HW }; -#endif -#ifdef sun +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) + int *tmp, size_sys, mib[2]; +#elif defined(__APPLE__) + int *tmp, mib[2]; + size_t size_sys; +#elif defined(sun) long pagesize,maxpages,freepages,swapspace,swapfree; struct anoninfo swapinf; int rval; @@ -1243,7 +1242,8 @@ BOOL WINAPI GlobalMemoryStatusEx( LPMEMORYSTATUSEX lpmemex ) / (TotalPhysical / 100); } } -#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__APPLE__) + mib[0] = CTL_HW; mib[1] = HW_PHYSMEM; sysctl(mib, 2, NULL, &size_sys, NULL, 0); tmp = malloc(size_sys * sizeof(int));