Clean up the memalign switching a bit

This commit is contained in:
Luke Benstead 2018-10-18 09:54:34 +01:00
parent 78f5fc698a
commit b9f8fe4a4d
2 changed files with 11 additions and 14 deletions

View File

@ -2,15 +2,13 @@
#include <string.h>
#include <math.h>
#ifndef __APPLE__
#if defined(__WIN32__)
#if defined(__APPLE__) || defined(__WIN32__)
/* Linux + Kos define this, OSX does not, so just use malloc there */
#define memalign(x, size) malloc((size))
static inline void* memalign(size_t alignment, size_t size) {
return malloc(size);
}
#else
#include <malloc.h>
#endif
/* Linux + Kos define this, OSX does not, so just use malloc there */
#define memalign(x, size) malloc((size))
#include <malloc.h>
#endif
#include "aligned_vector.h"

View File

@ -1,14 +1,13 @@
#include <string.h>
#include <stdlib.h>
#ifndef __APPLE__
#if defined(__WIN32__)
#if defined(__APPLE__) || defined(__WIN32__)
/* Linux + Kos define this, OSX does not, so just use malloc there */
#define memalign(x, size) malloc((size))
static inline void* memalign(size_t alignment, size_t size) {
return malloc(size);
}
#else
#include <malloc.h>
#endif
/* Linux + Kos define this, OSX does not, so just use malloc there */
#define memalign(x, size) malloc((size))
#include <malloc.h>
#endif
#include "stack.h"