fixup for older wndows

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@27034 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2008-11-13 13:43:18 +00:00
parent b3207e1550
commit efd8093546
2 changed files with 14 additions and 0 deletions

View file

@ -140,11 +140,18 @@ NSRealMemoryAvailable ()
return 0;
return info.freeram;
#elif defined(__MINGW32__)
#if (_WIN32_WINNT >= 0x0500)
MEMORYSTATUSEX memory;
memory.dwLength = sizeof(memory);
GlobalMemoryStatusEx(&memory);
return memory.ullAvailPhys;
#else
MEMORYSTATUS memory;
GlobalMemoryStatus(&memory);
return memory.dwAvailPhys;
#endif
#elif defined(__BEOS__)
system_info info;

View file

@ -1277,11 +1277,18 @@ static void determineOperatingSystem()
if (beenHere == NO)
{
#if defined(__MINGW32__)
#if (_WIN32_WINNT >= 0x0500)
MEMORYSTATUSEX memory;
memory.dwLength = sizeof(memory);
GlobalMemoryStatusEx(&memory);
return memory.ullTotalPhys;
#else
MEMORYSTATUS memory;
GlobalMemoryStatus(&memory);
return memory.dwTotalPhys;
#endif
#elif defined(_SC_PHYS_PAGES)
availMem = sysconf(_SC_PHYS_PAGES) * NSPageSize();
#elif defined(HAVE_PROCFS)