summaryrefslogtreecommitdiff
path: root/libs/zita-convolver
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2018-10-11 00:43:06 +0200
committerRobin Gareus <robin@gareus.org>2018-10-20 00:24:38 +0200
commit876e780e4d93bd61b4b09e4a1bde6ac6c4530bad (patch)
tree03509faac5d9b3c2dda3a8623d54e2650349fa9b /libs/zita-convolver
parente554d1fad53b2d56488bb78007ea8cfdf1adf304 (diff)
zita-convolver: add namespace & visibility, remove global externs
Diffstat (limited to 'libs/zita-convolver')
-rw-r--r--libs/zita-convolver/zita-convolver.cc13
-rw-r--r--libs/zita-convolver/zita-convolver/zconvolver_visibility.h32
-rw-r--r--libs/zita-convolver/zita-convolver/zita-convolver.h28
3 files changed, 44 insertions, 29 deletions
diff --git a/libs/zita-convolver/zita-convolver.cc b/libs/zita-convolver/zita-convolver.cc
index e74711843b..4b7545367f 100644
--- a/libs/zita-convolver/zita-convolver.cc
+++ b/libs/zita-convolver/zita-convolver.cc
@@ -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;
diff --git a/libs/zita-convolver/zita-convolver/zconvolver_visibility.h b/libs/zita-convolver/zita-convolver/zconvolver_visibility.h
new file mode 100644
index 0000000000..8e98fc73d7
--- /dev/null
+++ b/libs/zita-convolver/zita-convolver/zconvolver_visibility.h
@@ -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
diff --git a/libs/zita-convolver/zita-convolver/zita-convolver.h b/libs/zita-convolver/zita-convolver/zita-convolver.h
index f413951dc0..f8d9965f50 100644
--- a/libs/zita-convolver/zita-convolver/zita-convolver.h
+++ b/libs/zita-convolver/zita-convolver/zita-convolver.h
@@ -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