From ebe20a08251aa4dc48b0f9ef2c144681679f4dd2 Mon Sep 17 00:00:00 2001 From: Andreas Schroeder Date: Tue, 29 Apr 2014 22:10:42 +0200 Subject: [PATCH] move clock_gettime() into GNU.cpp --- Utilities/GNU.cpp | 13 ++++++++++++- Utilities/GNU.h | 19 +++++-------------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/Utilities/GNU.cpp b/Utilities/GNU.cpp index fec72a632f..bb0a784fe7 100644 --- a/Utilities/GNU.cpp +++ b/Utilities/GNU.cpp @@ -1,3 +1,5 @@ +#include +#include #include "GNU.h" #ifdef __APPLE__ @@ -6,4 +8,13 @@ void * _aligned_malloc(size_t size, size_t alignment) { posix_memalign(&buffer, alignment, size); return buffer; } -#endif + +int clock_gettime(int foo, struct timespec *ts) { + struct timeval tv; + + gettimeofday(&tv, NULL); + ts->tv_sec = tv.tv_sec; + ts->tv_nsec = tv.tv_usec * 1000; + return(0); +} +#endif /* !__APPLE__ */ diff --git a/Utilities/GNU.h b/Utilities/GNU.h index 46fa6faf35..f5324c5cfe 100644 --- a/Utilities/GNU.h +++ b/Utilities/GNU.h @@ -24,26 +24,17 @@ #define _aligned_malloc(size,alignment) memalign(alignment,size) #else void * _aligned_malloc(size_t size, size_t alignment); +int clock_gettime(int foo, struct timespec *ts); #define wxIsNaN(x) ((x) != (x)) -#endif - -#define _aligned_free free #ifndef CLOCK_MONOTONIC #define CLOCK_MONOTONIC 0 -#include -#include - -static int clock_gettime(int foo, struct timespec *ts) { - struct timeval tv; - - gettimeofday(&tv, NULL); - ts->tv_sec = tv.tv_sec; - ts->tv_nsec = tv.tv_usec * 1000; - return (0); -} #endif /* !CLOCK_MONOTONIC */ +#endif /* !__APPLE__ */ + +#define _aligned_free free + #define DWORD int32_t #endif