Karsten Hopp fe5e7b
To: vim_dev@googlegroups.com
Karsten Hopp fe5e7b
Subject: Patch 7.3.605
Karsten Hopp fe5e7b
Fcc: outbox
Karsten Hopp fe5e7b
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp fe5e7b
Mime-Version: 1.0
Karsten Hopp fe5e7b
Content-Type: text/plain; charset=UTF-8
Karsten Hopp fe5e7b
Content-Transfer-Encoding: 8bit
Karsten Hopp fe5e7b
------------
Karsten Hopp fe5e7b
Karsten Hopp fe5e7b
Patch 7.3.605 (after 7.3.577)
Karsten Hopp fe5e7b
Problem:    MS-Windows: Can't compile with older compilers. (Titov Anatoly)
Karsten Hopp fe5e7b
Solution:   Add #ifdef for MEMORYSTATUSEX.
Karsten Hopp fe5e7b
Files:	    src/os_win32.c
Karsten Hopp fe5e7b
Karsten Hopp fe5e7b
Karsten Hopp fe5e7b
*** ../vim-7.3.604/src/os_win32.c	2012-06-29 15:51:26.000000000 +0200
Karsten Hopp fe5e7b
--- src/os_win32.c	2012-07-19 11:35:00.000000000 +0200
Karsten Hopp fe5e7b
***************
Karsten Hopp fe5e7b
*** 4999,5020 ****
Karsten Hopp fe5e7b
      long_u
Karsten Hopp fe5e7b
  mch_avail_mem(int special)
Karsten Hopp fe5e7b
  {
Karsten Hopp fe5e7b
!     if (g_PlatformId != VER_PLATFORM_WIN32_NT)
Karsten Hopp fe5e7b
!     {
Karsten Hopp fe5e7b
! 	MEMORYSTATUS	ms;
Karsten Hopp fe5e7b
! 
Karsten Hopp fe5e7b
! 	ms.dwLength = sizeof(MEMORYSTATUS);
Karsten Hopp fe5e7b
! 	GlobalMemoryStatus(&ms);
Karsten Hopp fe5e7b
! 	return (long_u)((ms.dwAvailPhys + ms.dwAvailPageFile) >> 10);
Karsten Hopp fe5e7b
!     }
Karsten Hopp fe5e7b
!     else
Karsten Hopp fe5e7b
      {
Karsten Hopp fe5e7b
  	MEMORYSTATUSEX	ms;
Karsten Hopp fe5e7b
  
Karsten Hopp fe5e7b
  	ms.dwLength = sizeof(MEMORYSTATUSEX);
Karsten Hopp fe5e7b
  	GlobalMemoryStatusEx(&ms);
Karsten Hopp fe5e7b
  	return (long_u)((ms.ullAvailPhys + ms.ullAvailPageFile) >> 10);
Karsten Hopp fe5e7b
      }
Karsten Hopp fe5e7b
  }
Karsten Hopp fe5e7b
  
Karsten Hopp fe5e7b
  #ifdef FEAT_MBYTE
Karsten Hopp fe5e7b
--- 4999,5025 ----
Karsten Hopp fe5e7b
      long_u
Karsten Hopp fe5e7b
  mch_avail_mem(int special)
Karsten Hopp fe5e7b
  {
Karsten Hopp fe5e7b
! #ifdef MEMORYSTATUSEX
Karsten Hopp fe5e7b
!     PlatformId();
Karsten Hopp fe5e7b
!     if (g_PlatformId == VER_PLATFORM_WIN32_NT)
Karsten Hopp fe5e7b
      {
Karsten Hopp fe5e7b
  	MEMORYSTATUSEX	ms;
Karsten Hopp fe5e7b
  
Karsten Hopp fe5e7b
+ 	/* Need to use GlobalMemoryStatusEx() when there is more memory than
Karsten Hopp fe5e7b
+ 	 * what fits in 32 bits. But it's not always available. */
Karsten Hopp fe5e7b
  	ms.dwLength = sizeof(MEMORYSTATUSEX);
Karsten Hopp fe5e7b
  	GlobalMemoryStatusEx(&ms);
Karsten Hopp fe5e7b
  	return (long_u)((ms.ullAvailPhys + ms.ullAvailPageFile) >> 10);
Karsten Hopp fe5e7b
      }
Karsten Hopp fe5e7b
+     else
Karsten Hopp fe5e7b
+ #endif
Karsten Hopp fe5e7b
+     {
Karsten Hopp fe5e7b
+ 	MEMORYSTATUS	ms;
Karsten Hopp fe5e7b
+ 
Karsten Hopp fe5e7b
+ 	ms.dwLength = sizeof(MEMORYSTATUS);
Karsten Hopp fe5e7b
+ 	GlobalMemoryStatus(&ms);
Karsten Hopp fe5e7b
+ 	return (long_u)((ms.dwAvailPhys + ms.dwAvailPageFile) >> 10);
Karsten Hopp fe5e7b
+     }
Karsten Hopp fe5e7b
  }
Karsten Hopp fe5e7b
  
Karsten Hopp fe5e7b
  #ifdef FEAT_MBYTE
Karsten Hopp fe5e7b
*** ../vim-7.3.604/src/version.c	2012-07-16 19:27:25.000000000 +0200
Karsten Hopp fe5e7b
--- src/version.c	2012-07-19 11:36:12.000000000 +0200
Karsten Hopp fe5e7b
***************
Karsten Hopp fe5e7b
*** 716,717 ****
Karsten Hopp fe5e7b
--- 716,719 ----
Karsten Hopp fe5e7b
  {   /* Add new patch number below this line */
Karsten Hopp fe5e7b
+ /**/
Karsten Hopp fe5e7b
+     605,
Karsten Hopp fe5e7b
  /**/
Karsten Hopp fe5e7b
Karsten Hopp fe5e7b
-- 
Karsten Hopp fe5e7b
Fingers not found - Pound head on keyboard to continue.
Karsten Hopp fe5e7b
Karsten Hopp fe5e7b
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp fe5e7b
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp fe5e7b
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp fe5e7b
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///