Patch submitted by Nic Schraudolph to fix compiling problems on Mac OS X.
This commit is contained in:
@@ -26,7 +26,9 @@
|
||||
/* $Id$ */
|
||||
|
||||
#include <stdlib.h>
|
||||
#ifndef __APPLE__
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#include <memory.h>
|
||||
|
||||
#if 1400 <= _MSC_VER
|
||||
@@ -39,8 +41,10 @@
|
||||
|
||||
inline static void* vecalloc(size_t size)
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
#if defined(_MSC_VER)
|
||||
void *memblock = _aligned_malloc(size, 16);
|
||||
#elif defined(__APPLE__) /* OS X always aligns on 16-byte boundaries */
|
||||
void *memblock = malloc(size);
|
||||
#else
|
||||
void *memblock = memalign(16, size);
|
||||
#endif
|
||||
@@ -192,7 +196,7 @@ inline static void vecfree(void *memblock)
|
||||
|
||||
|
||||
|
||||
#if 3 <= __SSE__
|
||||
#if 3 <= __SSE__ || defined(__SSE3__)
|
||||
/*
|
||||
Horizontal add with haddps SSE3 instruction. The work register (rw)
|
||||
is unused.
|
||||
|
@@ -26,7 +26,9 @@
|
||||
/* $Id$ */
|
||||
|
||||
#include <stdlib.h>
|
||||
#ifndef __APPLE__
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#include <memory.h>
|
||||
|
||||
#if 1400 <= _MSC_VER
|
||||
@@ -45,7 +47,13 @@
|
||||
|
||||
inline static void* vecalloc(size_t size)
|
||||
{
|
||||
#if defined(_MSC_VER)
|
||||
void *memblock = _aligned_malloc(size, 16);
|
||||
#elif defined(__APPLE__) /* OS X always aligns on 16-byte boundaries */
|
||||
void *memblock = malloc(size);
|
||||
#else
|
||||
void *memblock = memalign(16, size);
|
||||
#endif
|
||||
if (memblock != NULL) {
|
||||
memset(memblock, 0, size);
|
||||
}
|
||||
@@ -185,7 +193,7 @@ inline static void vecfree(void *memblock)
|
||||
|
||||
|
||||
|
||||
#if 3 <= __SSE__
|
||||
#if 3 <= __SSE__ || defined(__SSE3__)
|
||||
/*
|
||||
Horizontal add with haddps SSE3 instruction. The work register (rw)
|
||||
is unused.
|
||||
|
Reference in New Issue
Block a user