zita-convolver: add namespace & visibility, remove global externs

This commit is contained in:
Robin Gareus 2018-10-11 00:43:06 +02:00
parent e554d1fad5
commit 876e780e4d
3 changed files with 44 additions and 29 deletions

View file

@ -25,18 +25,7 @@
#include "zita-convolver/zita-convolver.h"
int zita_convolver_major_version (void)
{
return ZITA_CONVOLVER_MAJOR_VERSION;
}
int zita_convolver_minor_version (void)
{
return ZITA_CONVOLVER_MINOR_VERSION;
}
using namespace ArdourZita;
float Convproc::_mac_cost = 1.0f;
float Convproc::_fft_cost = 5.0f;

View file

@ -0,0 +1,32 @@
#ifndef __libzconvolver_visibility_h__
#define __libzconvolver_visibility_h__
#if defined(COMPILER_MSVC)
#define LIBZCONVOLVER_DLL_IMPORT __declspec(dllimport)
#define LIBZCONVOLVER_DLL_EXPORT __declspec(dllexport)
#define LIBZCONVOLVER_DLL_LOCAL
#else
#define LIBZCONVOLVER_DLL_IMPORT __attribute__ ((visibility ("default")))
#define LIBZCONVOLVER_DLL_EXPORT __attribute__ ((visibility ("default")))
#define LIBZCONVOLVER_DLL_LOCAL __attribute__ ((visibility ("hidden")))
#endif
#ifdef LIBZCONVOLVER_STATIC // libzita-convolver is a DLL
#define LIBZCONVOLVER_API
#define LIBZCONVOLVER_LOCAL
#define LIBZCONVOLVER_TEMPLATE_API
#define LIBZCONVOLVER_TEMPLATE_MEMBER_API
#else
#ifdef LIBZCONVOLVER_DLL_EXPORTS // defined if we are building the libzita-convolver DLL (instead of using it)
#define LIBZCONVOLVER_API LIBZCONVOLVER_DLL_EXPORT
#define LIBZCONVOLVER_TEMPLATE_API LIBZCONVOLVER_TEMPLATE_DLL_EXPORT
#define LIBZCONVOLVER_TEMPLATE_MEMBER_API LIBZCONVOLVER_TEMPLATE_MEMBER_DLL_EXPORT
#else
#define LIBZCONVOLVER_API LIBZCONVOLVER_DLL_IMPORT
#define LIBZCONVOLVER_TEMPLATE_API LIBZCONVOLVER_TEMPLATE_DLL_IMPORT
#define LIBZCONVOLVER_TEMPLATE_MEMBER_API LIBZCONVOLVER_TEMPLATE_MEMBER_DLL_IMPORT
#endif
#define LIBZCONVOLVER_LOCAL LIBZCONVOLVER_DLL_LOCAL
#endif
#endif

View file

@ -26,16 +26,9 @@
#include <stdint.h>
#include <fftw3.h>
#include "zita-convolver/zconvolver_visibility.h"
#define ZITA_CONVOLVER_MAJOR_VERSION 4
#define ZITA_CONVOLVER_MINOR_VERSION 0
extern int zita_convolver_major_version (void);
extern int zita_convolver_minor_version (void);
// ----------------------------------------------------------------------------
namespace ArdourZita {
#ifdef ZCSEMA_IS_IMPLEMENTED
@ -47,7 +40,7 @@ extern int zita_convolver_minor_version (void);
#include <semaphore.h>
class ZCsema
class LIBZCONVOLVER_API ZCsema
{
public:
@ -80,7 +73,7 @@ private:
// and if it compiles it may or may not work correctly. Blame APPLE
// for not following POSIX standards.
class ZCsema
class LIBZCONVOLVER_API ZCsema
{
public:
@ -154,7 +147,7 @@ private:
// ----------------------------------------------------------------------------
class Inpnode
class LIBZCONVOLVER_API Inpnode
{
private:
@ -172,7 +165,7 @@ private:
};
class Macnode
class LIBZCONVOLVER_API Macnode
{
private:
@ -191,7 +184,7 @@ private:
};
class Outnode
class LIBZCONVOLVER_API Outnode
{
private:
@ -207,7 +200,7 @@ private:
};
class Converror
class LIBZCONVOLVER_API Converror
{
public:
@ -226,7 +219,7 @@ private:
};
class Convlevel
class LIBZCONVOLVER_API Convlevel
{
private:
@ -329,7 +322,7 @@ private:
// ----------------------------------------------------------------------------
class Convproc
class LIBZCONVOLVER_API Convproc
{
public:
@ -468,6 +461,7 @@ private:
// ----------------------------------------------------------------------------
} /* end namespace */
#endif