diff --git a/icbench.c b/icbench.c index b4c17cf..7d91145 100644 --- a/icbench.c +++ b/icbench.c @@ -44,6 +44,8 @@ #define srand48(x) srand(x) #define drand48() ((double)(rand()) / RAND_MAX) #define __off64_t _off64_t + #elif defined(__APPLE__) +#define fopen64(a,b) fopen(a,b) #endif //---------------------------------------- Time ------------------------------- typedef unsigned long long tm_t; @@ -559,7 +561,7 @@ static void *amalloc(size_t size, size_t align) { #elif _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600 void *p; return posix_memalign(&p, align, size)?NULL:p; - #elif __STDC_VERSION__ >= 201112L + #elif !defined(__APPLE__) && __STDC_VERSION__ >= 201112L return aligned_alloc(16, size); #else return malloc(size); @@ -573,7 +575,7 @@ void afree(void *p) { _aligned_free(p); #elif _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600 free(p); - #elif __STDC_VERSION__ >= 201112L + #elif !defined(__APPLE__) && __STDC_VERSION__ >= 201112L aligned_free(p); #else free(size);