]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.605 v7.3.605
authorBram Moolenaar <Bram@vim.org>
Thu, 19 Jul 2012 09:37:26 +0000 (11:37 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 19 Jul 2012 09:37:26 +0000 (11:37 +0200)
Problem:    MS-Windows: Can't compile with older compilers. (Titov Anatoly)
Solution:   Add #ifdef for MEMORYSTATUSEX.

src/os_win32.c
src/version.c

index af1232eaba18acc79e612cf61d98495b72aed95c..6b29cfc33179dbf847a4417085f32a0da5c25bf2 100644 (file)
@@ -4999,22 +4999,27 @@ mch_breakcheck(void)
     long_u
 mch_avail_mem(int special)
 {
-    if (g_PlatformId != VER_PLATFORM_WIN32_NT)
-    {
-       MEMORYSTATUS    ms;
-
-       ms.dwLength = sizeof(MEMORYSTATUS);
-       GlobalMemoryStatus(&ms);
-       return (long_u)((ms.dwAvailPhys + ms.dwAvailPageFile) >> 10);
-    }
-    else
+#ifdef MEMORYSTATUSEX
+    PlatformId();
+    if (g_PlatformId == VER_PLATFORM_WIN32_NT)
     {
        MEMORYSTATUSEX  ms;
 
+       /* Need to use GlobalMemoryStatusEx() when there is more memory than
+        * what fits in 32 bits. But it's not always available. */
        ms.dwLength = sizeof(MEMORYSTATUSEX);
        GlobalMemoryStatusEx(&ms);
        return (long_u)((ms.ullAvailPhys + ms.ullAvailPageFile) >> 10);
     }
+    else
+#endif
+    {
+       MEMORYSTATUS    ms;
+
+       ms.dwLength = sizeof(MEMORYSTATUS);
+       GlobalMemoryStatus(&ms);
+       return (long_u)((ms.dwAvailPhys + ms.dwAvailPageFile) >> 10);
+    }
 }
 
 #ifdef FEAT_MBYTE
index 80d8c754736db5af422695e83f851fd26aa92981..064af8b2cc9f8e5f23da20f3852a3a70ba254aaf 100644 (file)
@@ -714,6 +714,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    605,
 /**/
     604,
 /**/