Przeglądaj źródła

BUG: fix build on vs6

Bill Hoffman 17 lat temu
rodzic
commit
47fa89b6e9
1 zmienionych plików z 10 dodań i 4 usunięć
  1. 10 4
      Source/kwsys/SystemInformation.cxx

+ 10 - 4
Source/kwsys/SystemInformation.cxx

@@ -2228,13 +2228,19 @@ int SystemInformationImplementation::QueryMemory()
 #ifdef __CYGWIN__
   return 0;
 #elif _WIN32
+#if  _MSC_VER < 1300
+  MEMORYSTATUS ms;
+#define MEM_VAL(value) dw##value
+#else
   MEMORYSTATUSEX ms;
+#define MEM_VAL(value) ull##value
+#endif
   GlobalMemoryStatusEx(&ms);
 
-  unsigned long tv = ms.ullTotalVirtual;
-  unsigned long tp = ms.ullTotalPhys;
-  unsigned long av = ms.ullAvailVirtual;
-  unsigned long ap = ms.ullAvailPhys;
+  unsigned long tv = ms.MEM_VAL(TotalVirtual);
+  unsigned long tp = ms.MEM_VAL(TotalPhys);
+  unsigned long av = ms.MEM_VAL(AvailVirtual);
+  unsigned long ap = ms.MEM_VAL(AvailPhys);
   this->TotalVirtualMemory = tv>>10>>10;
   this->TotalPhysicalMemory = tp>>10>>10;
   this->AvailableVirtualMemory = av>>10>>10;