in reply to Re: How do I code GlobalMemoryStatusEx in perl
in thread How do I code GlobalMemoryStatusEx in perl

Unfortunately, it works only with Microsoft compilers, but not MinGW

I think the problem with MinGW is that _WIN32_WINNT does not get defined to 0x0500 early enough. A solution is to insert the following code into the script (just above the foo function):
#ifndef _MSC_VER typedef struct _MEMORYSTATUSEX { DWORD dwLength; DWORD dwMemoryLoad; DWORDLONG ullTotalPhys; DWORDLONG ullAvailPhys; DWORDLONG ullTotalPageFile; DWORDLONG ullAvailPageFile; DWORDLONG ullTotalVirtual; DWORDLONG ullAvailVirtual; DWORDLONG ullAvailExtendedVirtual; } MEMORYSTATUSEX,*LPMEMORYSTATUSEX; WINBASEAPI BOOL WINAPI GlobalMemoryStatusEx(LPMEMORYSTATUSEX); #endif
Works for me, anyway :-)

Cheers,
Rob