1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-08 04:30:45 -08:00

(w32_system_process_attributes) [_MSC_VER < 1300]: Alternative calculation

of totphys for Visual Studio 6.
This commit is contained in:
Eli Zaretskii 2008-08-15 17:36:48 +00:00
parent 8e764ce06d
commit 235661f6d5
2 changed files with 15 additions and 0 deletions

View file

@ -1,5 +1,8 @@
2008-08-15 Eli Zaretskii <eliz@gnu.org>
* w32.c (w32_system_process_attributes) [_MSC_VER < 1300]:
Alternative calculation of totphys for Visual Studio 6.
* w32fns.c [_MSC_VER && _MSC_VER < 1300]: Declare HMONITOR.
* w32.c (_MEMORY_STATUS_EX, MEMORY_STATUS_EX, LPMEMORY_STATUS_EX):

View file

@ -3992,7 +3992,19 @@ w32_system_process_attributes (pid)
attrs);
if (global_memory_status_ex (&memstex))
#if __GNUC__ || (defined (_MSC_VER) && _MSC_VER >= 1300)
totphys = memstex.ullTotalPhys / 1024.0;
#else
/* Visual Studio 6 cannot convert an unsigned __int64 type to
double, so we need to do this for it... */
{
DWORD tot_hi = memstex.ullTotalPhys >> 32;
DWORD tot_md = (memstex.ullTotalPhys & 0x00000000ffffffff) >> 10;
DWORD tot_lo = memstex.ullTotalPhys % 1024;
totphys = tot_hi * 4194304.0 + tot_md + tot_lo / 1024.0;
}
#endif /* __GNUC__ || _MSC_VER >= 1300 */
else if (global_memory_status (&memst))
totphys = memst.dwTotalPhys / 1024.0;