comparison system/System.cpp @ 1221:a1b97df9962e 3.0-integration

Merge from branch msvc2015_64
author Chris Cannam
date Thu, 20 Oct 2016 11:16:22 +0100
parents 6b847a59d908
children 39ce813e185c
comparison
equal deleted inserted replaced
1215:f50ded4b951c 1221:a1b97df9962e
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));