aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFabrice Popineau2012-12-08 14:06:46 +0200
committerEli Zaretskii2012-12-08 14:06:46 +0200
commitcb576b5cd0d5899b73ce92c2d7d58535c60bb1d2 (patch)
treec769f25683dfa08e1dc1b8a9a3057b0f88f7e9b0 /src
parent6ce49f24590f0dbd9cf127756c6ea57311657cb8 (diff)
downloademacs-cb576b5cd0d5899b73ce92c2d7d58535c60bb1d2.tar.gz
emacs-cb576b5cd0d5899b73ce92c2d7d58535c60bb1d2.zip
Fix incompatibilities with 64-bit Windows builds.
src/w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to DWORD_PTR, for compatibility with 64-bit builds. src/w32.c (_PROCESS_MEMORY_COUNTERS_EX): (GetProcessWorkingSetSize_Proc, get_process_working_set_size) (system_process_attributes): Use SIZE_T rather than DWORD, for compatibility with 64-bit builds.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog10
-rw-r--r--src/w32.c36
-rw-r--r--src/w32fns.c2
3 files changed, 29 insertions, 19 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 427f729730f..f3af852f9e9 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,13 @@
12012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
2
3 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
4 DWORD_PTR, for compatibility with 64-bit builds.
5
6 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
7 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
8 (system_process_attributes): Use SIZE_T rather than DWORD, for
9 compatibility with 64-bit builds.
10
12012-12-08 Christopher Schmidt <christopher@ch.ristopher.com> 112012-12-08 Christopher Schmidt <christopher@ch.ristopher.com>
2 12
3 * lread.c (Vload_source_file_function): Doc fix (Bug#11647). 13 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
diff --git a/src/w32.c b/src/w32.c
index f5630993d43..fc97b0b490b 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -101,17 +101,17 @@ typedef struct _MEMORY_STATUS_EX {
101 _WIN32_WINNT than what we use. w32api supplied with MinGW 3.15 101 _WIN32_WINNT than what we use. w32api supplied with MinGW 3.15
102 defines it in psapi.h */ 102 defines it in psapi.h */
103typedef struct _PROCESS_MEMORY_COUNTERS_EX { 103typedef struct _PROCESS_MEMORY_COUNTERS_EX {
104 DWORD cb; 104 DWORD cb;
105 DWORD PageFaultCount; 105 DWORD PageFaultCount;
106 DWORD PeakWorkingSetSize; 106 SIZE_T PeakWorkingSetSize;
107 DWORD WorkingSetSize; 107 SIZE_T WorkingSetSize;
108 DWORD QuotaPeakPagedPoolUsage; 108 SIZE_T QuotaPeakPagedPoolUsage;
109 DWORD QuotaPagedPoolUsage; 109 SIZE_T QuotaPagedPoolUsage;
110 DWORD QuotaPeakNonPagedPoolUsage; 110 SIZE_T QuotaPeakNonPagedPoolUsage;
111 DWORD QuotaNonPagedPoolUsage; 111 SIZE_T QuotaNonPagedPoolUsage;
112 DWORD PagefileUsage; 112 SIZE_T PagefileUsage;
113 DWORD PeakPagefileUsage; 113 SIZE_T PeakPagefileUsage;
114 DWORD PrivateUsage; 114 SIZE_T PrivateUsage;
115} PROCESS_MEMORY_COUNTERS_EX,*PPROCESS_MEMORY_COUNTERS_EX; 115} PROCESS_MEMORY_COUNTERS_EX,*PPROCESS_MEMORY_COUNTERS_EX;
116#endif 116#endif
117 117
@@ -351,8 +351,8 @@ typedef BOOL (WINAPI * GetProcessMemoryInfo_Proc) (
351 DWORD cb); 351 DWORD cb);
352typedef BOOL (WINAPI * GetProcessWorkingSetSize_Proc) ( 352typedef BOOL (WINAPI * GetProcessWorkingSetSize_Proc) (
353 HANDLE hProcess, 353 HANDLE hProcess,
354 DWORD * lpMinimumWorkingSetSize, 354 PSIZE_T lpMinimumWorkingSetSize,
355 DWORD * lpMaximumWorkingSetSize); 355 PSIZE_T lpMaximumWorkingSetSize);
356typedef BOOL (WINAPI * GlobalMemoryStatus_Proc) ( 356typedef BOOL (WINAPI * GlobalMemoryStatus_Proc) (
357 LPMEMORYSTATUS lpBuffer); 357 LPMEMORYSTATUS lpBuffer);
358typedef BOOL (WINAPI * GlobalMemoryStatusEx_Proc) ( 358typedef BOOL (WINAPI * GlobalMemoryStatusEx_Proc) (
@@ -4620,8 +4620,8 @@ get_process_memory_info (HANDLE h_proc,
4620 4620
4621static BOOL WINAPI 4621static BOOL WINAPI
4622get_process_working_set_size (HANDLE h_proc, 4622get_process_working_set_size (HANDLE h_proc,
4623 DWORD *minrss, 4623 PSIZE_T minrss,
4624 DWORD *maxrss) 4624 PSIZE_T maxrss)
4625{ 4625{
4626 static GetProcessWorkingSetSize_Proc 4626 static GetProcessWorkingSetSize_Proc
4627 s_pfn_Get_Process_Working_Set_Size = NULL; 4627 s_pfn_Get_Process_Working_Set_Size = NULL;
@@ -4866,7 +4866,7 @@ system_process_attributes (Lisp_Object pid)
4866 unsigned egid; 4866 unsigned egid;
4867 PROCESS_MEMORY_COUNTERS mem; 4867 PROCESS_MEMORY_COUNTERS mem;
4868 PROCESS_MEMORY_COUNTERS_EX mem_ex; 4868 PROCESS_MEMORY_COUNTERS_EX mem_ex;
4869 DWORD minrss, maxrss; 4869 SIZE_T minrss, maxrss;
4870 MEMORYSTATUS memst; 4870 MEMORYSTATUS memst;
4871 MEMORY_STATUS_EX memstex; 4871 MEMORY_STATUS_EX memstex;
4872 double totphys = 0.0; 4872 double totphys = 0.0;
@@ -5094,7 +5094,7 @@ system_process_attributes (Lisp_Object pid)
5094 && get_process_memory_info (h_proc, (PROCESS_MEMORY_COUNTERS *)&mem_ex, 5094 && get_process_memory_info (h_proc, (PROCESS_MEMORY_COUNTERS *)&mem_ex,
5095 sizeof (mem_ex))) 5095 sizeof (mem_ex)))
5096 { 5096 {
5097 DWORD rss = mem_ex.WorkingSetSize / 1024; 5097 SIZE_T rss = mem_ex.WorkingSetSize / 1024;
5098 5098
5099 attrs = Fcons (Fcons (Qmajflt, 5099 attrs = Fcons (Fcons (Qmajflt,
5100 make_fixnum_or_float (mem_ex.PageFaultCount)), 5100 make_fixnum_or_float (mem_ex.PageFaultCount)),
@@ -5109,7 +5109,7 @@ system_process_attributes (Lisp_Object pid)
5109 else if (h_proc 5109 else if (h_proc
5110 && get_process_memory_info (h_proc, &mem, sizeof (mem))) 5110 && get_process_memory_info (h_proc, &mem, sizeof (mem)))
5111 { 5111 {
5112 DWORD rss = mem_ex.WorkingSetSize / 1024; 5112 SIZE_T rss = mem_ex.WorkingSetSize / 1024;
5113 5113
5114 attrs = Fcons (Fcons (Qmajflt, 5114 attrs = Fcons (Fcons (Qmajflt,
5115 make_fixnum_or_float (mem.PageFaultCount)), 5115 make_fixnum_or_float (mem.PageFaultCount)),
diff --git a/src/w32fns.c b/src/w32fns.c
index 8e1ecc1cb00..de5cee1d7a7 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -7032,7 +7032,7 @@ cache_system_info (void)
7032 7032
7033 /* Cache page size, allocation unit, processor type, etc. */ 7033 /* Cache page size, allocation unit, processor type, etc. */
7034 GetSystemInfo (&sysinfo_cache); 7034 GetSystemInfo (&sysinfo_cache);
7035 syspage_mask = sysinfo_cache.dwPageSize - 1; 7035 syspage_mask = (DWORD_PTR)sysinfo_cache.dwPageSize - 1;
7036 7036
7037 /* Cache os info. */ 7037 /* Cache os info. */
7038 osinfo_cache.dwOSVersionInfoSize = sizeof (OSVERSIONINFO); 7038 osinfo_cache.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);