replace recently added attempt to use visibility macros with one based on gcc guidelines

I can see no reason to define the "C API Call Type", but perhaps it really is needed for some reason.

I have tested this on Linux only.
This commit is contained in:
Paul Davis 2013-09-02 16:41:56 -04:00
parent 2f73855722
commit a431e73ccd
7 changed files with 15 additions and 34 deletions

View file

@ -33,38 +33,14 @@
#include "ardour/types.h"
#include "ardour/automation_control.h"
#include "ardour/automatable.h"
#include "ardour/visibility.h"
#ifndef ARDOURPANNER_IS_IN_SHARED_LIB
#define ARDOURPANNER_IS_IN_SHARED_LIB 1
#endif
#if ARDOURPANNER_IS_IN_SHARED_LIB && !defined(ARDOURPANNER_API)
#define ARDOURPANNER_CAPICALLTYPE __cdecl
#if defined(COMPILER_MSVC) || defined(COMPILER_MINGW)
#if defined(BUILDING_ARDOURPANNERS)
#define ARDOURPANNER_LOCAL
#define ARDOURPANNER_API __declspec(dllexport)
#else
#define ARDOURPANNER_LOCAL
#define ARDOURPANNER_API __declspec(dllimport)
#endif
#else
#if !defined(COMPILER_GCC)
#warning "Attempting to export symbols with an unspecified compiler! GCC assumed!"
#endif
#define ARDOURPANNER_LOCAL __attribute__ ((visibility("hidden")))
#define ARDOURPANNER_API __attribute__ ((visibility("default")))
#endif
#elif !defined(ARDOURPANNER_API)
#define ARDOURPANNER_CAPICALLTYPE __cdecl
/* This library was built statically. */
/* Visibility is determined by the code. */
#define ARDOURPANNER_API
#define ARDOURPANNER_LOCAL
#endif
#ifdef ARDOURPANNER_DLL_EXPORTS // defined if we are building the ARDOUR Panners DLLs (instead of using them)
#define ARDOURPANNER_API LIBARDOUR_HELPER_DLL_EXPORT
#else
#define ARDOURPANNER_API LIBARDOUR_HELPER_DLL_IMPORT
#endif
#define ARDOURPANNER_LOCAL LIBARDOUR_HELPER_DLL_LOCAL
namespace ARDOUR {

View file

@ -51,6 +51,7 @@
#include "ardour/buffer_set.h"
#include "ardour/audio_buffer.h"
#include "ardour/pannable.h"
#include "ardour/visibility.h"
#include "i18n.h"
#include "panner_1in2out.h"
@ -67,7 +68,7 @@ static PanPluginDescriptor _descriptor = {
Panner1in2out::factory
};
extern "C" ARDOURPANNER_API PanPluginDescriptor* ARDOURPANNER_CAPICALLTYPE panner_descriptor () { return &_descriptor; }
extern "C" ARDOURPANNER_API PanPluginDescriptor* panner_descriptor () { return &_descriptor; }
Panner1in2out::Panner1in2out (boost::shared_ptr<Pannable> p)
: Panner (p)

View file

@ -23,6 +23,7 @@ def build(bld):
obj.source = [ 'panner_1in2out.cc' ]
obj.export_includes = ['.']
obj.cxxflags = '-DPACKAGE="libardour_pan1in2out"'
obj.defines = [ 'ARDOURPANNER_DLL_EXPORTS' ]
obj.includes = ['.']
obj.name = 'libardour_pan1in2out'
obj.target = 'pan1in2out'

View file

@ -49,6 +49,7 @@
#include "ardour/runtime_functions.h"
#include "ardour/session.h"
#include "ardour/utils.h"
#include "ardour/visibility.h"
#include "ardour/mix.h"
#include "panner_2in2out.h"
@ -67,7 +68,7 @@ static PanPluginDescriptor _descriptor = {
Panner2in2out::factory
};
extern "C" { PanPluginDescriptor* panner_descriptor () { return &_descriptor; } }
extern "C" ARDOURPANNER_API PanPluginDescriptor* panner_descriptor () { return &_descriptor; }
Panner2in2out::Panner2in2out (boost::shared_ptr<Pannable> p)
: Panner (p)

View file

@ -23,6 +23,7 @@ def build(bld):
obj.source = [ 'panner_2in2out.cc' ]
obj.export_includes = ['.']
obj.cxxflags = '-DPACKAGE="libardour_pan2in2out"'
obj.defines = [ 'ARDOURPANNER_DLL_EXPORTS' ]
obj.includes = ['.']
obj.name = 'libardour_pan2in2out'
obj.target = 'pan2in2out'

View file

@ -50,7 +50,7 @@ static PanPluginDescriptor _descriptor = {
VBAPanner::factory
};
extern "C" { PanPluginDescriptor* panner_descriptor () { return &_descriptor; } }
extern "C" ARDOURPANNER_API PanPluginDescriptor* panner_descriptor () { return &_descriptor; }
VBAPanner::Signal::Signal (Session&, VBAPanner&, uint32_t, uint32_t n_speakers)
{

View file

@ -23,6 +23,7 @@ def build(bld):
obj.source = [ 'vbap_speakers.cc', 'vbap.cc' ]
obj.export_includes = ['.']
obj.cxxflags = '-DPACKAGE="libardour_panvbap"'
obj.defines = [ 'ARDOURPANNER_DLL_EXPORTS' ]
obj.includes = ['.']
obj.name = 'libardour_panvbap'
obj.target = 'panvbap'