Remaining changes needed to build zita-convolver with MSVC

This commit is contained in:
John Emmas 2018-10-22 08:56:22 +01:00
parent 16927d747f
commit 947f6c78b2
3 changed files with 12 additions and 15 deletions

View file

@ -34,6 +34,8 @@
using namespace ARDOUR::DSP; using namespace ARDOUR::DSP;
using namespace ArdourZita; using namespace ArdourZita;
using ARDOUR::Session;
Convolver::Convolver (Session& session, std::string const& path, IRChannelConfig irc, uint32_t pre_delay) Convolver::Convolver (Session& session, std::string const& path, IRChannelConfig irc, uint32_t pre_delay)
: SessionHandleRef (session) : SessionHandleRef (session)
, _irc (irc) , _irc (irc)

View file

@ -22,8 +22,8 @@
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#if _MSC_VER #ifdef _MSC_VER
#include <windows.h> // Needed for 'Sleep()' #include <windows.h> // Needed for MSVC 'Sleep()'
#endif #endif
#include "zita-convolver/zita-convolver.h" #include "zita-convolver/zita-convolver.h"
@ -356,7 +356,7 @@ Convproc::cleanup (void)
uint32_t k; uint32_t k;
while (!check_stop ()) { while (!check_stop ()) {
#if _MSC_VER #ifdef _MSC_VER
Sleep (100); Sleep (100);
#else #else
usleep (100000); usleep (100000);

View file

@ -20,6 +20,7 @@
#ifndef ARDOUR_ZITA_CONVOLVER_H #ifndef ARDOUR_ZITA_CONVOLVER_H
#define ARDOUR_ZITA_CONVOLVER_H #define ARDOUR_ZITA_CONVOLVER_H
#include <fftw3.h> #include <fftw3.h>
#include <pthread.h> #include <pthread.h>
#include <stdint.h> #include <stdint.h>
@ -32,11 +33,8 @@ namespace ArdourZita {
#undef ZCSEMA_IS_IMPLEMENTED #undef ZCSEMA_IS_IMPLEMENTED
#endif #endif
/* Note: /* note: mingw and msvc actually use PTW32's implementation of semaphores */
* - __MINGW32__ is also defined for 64bit builds #if defined(__linux__) || defined(__GNU__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(PTW32_VERSION)
* - 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__)
#include <semaphore.h> #include <semaphore.h>
@ -53,9 +51,6 @@ public:
sem_destroy (&_sema); sem_destroy (&_sema);
} }
ZCsema (const ZCsema&); // disabled
ZCsema& operator= (const ZCsema&); // disabled
int init (int s, int v) int init (int s, int v)
{ {
return sem_init (&_sema, s, v); return sem_init (&_sema, s, v);
@ -77,13 +72,15 @@ public:
} }
private: private:
ZCsema (const ZCsema&); // disabled
ZCsema& operator= (const ZCsema&); // disabled
sem_t _sema; sem_t _sema;
}; };
#define ZCSEMA_IS_IMPLEMENTED #define ZCSEMA_IS_IMPLEMENTED
#endif
#if defined (__APPLE__) || defined (_MSC_VER) #elif defined (__APPLE__)
// NOTE: ***** I DO NOT REPEAT NOT PROVIDE SUPPORT FOR OSX ***** // NOTE: ***** I DO NOT REPEAT NOT PROVIDE SUPPORT FOR OSX *****
// //
@ -106,10 +103,8 @@ public:
pthread_cond_destroy (&_cond); pthread_cond_destroy (&_cond);
} }
#ifndef _MSC_VER /* remove for MSVC build */
ZCsema (const ZCsema&); // disabled ZCsema (const ZCsema&); // disabled
ZCsema& operator= (const ZCsema&); // disabled ZCsema& operator= (const ZCsema&); // disabled
#endif
int init (int s, int v) int init (int s, int v)
{ {