2014-04-29 00:51:49 +02:00
|
|
|
#include "GNU.h"
|
|
|
|
|
|
|
|
#ifdef __APPLE__
|
2014-07-12 09:02:39 +02:00
|
|
|
#include <time.h>
|
|
|
|
#include <sys/time.h>
|
2014-04-29 22:10:42 +02:00
|
|
|
|
|
|
|
int clock_gettime(int foo, struct timespec *ts) {
|
2014-07-12 09:02:39 +02:00
|
|
|
struct timeval tv;
|
2014-04-29 22:10:42 +02:00
|
|
|
|
2014-07-12 09:02:39 +02:00
|
|
|
gettimeofday(&tv, NULL);
|
|
|
|
ts->tv_sec = tv.tv_sec;
|
|
|
|
ts->tv_nsec = tv.tv_usec * 1000;
|
|
|
|
return(0);
|
2014-04-29 22:10:42 +02:00
|
|
|
}
|
2014-07-12 09:02:39 +02:00
|
|
|
#endif /* __APPLE__ */
|
|
|
|
#if defined(__GNUG__)
|
|
|
|
|
|
|
|
void * _aligned_malloc(size_t size, size_t alignment) {
|
|
|
|
void *buffer;
|
|
|
|
return (posix_memalign(&buffer, alignment, size) == 0) ? buffer : 0;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|