summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabrice Popineau <fabrice.popineau@gmail.com>2012-12-08 14:06:46 +0200
committerEli Zaretskii <eliz@gnu.org>2012-12-08 14:06:46 +0200
commitcb576b5cd0d5899b73ce92c2d7d58535c60bb1d2 (patch)
treec769f25683dfa08e1dc1b8a9a3057b0f88f7e9b0
parent6ce49f24590f0dbd9cf127756c6ea57311657cb8 (diff)
downloademacs-cb576b5cd0d5899b73ce92c2d7d58535c60bb1d2.tar.gz
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.
-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 @@
+2012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
+
+ * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
+ DWORD_PTR, for compatibility with 64-bit builds.
+
+ * 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.
+
2012-12-08 Christopher Schmidt <christopher@ch.ristopher.com>
* 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 {
_WIN32_WINNT than what we use. w32api supplied with MinGW 3.15
defines it in psapi.h */
typedef struct _PROCESS_MEMORY_COUNTERS_EX {
- DWORD cb;
- DWORD PageFaultCount;
- DWORD PeakWorkingSetSize;
- DWORD WorkingSetSize;
- DWORD QuotaPeakPagedPoolUsage;
- DWORD QuotaPagedPoolUsage;
- DWORD QuotaPeakNonPagedPoolUsage;
- DWORD QuotaNonPagedPoolUsage;
- DWORD PagefileUsage;
- DWORD PeakPagefileUsage;
- DWORD PrivateUsage;
+ DWORD cb;
+ DWORD PageFaultCount;
+ SIZE_T PeakWorkingSetSize;
+ SIZE_T WorkingSetSize;
+ SIZE_T QuotaPeakPagedPoolUsage;
+ SIZE_T QuotaPagedPoolUsage;
+ SIZE_T QuotaPeakNonPagedPoolUsage;
+ SIZE_T QuotaNonPagedPoolUsage;
+ SIZE_T PagefileUsage;
+ SIZE_T PeakPagefileUsage;
+ SIZE_T PrivateUsage;
} PROCESS_MEMORY_COUNTERS_EX,*PPROCESS_MEMORY_COUNTERS_EX;
#endif
@@ -351,8 +351,8 @@ typedef BOOL (WINAPI * GetProcessMemoryInfo_Proc) (
DWORD cb);
typedef BOOL (WINAPI * GetProcessWorkingSetSize_Proc) (
HANDLE hProcess,
- DWORD * lpMinimumWorkingSetSize,
- DWORD * lpMaximumWorkingSetSize);
+ PSIZE_T lpMinimumWorkingSetSize,
+ PSIZE_T lpMaximumWorkingSetSize);
typedef BOOL (WINAPI * GlobalMemoryStatus_Proc) (
LPMEMORYSTATUS lpBuffer);
typedef BOOL (WINAPI * GlobalMemoryStatusEx_Proc) (
@@ -4620,8 +4620,8 @@ get_process_memory_info (HANDLE h_proc,
static BOOL WINAPI
get_process_working_set_size (HANDLE h_proc,
- DWORD *minrss,
- DWORD *maxrss)
+ PSIZE_T minrss,
+ PSIZE_T maxrss)
{
static GetProcessWorkingSetSize_Proc
s_pfn_Get_Process_Working_Set_Size = NULL;
@@ -4866,7 +4866,7 @@ system_process_attributes (Lisp_Object pid)
unsigned egid;
PROCESS_MEMORY_COUNTERS mem;
PROCESS_MEMORY_COUNTERS_EX mem_ex;
- DWORD minrss, maxrss;
+ SIZE_T minrss, maxrss;
MEMORYSTATUS memst;
MEMORY_STATUS_EX memstex;
double totphys = 0.0;
@@ -5094,7 +5094,7 @@ system_process_attributes (Lisp_Object pid)
&& get_process_memory_info (h_proc, (PROCESS_MEMORY_COUNTERS *)&mem_ex,
sizeof (mem_ex)))
{
- DWORD rss = mem_ex.WorkingSetSize / 1024;
+ SIZE_T rss = mem_ex.WorkingSetSize / 1024;
attrs = Fcons (Fcons (Qmajflt,
make_fixnum_or_float (mem_ex.PageFaultCount)),
@@ -5109,7 +5109,7 @@ system_process_attributes (Lisp_Object pid)
else if (h_proc
&& get_process_memory_info (h_proc, &mem, sizeof (mem)))
{
- DWORD rss = mem_ex.WorkingSetSize / 1024;
+ SIZE_T rss = mem_ex.WorkingSetSize / 1024;
attrs = Fcons (Fcons (Qmajflt,
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)
/* Cache page size, allocation unit, processor type, etc. */
GetSystemInfo (&sysinfo_cache);
- syspage_mask = sysinfo_cache.dwPageSize - 1;
+ syspage_mask = (DWORD_PTR)sysinfo_cache.dwPageSize - 1;
/* Cache os info. */
osinfo_cache.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);