Skip to content

Commit

Permalink
Fix for Solaris gave failure on Mac, using only memalign for Solaris …
Browse files Browse the repository at this point in the history
…and for others, keep the original cqdb code.
  • Loading branch information
jwijffels committed Oct 2, 2018
1 parent 3411c34 commit 3ea4194
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/crf/src/vecmath.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,12 @@
#include <stdlib.h>
static inline void *_aligned_malloc(size_t size, size_t alignment)
{
#if __STDC_VERSION__ >= 201112L && !defined(__sun) && !defined(sun)
return aligned_alloc(alignment, size);
#elif _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600
#if defined(__sun) || defined(sun)
return memalign(alignment, size);
#else
void *p;
int ret = posix_memalign(&p, alignment, size);
return (ret == 0) ? p : 0;
#else
return memalign(alignment, size);
#endif
}
static inline void _aligned_free(void *p)
Expand Down

0 comments on commit 3ea4194

Please sign in to comment.