diff --git a/containers/aligned_vector.h b/containers/aligned_vector.h index 31e4710..a160408 100644 --- a/containers/aligned_vector.h +++ b/containers/aligned_vector.h @@ -2,10 +2,17 @@ #define ALIGNED_VECTOR_H #include -#include #include #include +#ifndef __APPLE__ +#include +#else +/* Linux + Kos define this, OSX does not, so just use malloc there */ +#define memalign(x, size) malloc((size)) +#endif + + #define ALIGNED_VECTOR_INITIAL_CAPACITY 256u typedef struct { diff --git a/containers/stack.h b/containers/stack.h index 4cc15f2..ebb9dec 100644 --- a/containers/stack.h +++ b/containers/stack.h @@ -1,9 +1,16 @@ #ifndef STACK_H #define STACK_H -#include #include +#ifndef __APPLE__ +#include +#else +/* Linux + Kos define this, OSX does not, so just use malloc there */ +#define memalign(x, size) malloc((size)) +#endif + + typedef struct { unsigned char* data; unsigned int capacity;