blob: 703382516f35e9920777dd0357899190b939c0f0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
To: vim_dev@googlegroups.com
Subject: Patch 7.3.605
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------
Patch 7.3.605 (after 7.3.577)
Problem: MS-Windows: Can't compile with older compilers. (Titov Anatoly)
Solution: Add #ifdef for MEMORYSTATUSEX.
Files: src/os_win32.c
*** ../vim-7.3.604/src/os_win32.c 2012-06-29 15:51:26.000000000 +0200
--- src/os_win32.c 2012-07-19 11:35:00.000000000 +0200
***************
*** 4999,5020 ****
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
{
MEMORYSTATUSEX ms;
ms.dwLength = sizeof(MEMORYSTATUSEX);
GlobalMemoryStatusEx(&ms);
return (long_u)((ms.ullAvailPhys + ms.ullAvailPageFile) >> 10);
}
}
#ifdef FEAT_MBYTE
--- 4999,5025 ----
long_u
mch_avail_mem(int special)
{
! #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
*** ../vim-7.3.604/src/version.c 2012-07-16 19:27:25.000000000 +0200
--- src/version.c 2012-07-19 11:36:12.000000000 +0200
***************
*** 716,717 ****
--- 716,719 ----
{ /* Add new patch number below this line */
+ /**/
+ 605,
/**/
--
Fingers not found - Pound head on keyboard to continue.
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|