Remaining changes needed to build zita-convolver with MSVC
authorJohn Emmas <johne53@tiscali.co.uk>
Mon, 22 Oct 2018 07:56:22 +0000 (08:56 +0100)
committerJohn Emmas <johne53@tiscali.co.uk>
Mon, 22 Oct 2018 07:56:22 +0000 (08:56 +0100)
libs/ardour/convolver.cc
libs/zita-convolver/zita-convolver.cc
libs/zita-convolver/zita-convolver/zita-convolver.h

index bd00dccbe5bf03daac883a15ed093ad0d2e263ac..d0caa8e669ab16983802aacf248d7dff3b854ada 100644 (file)
@@ -34,6 +34,8 @@
 using namespace ARDOUR::DSP;
 using namespace ArdourZita;
 
+using ARDOUR::Session;
+
 Convolver::Convolver (Session& session, std::string const& path, IRChannelConfig irc, uint32_t pre_delay)
        : SessionHandleRef (session)
        , _irc (irc)
index 91637b46d467c1557e222fdc03dcece373cb12c6..eb7d6603e14a1820c973f9da1fc46b8721e00885 100644 (file)
@@ -22,8 +22,8 @@
 #include <string.h>
 #include <unistd.h>
 
-#if _MSC_VER
-#include <windows.h> // Needed for 'Sleep()'
+#ifdef _MSC_VER
+#include <windows.h>  // Needed for MSVC 'Sleep()'
 #endif
 
 #include "zita-convolver/zita-convolver.h"
@@ -356,7 +356,7 @@ Convproc::cleanup (void)
        uint32_t k;
 
        while (!check_stop ()) {
-#if _MSC_VER
+#ifdef _MSC_VER
                Sleep (100);
 #else
                usleep (100000);
index 39ec4ed4748fcbce06e274728087850f422c3147..6c4859bce530ca39154884b212c1e839719402fd 100644 (file)
@@ -20,6 +20,7 @@
 #ifndef ARDOUR_ZITA_CONVOLVER_H
 #define ARDOUR_ZITA_CONVOLVER_H
 
+
 #include <fftw3.h>
 #include <pthread.h>
 #include <stdint.h>
@@ -32,11 +33,8 @@ namespace ArdourZita {
 #undef ZCSEMA_IS_IMPLEMENTED
 #endif
 
-/* Note:
- * - __MINGW32__ is also defined for 64bit builds
- * - mingw, x-compile uses PTW32's implementation of semaphores, we should prefer defined(PTW32_VERSION)
- */
-#if defined(__linux__) || defined(__GNU__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined (__MINGW32__)
+/* note: mingw and msvc actually use PTW32's implementation of semaphores */
+#if defined(__linux__) || defined(__GNU__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(PTW32_VERSION)
 
 #include <semaphore.h>
 
@@ -53,9 +51,6 @@ public:
                sem_destroy (&_sema);
        }
 
-       ZCsema (const ZCsema&);            // disabled
-       ZCsema& operator= (const ZCsema&); // disabled
-
        int init (int s, int v)
        {
                return sem_init (&_sema, s, v);
@@ -77,13 +72,15 @@ public:
        }
 
 private:
+       ZCsema (const ZCsema&);            // disabled
+       ZCsema& operator= (const ZCsema&); // disabled
+
        sem_t _sema;
 };
 
 #define ZCSEMA_IS_IMPLEMENTED
-#endif
 
-#if defined (__APPLE__) || defined (_MSC_VER)
+#elif defined (__APPLE__)
 
 // NOTE:  ***** I DO NOT REPEAT NOT PROVIDE SUPPORT FOR OSX *****
 //
@@ -106,10 +103,8 @@ public:
                pthread_cond_destroy (&_cond);
        }
 
-#ifndef _MSC_VER /* remove for MSVC build */
        ZCsema (const ZCsema&);            // disabled
        ZCsema& operator= (const ZCsema&); // disabled
-#endif
 
        int init (int s, int v)
        {