Skip to content

Commit

Permalink
Build plugins with -fvisibility=hidden.
Browse files Browse the repository at this point in the history
  • Loading branch information
jlindgren90 committed Sep 28, 2014
1 parent df62dd1 commit c824b18
Show file tree
Hide file tree
Showing 24 changed files with 46 additions and 22 deletions.
20 changes: 20 additions & 0 deletions acinclude.m4
Expand Up @@ -116,6 +116,26 @@ if test $HAVE_MSWINDOWS = yes ; then
CFLAGS="$CFLAGS -march=i686"
fi
dnl Byte order
dnl ==========
AC_C_BIGENDIAN([BIGENDIAN=1], [BIGENDIAN=0],
[AC_MSG_ERROR([Unknown machine byte order])],
[AC_MSG_ERROR([Universal builds are not supported, sorry])])
AC_SUBST([BIGENDIAN])
dnl Prevent symbol collisions
dnl =========================
if test "x$HAVE_MSWINDOWS" = "xyes" ; then
EXPORT="__declspec(dllexport)"
elif test "x$GCC" = "xyes" ; then
CFLAGS="$CFLAGS -fvisibility=hidden"
CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
EXPORT="__attribute__((visibility(\"default\")))"
else
AC_MSG_ERROR([Unknown syntax for EXPORT keyword])
fi
AC_DEFINE_UNQUOTED([EXPORT], [$EXPORT], [Define to compiler syntax for public symbols])
dnl Checks for various programs
dnl ===========================
AC_PROG_LN_S
Expand Down
2 changes: 1 addition & 1 deletion src/asx/asx.cc
Expand Up @@ -48,7 +48,7 @@ class ASXLoader : public PlaylistPlugin
static void handle_entry (const char * key, const char * value, void * data);
};

ASXLoader aud_plugin_instance;
EXPORT ASXLoader aud_plugin_instance;

void ASXLoader::handle_heading (const char * heading, void * data)
{
Expand Down
2 changes: 1 addition & 1 deletion src/asx3/asx3.cc
Expand Up @@ -42,7 +42,7 @@ class ASX3Loader : public PlaylistPlugin
const Index<PlaylistAddItem> & items);
};

ASX3Loader aud_plugin_instance;
EXPORT ASX3Loader aud_plugin_instance;

static int read_cb (void * file, char * buf, int len)
{
Expand Down
2 changes: 1 addition & 1 deletion src/audpl/audpl.cc
Expand Up @@ -52,7 +52,7 @@ class AudPlaylistLoader : public PlaylistPlugin
static void handle_entry (const char * key, const char * value, void * data);
};

AudPlaylistLoader aud_plugin_instance;
EXPORT AudPlaylistLoader aud_plugin_instance;

void AudPlaylistLoader::finish_item (LoadState * state)
{
Expand Down
2 changes: 1 addition & 1 deletion src/blur_scope/blur_scope.cc
Expand Up @@ -86,7 +86,7 @@ class BlurScope : public VisPlugin
uint32_t * image = nullptr, * corner = nullptr;
};

BlurScope aud_plugin_instance;
EXPORT BlurScope aud_plugin_instance;

bool BlurScope::init ()
{
Expand Down
2 changes: 1 addition & 1 deletion src/bs2b/plugin.cc
Expand Up @@ -48,7 +48,7 @@ class BS2BPlugin : public EffectPlugin
void process (float * * data, int * samples);
};

BS2BPlugin aud_plugin_instance;
EXPORT BS2BPlugin aud_plugin_instance;

static t_bs2bdp bs2b = nullptr;
static int bs2b_channels;
Expand Down
2 changes: 1 addition & 1 deletion src/cairo-spectrum/cairo-spectrum.cc
Expand Up @@ -52,7 +52,7 @@ class CairoSpectrum : public VisPlugin
void render_freq (const float * freq);
};

CairoSpectrum aud_plugin_instance;
EXPORT CairoSpectrum aud_plugin_instance;

static GtkWidget * spect_widget = nullptr;
static float xscale[MAX_BANDS + 1];
Expand Down
2 changes: 1 addition & 1 deletion src/compressor/compressor.cc
Expand Up @@ -80,7 +80,7 @@ class Compressor : public EffectPlugin
int adjust_delay (int delay);
};

Compressor aud_plugin_instance;
EXPORT Compressor aud_plugin_instance;

static float * buffer, * output, * peaks;
static int output_size;
Expand Down
2 changes: 1 addition & 1 deletion src/crossfade/crossfade.cc
Expand Up @@ -77,7 +77,7 @@ class Crossfade : public EffectPlugin
int adjust_delay (int delay);
};

Crossfade aud_plugin_instance;
EXPORT Crossfade aud_plugin_instance;

static char state = STATE_OFF;
static int current_channels = 0, current_rate = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/crystalizer/crystalizer.cc
Expand Up @@ -59,7 +59,7 @@ class Crystalizer : public EffectPlugin
void flush ();
};

Crystalizer aud_plugin_instance;
EXPORT Crystalizer aud_plugin_instance;

static int cryst_channels;
static float * cryst_prev;
Expand Down
2 changes: 1 addition & 1 deletion src/cue/cue.cc
Expand Up @@ -42,7 +42,7 @@ class CueLoader : public PlaylistPlugin
Index<PlaylistAddItem> & items);
};

CueLoader aud_plugin_instance;
EXPORT CueLoader aud_plugin_instance;

static const struct {
int tuple_type;
Expand Down
2 changes: 1 addition & 1 deletion src/echo_plugin/echo.cc
Expand Up @@ -60,7 +60,7 @@ class EchoPlugin : public EffectPlugin
void process (float * * data, int * samples);
};

EchoPlugin aud_plugin_instance;
EXPORT EchoPlugin aud_plugin_instance;

static float *buffer = nullptr;
static int w_ofs;
Expand Down
2 changes: 1 addition & 1 deletion src/gio/gio.cc
Expand Up @@ -354,4 +354,4 @@ static const char * const gio_schemes[] = {"ftp", "sftp", "smb"};

constexpr PluginInfo gio_info = {N_("GIO Plugin"), PACKAGE, gio_about};

TransportPlugin aud_plugin_instance (gio_info, gio_schemes, gio_fopen);
EXPORT TransportPlugin aud_plugin_instance (gio_info, gio_schemes, gio_fopen);
2 changes: 1 addition & 1 deletion src/gl-spectrum/gl-spectrum.cc
Expand Up @@ -74,7 +74,7 @@ class GLSpectrum : public VisPlugin
void render_freq (const float * freq);
};

GLSpectrum aud_plugin_instance;
EXPORT GLSpectrum aud_plugin_instance;

static float logscale[NUM_BANDS + 1];
static float colors[NUM_BANDS][NUM_BANDS][3];
Expand Down
2 changes: 1 addition & 1 deletion src/gtkui/ui_gtk.cc
Expand Up @@ -107,7 +107,7 @@ class GtkUI : public IfacePlugin
{ audgui_plugin_menu_remove (id, func); }
};

GtkUI aud_plugin_instance;
EXPORT GtkUI aud_plugin_instance;

static PluginHandle * search_tool;

Expand Down
2 changes: 1 addition & 1 deletion src/ladspa/plugin.cc
Expand Up @@ -557,4 +557,4 @@ static const PreferencesWidget ladspa_widgets[] = {

const PluginPreferences ladspa_prefs = {{ladspa_widgets}};

LADSPAHost aud_plugin_instance;
EXPORT LADSPAHost aud_plugin_instance;
2 changes: 1 addition & 1 deletion src/m3u/m3u.cc
Expand Up @@ -39,7 +39,7 @@ class M3ULoader : public PlaylistPlugin
const Index<PlaylistAddItem> & items);
};

M3ULoader aud_plugin_instance;
EXPORT M3ULoader aud_plugin_instance;

static void strip_char (char * text, char c)
{
Expand Down
2 changes: 1 addition & 1 deletion src/mms/mms.cc
Expand Up @@ -185,4 +185,4 @@ static const char * const mms_schemes[] = {"mms"};

constexpr PluginInfo mms_info = {N_("MMS Plugin"), PACKAGE};

TransportPlugin aud_plugin_instance (mms_info, mms_schemes, mms_fopen);
EXPORT TransportPlugin aud_plugin_instance (mms_info, mms_schemes, mms_fopen);
4 changes: 4 additions & 0 deletions src/mpg123/mpg123.cc
Expand Up @@ -23,6 +23,10 @@

#include <mpg123.h>

// mpg123.h redefines EXPORT
#undef EXPORT
#include "config.h"

#ifdef DEBUG_MPG123_IO
# define MPG123_IODBG(...) AUDDBG(__VA_ARGS__)
#else
Expand Down
2 changes: 1 addition & 1 deletion src/neon/neon.cc
Expand Up @@ -106,7 +106,7 @@ class NeonTransport : public TransportPlugin
void cleanup ();
};

NeonTransport aud_plugin_instance;
EXPORT NeonTransport aud_plugin_instance;

bool NeonTransport::init ()
{
Expand Down
2 changes: 1 addition & 1 deletion src/pls/pls.cc
Expand Up @@ -52,7 +52,7 @@ class PLSLoader : public PlaylistPlugin
static void handle_entry (const char * key, const char * value, void * data);
};

PLSLoader aud_plugin_instance;
EXPORT PLSLoader aud_plugin_instance;

void PLSLoader::handle_heading (const char * heading, void * data)
{
Expand Down
2 changes: 1 addition & 1 deletion src/qtui/qtui.cc
Expand Up @@ -74,4 +74,4 @@ class QtUI : public audqt::QtIfacePlugin
}
};

QtUI aud_plugin_instance;
EXPORT QtUI aud_plugin_instance;
2 changes: 1 addition & 1 deletion src/skins/plugin.cc
Expand Up @@ -86,7 +86,7 @@ class SkinnedUI : public IfacePlugin
{ audgui_plugin_menu_remove (id, func); }
};

SkinnedUI aud_plugin_instance;
EXPORT SkinnedUI aud_plugin_instance;

char * skins_paths[SKINS_PATH_COUNT];

Expand Down
2 changes: 1 addition & 1 deletion src/xspf/xspf.cc
Expand Up @@ -96,7 +96,7 @@ class XSPFLoader : public PlaylistPlugin
const Index<PlaylistAddItem> & items);
};

XSPFLoader aud_plugin_instance;
EXPORT XSPFLoader aud_plugin_instance;

static void xspf_add_file (xmlNode * track, const char * filename,
const char * base, Index<PlaylistAddItem> & items)
Expand Down

0 comments on commit c824b18

Please sign in to comment.