remove second ifdefs for windows timing by introducing ported version of clock_gettime
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
||||
#include <windows.h>
|
||||
#include <time.h>
|
||||
|
||||
|
||||
// Below code is originally from mman-win32
|
||||
@@ -12,9 +13,9 @@
|
||||
* mman-win32
|
||||
*/
|
||||
|
||||
#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later.
|
||||
#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows.
|
||||
#endif
|
||||
#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later.
|
||||
#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows.
|
||||
#endif
|
||||
|
||||
/* All the headers include this file. */
|
||||
#ifndef _MSC_VER
|
||||
@@ -47,12 +48,16 @@ extern "C" {
|
||||
#define MS_SYNC 2
|
||||
#define MS_INVALIDATE 4
|
||||
|
||||
/* Flags for portable clock_gettime call. */
|
||||
#define CLOCK_REALTIME 0
|
||||
|
||||
void* mmap(void *addr, size_t len, int prot, int flags, int fildes, off_t off);
|
||||
int munmap(void *addr, size_t len);
|
||||
int mprotect(void *addr, size_t len, int prot);
|
||||
int msync(void *addr, size_t len, int flags);
|
||||
int mlock(const void *addr, size_t len);
|
||||
int munlock(const void *addr, size_t len);
|
||||
int clock_gettime(int clk_id, struct timespec *tp);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user