diff options
| author | Eli Zaretskii | 2008-08-15 17:36:48 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2008-08-15 17:36:48 +0000 |
| commit | 235661f6d5ee8034271d01e21d279eb35aeba3ca (patch) | |
| tree | eca0846d5710d5d5f15409f81aa72d3e7f0f0e59 | |
| parent | 8e764ce06db3cfc2dc84c0e81c276715a332fe21 (diff) | |
| download | emacs-235661f6d5ee8034271d01e21d279eb35aeba3ca.tar.gz emacs-235661f6d5ee8034271d01e21d279eb35aeba3ca.zip | |
(w32_system_process_attributes) [_MSC_VER < 1300]: Alternative calculation
of totphys for Visual Studio 6.
| -rw-r--r-- | src/ChangeLog | 3 | ||||
| -rw-r--r-- | src/w32.c | 12 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index d7f5b59387d..42a0cabbafc 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2008-08-15 Eli Zaretskii <eliz@gnu.org> | 1 | 2008-08-15 Eli Zaretskii <eliz@gnu.org> |
| 2 | 2 | ||
| 3 | * w32.c (w32_system_process_attributes) [_MSC_VER < 1300]: | ||
| 4 | Alternative calculation of totphys for Visual Studio 6. | ||
| 5 | |||
| 3 | * w32fns.c [_MSC_VER && _MSC_VER < 1300]: Declare HMONITOR. | 6 | * w32fns.c [_MSC_VER && _MSC_VER < 1300]: Declare HMONITOR. |
| 4 | 7 | ||
| 5 | * w32.c (_MEMORY_STATUS_EX, MEMORY_STATUS_EX, LPMEMORY_STATUS_EX): | 8 | * w32.c (_MEMORY_STATUS_EX, MEMORY_STATUS_EX, LPMEMORY_STATUS_EX): |
| @@ -3992,7 +3992,19 @@ w32_system_process_attributes (pid) | |||
| 3992 | attrs); | 3992 | attrs); |
| 3993 | 3993 | ||
| 3994 | if (global_memory_status_ex (&memstex)) | 3994 | if (global_memory_status_ex (&memstex)) |
| 3995 | #if __GNUC__ || (defined (_MSC_VER) && _MSC_VER >= 1300) | ||
| 3995 | totphys = memstex.ullTotalPhys / 1024.0; | 3996 | totphys = memstex.ullTotalPhys / 1024.0; |
| 3997 | #else | ||
| 3998 | /* Visual Studio 6 cannot convert an unsigned __int64 type to | ||
| 3999 | double, so we need to do this for it... */ | ||
| 4000 | { | ||
| 4001 | DWORD tot_hi = memstex.ullTotalPhys >> 32; | ||
| 4002 | DWORD tot_md = (memstex.ullTotalPhys & 0x00000000ffffffff) >> 10; | ||
| 4003 | DWORD tot_lo = memstex.ullTotalPhys % 1024; | ||
| 4004 | |||
| 4005 | totphys = tot_hi * 4194304.0 + tot_md + tot_lo / 1024.0; | ||
| 4006 | } | ||
| 4007 | #endif /* __GNUC__ || _MSC_VER >= 1300 */ | ||
| 3996 | else if (global_memory_status (&memst)) | 4008 | else if (global_memory_status (&memst)) |
| 3997 | totphys = memst.dwTotalPhys / 1024.0; | 4009 | totphys = memst.dwTotalPhys / 1024.0; |
| 3998 | 4010 | ||