move clock_gettime() into GNU.cpp
This commit is contained in:
+12
-1
@@ -1,3 +1,5 @@
|
|||||||
|
#include <time.h>
|
||||||
|
#include <sys/time.h>
|
||||||
#include "GNU.h"
|
#include "GNU.h"
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
@@ -6,4 +8,13 @@ void * _aligned_malloc(size_t size, size_t alignment) {
|
|||||||
posix_memalign(&buffer, alignment, size);
|
posix_memalign(&buffer, alignment, size);
|
||||||
return buffer;
|
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__ */
|
||||||
|
|||||||
+5
-14
@@ -24,26 +24,17 @@
|
|||||||
#define _aligned_malloc(size,alignment) memalign(alignment,size)
|
#define _aligned_malloc(size,alignment) memalign(alignment,size)
|
||||||
#else
|
#else
|
||||||
void * _aligned_malloc(size_t size, size_t alignment);
|
void * _aligned_malloc(size_t size, size_t alignment);
|
||||||
|
int clock_gettime(int foo, struct timespec *ts);
|
||||||
#define wxIsNaN(x) ((x) != (x))
|
#define wxIsNaN(x) ((x) != (x))
|
||||||
#endif
|
|
||||||
|
|
||||||
#define _aligned_free free
|
|
||||||
|
|
||||||
#ifndef CLOCK_MONOTONIC
|
#ifndef CLOCK_MONOTONIC
|
||||||
#define CLOCK_MONOTONIC 0
|
#define CLOCK_MONOTONIC 0
|
||||||
#include <time.h>
|
|
||||||
#include <sys/time.h>
|
|
||||||
|
|
||||||
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 /* !CLOCK_MONOTONIC */
|
||||||
|
|
||||||
|
#endif /* !__APPLE__ */
|
||||||
|
|
||||||
|
#define _aligned_free free
|
||||||
|
|
||||||
#define DWORD int32_t
|
#define DWORD int32_t
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user