From 5cbb8be132eb25b73bd0ab576b9b35feb8b7ca1f Mon Sep 17 00:00:00 2001 From: Spoike Date: Sun, 3 Aug 2014 15:02:39 +0000 Subject: [PATCH] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4715 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/qclib/progsint.h | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/engine/qclib/progsint.h b/engine/qclib/progsint.h index b1bbb339b..0b89e6f0a 100644 --- a/engine/qclib/progsint.h +++ b/engine/qclib/progsint.h @@ -467,16 +467,19 @@ pbool PDECL ED_ParseEval (pubprogfuncs_t *progfuncs, eval_t *eval, int type, con //linux/unix has some annoying abstraction and shows time in nanoseconds rather than cycles. lets hope we don't waste too much time reading it. #include #if defined(_POSIX_TIMERS) && _POSIX_TIMERS >= 0 - static unsigned long long Sys_GetClock(void) - { - struct timespec c; - clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &c); - return (c.tv_sec*1000000000ull) + tc.tv_nsec; - } - static unsigned long long Sys_GetClockRate(void) - { - return 1000000000ull; - } + #include + #ifdef CLOCK_PROCESS_CPUTIME_ID + static unsigned long long Sys_GetClock(void) + { + struct timespec c; + clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &c); + return (c.tv_sec*1000000000ull) + tc.tv_nsec; + } + static unsigned long long Sys_GetClockRate(void) + { + return 1000000000ull; + } + #endif #endif #endif