Commit 42cd1d90 authored by Michael Beck's avatar Michael Beck
Browse files

add code to let it compile under _Win32 (x86)

[r15747]
parent 05364e0b
......@@ -8,6 +8,32 @@
*/
#define TIMING_USE_RDTSC
#if defined(_WIN32)
#ifdef TIMING_USE_RDTSC
typedef unsigned __int64 timing_ticks_t;
__inline timing_ticks_t __timing_ticks(void) { __asm { rdtsc } }
#define timing_ticks(t) ((t) = __timing_ticks())
#define timing_ticks_init(t) ((t) = 0)
#define timing_ticks_cmp(a, b, cmp) ((a) cmp (b))
#define timing_ticks_sub(r, a) ((r) = (r) - (a))
#define timing_ticks_add(r, a) ((r) = (r) + (a))
#define timing_ticks_ulong(t) ((unsigned long) (t))
#define timing_ticks_dbl(t) ((double) (t))
#else
#error NOT IMPLEMENTED YET
#endif /* TIMING_USE_RDTSC */
typedef struct {
int dummy;
} timing_sched_env_t;
#else /* POSIX/Linux stuff */
#include <unistd.h>
#include <time.h>
#include <sys/time.h>
......@@ -80,6 +106,8 @@ typedef struct timeval timing_ticks_t;
#endif /* TIMING_USE_RDTSC ... */
#endif /* _WIN32 */
/**
* Set the current schedule parameters.
* @return 1, if succeeded, 0 if not (see errno, for details).
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment