From 16a68c617d8b19b49c669ce4a9a41c9e1a6241bd Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Sun, 9 Sep 2012 18:11:04 +0100 Subject: [PATCH] OS/X build fixes --- Makefile.osx | 4 ++-- src/system/Allocators.h | 2 ++ src/system/VectorOps.h | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile.osx b/Makefile.osx index aec6095..2318559 100644 --- a/Makefile.osx +++ b/Makefile.osx @@ -1,10 +1,10 @@ CXX := g++ CC := gcc -ARCHFLAGS := -arch i386 -arch x86_64 +ARCHFLAGS := OPTFLAGS := -DNDEBUG -ffast-math -mfpmath=sse -msse -msse2 -O3 -ftree-vectorize -CXXFLAGS := $(ARCHFLAGS) $(OPTFLAGS) -I/usr/local/include -DUSE_PTHREADS -DHAVE_VDSP -DUSE_SPEEX -DNO_THREAD_CHECKS -DNO_TIMING -Irubberband -I. -Isrc +CXXFLAGS := $(ARCHFLAGS) $(OPTFLAGS) -I/usr/local/include -DUSE_PTHREADS -DMALLOC_IS_ALIGNED -DHAVE_VDSP -DUSE_SPEEX -DNO_THREAD_CHECKS -DNO_TIMING -Irubberband -I. -Isrc LIBRARY_LIBS := -framework Accelerate diff --git a/src/system/Allocators.h b/src/system/Allocators.h index d1eef7a..08bf58b 100644 --- a/src/system/Allocators.h +++ b/src/system/Allocators.h @@ -77,7 +77,9 @@ T *allocate(size_t count) #ifdef __MSVC__ ptr = _aligned_malloc(count * sizeof(T), alignment); #else /* !__MSVC__ */ +#ifndef MALLOC_IS_ALIGNED #warning "No aligned malloc available or defined" +#endif // Note that malloc always aligns to 16 byte boundaries on OS/X ptr = malloc(count * sizeof(T)); #endif /* !__MSVC__ */ diff --git a/src/system/VectorOps.h b/src/system/VectorOps.h index 8b954ee..03f881c 100644 --- a/src/system/VectorOps.h +++ b/src/system/VectorOps.h @@ -674,7 +674,7 @@ inline void v_abs(float *const R__ dst, const int count) { float tmp[count]; - vvfabf(tmp, dst, &count); + vvfabsf(tmp, dst, &count); v_copy(dst, tmp, count); } #endif