Clean up the memalign switching a bit
This commit is contained in:
parent
78f5fc698a
commit
b9f8fe4a4d
|
@ -2,15 +2,13 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#ifndef __APPLE__
|
#if defined(__APPLE__) || defined(__WIN32__)
|
||||||
#if defined(__WIN32__)
|
|
||||||
/* Linux + Kos define this, OSX does not, so just use malloc there */
|
/* 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
|
#else
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#endif
|
|
||||||
/* Linux + Kos define this, OSX does not, so just use malloc there */
|
|
||||||
#define memalign(x, size) malloc((size))
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "aligned_vector.h"
|
#include "aligned_vector.h"
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#ifndef __APPLE__
|
#if defined(__APPLE__) || defined(__WIN32__)
|
||||||
#if defined(__WIN32__)
|
|
||||||
/* Linux + Kos define this, OSX does not, so just use malloc there */
|
/* 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
|
#else
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#endif
|
|
||||||
/* Linux + Kos define this, OSX does not, so just use malloc there */
|
|
||||||
#define memalign(x, size) malloc((size))
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "stack.h"
|
#include "stack.h"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user