summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2008-07-10 14:36:57 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2008-07-10 14:36:57 +0000
commitda41e49022542abfa67bb5d423a7d00a890830ca (patch)
treec7ffb48955423043cbefefc6f61cfcbb51e07249
parent61fe7e0c3ab1b2323993805554377f3c69d31eda (diff)
posix_memalign fixes from RB svn
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3580 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--libs/rubberband/src/sysutils.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/libs/rubberband/src/sysutils.cpp b/libs/rubberband/src/sysutils.cpp
index aa9f92d4d7..120b936729 100644
--- a/libs/rubberband/src/sysutils.cpp
+++ b/libs/rubberband/src/sysutils.cpp
@@ -25,6 +25,7 @@
#endif /* !__APPLE__, !_WIN32 */
#endif /* !_WIN32 */
+#include <cstdlib>
#include <iostream>
#include <stdlib.h>
@@ -108,8 +109,10 @@ float *allocFloat(float *ptr, int count)
if (ptr) free((void *)ptr);
void *allocated;
#ifndef _WIN32
+#ifndef __APPLE__
if (!posix_memalign(&allocated, 16, count * sizeof(float)))
#endif
+#endif
allocated = malloc(count * sizeof(float));
for (int i = 0; i < count; ++i) ((float *)allocated)[i] = 0.f;
return (float *)allocated;
@@ -130,8 +133,10 @@ double *allocDouble(double *ptr, int count)
if (ptr) free((void *)ptr);
void *allocated;
#ifndef _WIN32
+#ifndef __APPLE__
if (!posix_memalign(&allocated, 16, count * sizeof(double)))
#endif
+#endif
allocated = malloc(count * sizeof(double));
for (int i = 0; i < count; ++i) ((double *)allocated)[i] = 0.f;
return (double *)allocated;