comparison system/System.cpp @ 1218:6b847a59d908 msvc2015_64

MSVC build fixes
author Chris Cannam
date Tue, 18 Oct 2016 15:54:56 +0100
parents e5a1d815f331
children 39ce813e185c
comparison
equal deleted inserted replaced
1217:046f05fa31f3 1218:6b847a59d908
54 54
55 #ifdef _WIN32 55 #ifdef _WIN32
56 56
57 extern "C" { 57 extern "C" {
58 58
59 /* usleep is now in mingw 59 #ifdef _MSC_VER
60 void usleep(unsigned long usec) 60 void usleep(unsigned long usec)
61 { 61 {
62 ::Sleep(usec / 1000); 62 ::Sleep(usec / 1000);
63 } 63 }
64 */ 64 #endif
65 65
66 int gettimeofday(struct timeval *tv, void *tz) 66 int gettimeofday(struct timeval *tv, void *tz)
67 { 67 {
68 union { 68 union {
69 long long ns100; 69 long long ns100;
117 DWORDLONG ullAvailPageFile; 117 DWORDLONG ullAvailPageFile;
118 DWORDLONG ullTotalVirtual; 118 DWORDLONG ullTotalVirtual;
119 DWORDLONG ullAvailVirtual; 119 DWORDLONG ullAvailVirtual;
120 DWORDLONG ullAvailExtendedVirtual; 120 DWORDLONG ullAvailExtendedVirtual;
121 } lMEMORYSTATUSEX; 121 } lMEMORYSTATUSEX;
122 typedef WINBOOL (WINAPI *PFN_MS_EX) (lMEMORYSTATUSEX*); 122 typedef BOOL (WINAPI *PFN_MS_EX) (lMEMORYSTATUSEX*);
123 #endif 123 #endif
124 124
125 void 125 void
126 GetRealMemoryMBAvailable(ssize_t &available, ssize_t &total) 126 GetRealMemoryMBAvailable(ssize_t &available, ssize_t &total)
127 { 127 {
275 } 275 }
276 276
277 #ifdef _WIN32 277 #ifdef _WIN32
278 extern void SystemMemoryBarrier() 278 extern void SystemMemoryBarrier()
279 { 279 {
280 #ifdef __MSVC__ 280 #ifdef _MSC_VER
281 MemoryBarrier(); 281 MemoryBarrier();
282 #else /* mingw */ 282 #else /* mingw */
283 LONG Barrier = 0; 283 LONG Barrier = 0;
284 __asm__ __volatile__("xchgl %%eax,%0 " 284 __asm__ __volatile__("xchgl %%eax,%0 "
285 : "=r" (Barrier)); 285 : "=r" (Barrier));