File tree Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -45,9 +45,19 @@ void msec_sleep_tv(struct timeval *tv) {
45
45
#define sleep_select select
46
46
#endif
47
47
48
- #if CLOCKS_PER_SEC == 1000000 // POSIX
48
+ // mingw32 defines CLOCKS_PER_SEC as ((clock_t)<somevalue>) but preprocessor does not handle casts
49
+ #if defined(__MINGW32__ ) && !defined(__MINGW64_VERSION_MAJOR )
50
+ #define MP_REMOVE_BRACKETSA (x )
51
+ #define MP_REMOVE_BRACKETSB (x ) MP_REMOVE_BRACKETSA x
52
+ #define MP_REMOVE_BRACKETSC (x ) MP_REMOVE_BRACKETSB x
53
+ #define MP_CLOCKS_PER_SEC MP_REMOVE_BRACKETSC(CLOCKS_PER_SEC)
54
+ #else
55
+ #define MP_CLOCKS_PER_SEC CLOCKS_PER_SEC
56
+ #endif
57
+
58
+ #if defined(MP_CLOCKS_PER_SEC ) && (MP_CLOCKS_PER_SEC == 1000000 ) // POSIX
49
59
#define CLOCK_DIV 1000.0
50
- #elif CLOCKS_PER_SEC == 1000 // WIN32
60
+ #elif defined( MP_CLOCKS_PER_SEC ) && ( MP_CLOCKS_PER_SEC == 1000 ) // WIN32
51
61
#define CLOCK_DIV 1.0
52
62
#else
53
63
#error Unsupported clock() implementation
Original file line number Diff line number Diff line change 26
26
27
27
#include <stdlib.h>
28
28
#include <stdio.h>
29
- #include <Windows .h>
29
+ #include <windows .h>
30
30
31
31
HANDLE hSleepEvent = NULL ;
32
32
Original file line number Diff line number Diff line change 24
24
* THE SOFTWARE.
25
25
*/
26
26
27
- #include <Windows .h>
27
+ #include <windows .h>
28
28
29
29
extern HANDLE hSleepEvent ;
30
30
You can’t perform that action at this time.
0 commit comments