changeset 340:ab8e761f3ee9

Win32 build fixes
author Chris Cannam <chris.cannam@eecs.qmul.ac.uk>
date Thu, 12 Jul 2012 14:56:22 +0100
parents 4256f0bb1549
children f67cf32a934b
files src/vamp-sdk/FFT.cpp src/vamp-sdk/FFTimpl.cpp
diffstat 2 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/vamp-sdk/FFT.cpp	Thu Jul 12 14:19:44 2012 +0100
+++ b/src/vamp-sdk/FFT.cpp	Thu Jul 12 14:56:22 2012 +0100
@@ -42,6 +42,11 @@
 #error Unexpected version of Vamp SDK header included
 #endif
 
+#ifdef _MSC_VER
+#include <stdlib.h>
+#include <malloc.h>
+#endif
+
 _VAMP_SDK_PLUGSPACE_BEGIN(FFT.cpp)
 
 namespace Vamp {
--- a/src/vamp-sdk/FFTimpl.cpp	Thu Jul 12 14:19:44 2012 +0100
+++ b/src/vamp-sdk/FFTimpl.cpp	Thu Jul 12 14:56:22 2012 +0100
@@ -27,7 +27,11 @@
 	}
     }
 
+#ifdef _MSC_VER
+    int *table = (int *)_malloca(n * sizeof(int));
+#else
     int table[n];
+#endif
 
     for (i = 0; i < n; ++i) {
         m = i;
@@ -104,5 +108,9 @@
 	    io[i] /= denom;
 	}
     }
+
+#ifdef _MSC_VER
+    _freea(table);
+#endif
 }