comparison base/System.cpp @ 103:173b39ea0728

* win32 fixes
author Chris Cannam
date Fri, 05 May 2006 13:29:31 +0000
parents ce1d385f4f89
children ac89a106f155
comparison
equal deleted inserted replaced
102:0a846f83a4b7 103:173b39ea0728
23 23
24 #ifdef _WIN32 24 #ifdef _WIN32
25 25
26 extern "C" { 26 extern "C" {
27 27
28 void usleep(unsigned long usec)
29 {
30 Sleep(usec / 1000);
31 }
32
28 void gettimeofday(struct timeval *tv, void *tz) 33 void gettimeofday(struct timeval *tv, void *tz)
29 { 34 {
30 union { 35 union {
31 long long ns100; 36 long long ns100;
32 FILETIME ft; 37 FILETIME ft;
43 48
44 ProcessStatus 49 ProcessStatus
45 GetProcessStatus(int pid) 50 GetProcessStatus(int pid)
46 { 51 {
47 #ifdef _WIN32 52 #ifdef _WIN32
48 DWORD handle = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, pid); 53 HANDLE handle = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, pid);
49 if (!handle) { 54 if (!handle) {
50 return ProcessNotRunning; 55 return ProcessNotRunning;
51 } else { 56 } else {
52 CloseHandle(handle); 57 CloseHandle(handle);
53 return ProcessRunning; 58 return ProcessRunning;