From 279c84b6a4110552b3416b0278ba88e02cfd34d2 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Fri, 18 Jul 2008 23:42:05 +0000 Subject: [PATCH] added constructor/destructor-attribute to _init() and _finit()-methods in order to make those LADSPA-plugins work properly in win32-version git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1346 0778d3d1-df1d-0410-868b-ea421aaaa00d --- plugins/ladspa_effect/tap/Makefile.am | 36 +++++++++---------- plugins/ladspa_effect/tap/tap_autopan.c | 8 ++--- plugins/ladspa_effect/tap/tap_chorusflanger.c | 8 ++--- plugins/ladspa_effect/tap/tap_deesser.c | 8 ++--- plugins/ladspa_effect/tap/tap_doubler.c | 8 ++--- plugins/ladspa_effect/tap/tap_dynamics_m.c | 8 ++--- plugins/ladspa_effect/tap/tap_dynamics_st.c | 8 ++--- plugins/ladspa_effect/tap/tap_echo.c | 8 ++--- plugins/ladspa_effect/tap/tap_eq.c | 4 +-- plugins/ladspa_effect/tap/tap_eqbw.c | 4 +-- plugins/ladspa_effect/tap/tap_limiter.c | 8 ++--- plugins/ladspa_effect/tap/tap_pinknoise.c | 8 ++--- plugins/ladspa_effect/tap/tap_pitch.c | 8 ++--- plugins/ladspa_effect/tap/tap_reflector.c | 8 ++--- plugins/ladspa_effect/tap/tap_reverb.c | 8 ++--- plugins/ladspa_effect/tap/tap_rotspeak.c | 8 ++--- plugins/ladspa_effect/tap/tap_sigmoid.c | 8 ++--- plugins/ladspa_effect/tap/tap_tremolo.c | 8 ++--- plugins/ladspa_effect/tap/tap_tubewarmth.c | 8 ++--- plugins/ladspa_effect/tap/tap_vibrato.c | 8 ++--- 20 files changed, 90 insertions(+), 90 deletions(-) diff --git a/plugins/ladspa_effect/tap/Makefile.am b/plugins/ladspa_effect/tap/Makefile.am index 0eb0b045f..b32469725 100644 --- a/plugins/ladspa_effect/tap/Makefile.am +++ b/plugins/ladspa_effect/tap/Makefile.am @@ -15,24 +15,24 @@ SHARED_EXT=so LINKFLAGS=-nostartfiles endif -PLUGINS = tap_autopan.$(SHARED_EXT) \ - tap_chorusflanger.$(SHARED_EXT) \ - tap_deesser.$(SHARED_EXT) \ - tap_dynamics_m.$(SHARED_EXT) \ - tap_dynamics_st.$(SHARED_EXT) \ - tap_eq.$(SHARED_EXT) \ - tap_eqbw.$(SHARED_EXT) \ - tap_doubler.$(SHARED_EXT) \ - tap_pinknoise.$(SHARED_EXT) \ - tap_pitch.$(SHARED_EXT) \ - tap_reflector.$(SHARED_EXT) \ - tap_reverb.$(SHARED_EXT) \ - tap_rotspeak.$(SHARED_EXT) \ - tap_limiter.$(SHARED_EXT) \ - tap_sigmoid.$(SHARED_EXT) \ - tap_echo.$(SHARED_EXT) \ - tap_tremolo.$(SHARED_EXT) \ - tap_tubewarmth.$(SHARED_EXT) \ +PLUGINS = tap_autopan.$(SHARED_EXT) \ + tap_chorusflanger.$(SHARED_EXT) \ + tap_deesser.$(SHARED_EXT) \ + tap_dynamics_m.$(SHARED_EXT) \ + tap_dynamics_st.$(SHARED_EXT) \ + tap_eq.$(SHARED_EXT) \ + tap_eqbw.$(SHARED_EXT) \ + tap_doubler.$(SHARED_EXT) \ + tap_pinknoise.$(SHARED_EXT) \ + tap_pitch.$(SHARED_EXT) \ + tap_reflector.$(SHARED_EXT) \ + tap_reverb.$(SHARED_EXT) \ + tap_rotspeak.$(SHARED_EXT) \ + tap_limiter.$(SHARED_EXT) \ + tap_sigmoid.$(SHARED_EXT) \ + tap_echo.$(SHARED_EXT) \ + tap_tremolo.$(SHARED_EXT) \ + tap_tubewarmth.$(SHARED_EXT) \ tap_vibrato.$(SHARED_EXT) diff --git a/plugins/ladspa_effect/tap/tap_autopan.c b/plugins/ladspa_effect/tap/tap_autopan.c index af533fff3..ae1647849 100644 --- a/plugins/ladspa_effect/tap/tap_autopan.c +++ b/plugins/ladspa_effect/tap/tap_autopan.c @@ -233,10 +233,10 @@ LADSPA_Descriptor * mono_descriptor = NULL; -/* _init() is called automatically when the plugin library is first +/* __attribute__((constructor)) _init() is called automatically when the plugin library is first loaded. */ void -_init() { +__attribute__((constructor)) _init() { int i; char ** port_names; @@ -341,9 +341,9 @@ delete_descriptor(LADSPA_Descriptor * descriptor) { } -/* _fini() is called automatically when the library is unloaded. */ +/* __attribute__((destructor)) _fini() is called automatically when the library is unloaded. */ void -_fini() { +__attribute__((destructor)) _fini() { delete_descriptor(mono_descriptor); } diff --git a/plugins/ladspa_effect/tap/tap_chorusflanger.c b/plugins/ladspa_effect/tap/tap_chorusflanger.c index 8276cad8a..ce21733f3 100644 --- a/plugins/ladspa_effect/tap/tap_chorusflanger.c +++ b/plugins/ladspa_effect/tap/tap_chorusflanger.c @@ -436,10 +436,10 @@ LADSPA_Descriptor * stereo_descriptor = NULL; -/* _init() is called automatically when the plugin library is first +/* __attribute__((constructor)) _init() is called automatically when the plugin library is first loaded. */ void -_init() { +__attribute__((constructor)) _init() { char ** port_names; LADSPA_PortDescriptor * port_descriptors; @@ -575,9 +575,9 @@ delete_descriptor(LADSPA_Descriptor * descriptor) { } -/* _fini() is called automatically when the library is unloaded. */ +/* __attribute__((destructor)) _fini() is called automatically when the library is unloaded. */ void -_fini() { +__attribute__((destructor)) _fini() { delete_descriptor(stereo_descriptor); } diff --git a/plugins/ladspa_effect/tap/tap_deesser.c b/plugins/ladspa_effect/tap/tap_deesser.c index c9c56cbb0..399c9bd9b 100644 --- a/plugins/ladspa_effect/tap/tap_deesser.c +++ b/plugins/ladspa_effect/tap/tap_deesser.c @@ -349,10 +349,10 @@ LADSPA_Descriptor * mono_descriptor = NULL; -/* _init() is called automatically when the plugin library is first +/* __attribute__((constructor)) _init() is called automatically when the plugin library is first loaded. */ void -_init() { +__attribute__((constructor)) _init() { int i; char ** port_names; @@ -471,9 +471,9 @@ delete_descriptor(LADSPA_Descriptor * descriptor) { } -/* _fini() is called automatically when the library is unloaded. */ +/* __attribute__((destructor)) _fini() is called automatically when the library is unloaded. */ void -_fini() { +__attribute__((destructor)) _fini() { delete_descriptor(mono_descriptor); } diff --git a/plugins/ladspa_effect/tap/tap_doubler.c b/plugins/ladspa_effect/tap/tap_doubler.c index c66707f69..ff9248934 100644 --- a/plugins/ladspa_effect/tap/tap_doubler.c +++ b/plugins/ladspa_effect/tap/tap_doubler.c @@ -574,10 +574,10 @@ LADSPA_Descriptor * stereo_descriptor = NULL; -/* _init() is called automatically when the plugin library is first +/* __attribute__((constructor)) _init() is called automatically when the plugin library is first loaded. */ void -_init() { +__attribute__((constructor)) _init() { char ** port_names; LADSPA_PortDescriptor * port_descriptors; @@ -717,9 +717,9 @@ delete_descriptor(LADSPA_Descriptor * descriptor) { } -/* _fini() is called automatically when the library is unloaded. */ +/* __attribute__((destructor)) _fini() is called automatically when the library is unloaded. */ void -_fini() { +__attribute__((destructor)) _fini() { delete_descriptor(stereo_descriptor); } diff --git a/plugins/ladspa_effect/tap/tap_dynamics_m.c b/plugins/ladspa_effect/tap/tap_dynamics_m.c index 546f2ba38..4dffee820 100644 --- a/plugins/ladspa_effect/tap/tap_dynamics_m.c +++ b/plugins/ladspa_effect/tap/tap_dynamics_m.c @@ -516,10 +516,10 @@ LADSPA_Descriptor * mono_descriptor = NULL; -/* _init() is called automatically when the plugin library is first +/* __attribute__((constructor)) _init() is called automatically when the plugin library is first loaded. */ void -_init() { +__attribute__((constructor)) _init() { char ** port_names; LADSPA_PortDescriptor * port_descriptors; @@ -646,9 +646,9 @@ delete_descriptor(LADSPA_Descriptor * descriptor) { } -/* _fini() is called automatically when the library is unloaded. */ +/* __attribute__((destructor)) _fini() is called automatically when the library is unloaded. */ void -_fini() { +__attribute__((destructor)) _fini() { delete_descriptor(mono_descriptor); } diff --git a/plugins/ladspa_effect/tap/tap_dynamics_st.c b/plugins/ladspa_effect/tap/tap_dynamics_st.c index e7cf9b38f..fa2f0cd16 100644 --- a/plugins/ladspa_effect/tap/tap_dynamics_st.c +++ b/plugins/ladspa_effect/tap/tap_dynamics_st.c @@ -696,10 +696,10 @@ LADSPA_Descriptor * stereo_descriptor = NULL; -/* _init() is called automatically when the plugin library is first +/* __attribute__((constructor)) _init() is called automatically when the plugin library is first loaded. */ void -_init() { +__attribute__((constructor)) _init() { char ** port_names; LADSPA_PortDescriptor * port_descriptors; @@ -857,9 +857,9 @@ delete_descriptor(LADSPA_Descriptor * descriptor) { } -/* _fini() is called automatically when the library is unloaded. */ +/* __attribute__((destructor)) _fini() is called automatically when the library is unloaded. */ void -_fini() { +__attribute__((destructor)) _fini() { delete_descriptor(stereo_descriptor); } diff --git a/plugins/ladspa_effect/tap/tap_echo.c b/plugins/ladspa_effect/tap/tap_echo.c index 817a893d2..4f9e6cdde 100644 --- a/plugins/ladspa_effect/tap/tap_echo.c +++ b/plugins/ladspa_effect/tap/tap_echo.c @@ -437,10 +437,10 @@ LADSPA_Descriptor * stereo_descriptor = NULL; -/* _init() is called automatically when the plugin library is first +/* __attribute__((constructor)) _init() is called automatically when the plugin library is first loaded. */ void -_init() { +__attribute__((constructor)) _init() { char ** port_names; LADSPA_PortDescriptor * port_descriptors; @@ -608,9 +608,9 @@ delete_descriptor(LADSPA_Descriptor * descriptor) { } -/* _fini() is called automatically when the library is unloaded. */ +/* __attribute__((destructor)) _fini() is called automatically when the library is unloaded. */ void -_fini() { +__attribute__((destructor)) _fini() { delete_descriptor(stereo_descriptor); } diff --git a/plugins/ladspa_effect/tap/tap_eq.c b/plugins/ladspa_effect/tap/tap_eq.c index 200df151d..2ce3eb236 100644 --- a/plugins/ladspa_effect/tap/tap_eq.c +++ b/plugins/ladspa_effect/tap/tap_eq.c @@ -468,7 +468,7 @@ run_adding_eq(LADSPA_Handle instance, unsigned long sample_count) { void -_init() { +__attribute__((constructor)) _init() { char **port_names; LADSPA_PortDescriptor *port_descriptors; @@ -739,7 +739,7 @@ _init() { void -_fini() { +__attribute__((destructor)) _fini() { if (eqDescriptor) { free((LADSPA_PortDescriptor *)eqDescriptor->PortDescriptors); diff --git a/plugins/ladspa_effect/tap/tap_eqbw.c b/plugins/ladspa_effect/tap/tap_eqbw.c index 876530e33..accfd836f 100644 --- a/plugins/ladspa_effect/tap/tap_eqbw.c +++ b/plugins/ladspa_effect/tap/tap_eqbw.c @@ -562,7 +562,7 @@ run_adding_eq(LADSPA_Handle instance, unsigned long sample_count) { void -_init() { +__attribute__((constructor)) _init() { char **port_names; LADSPA_PortDescriptor *port_descriptors; @@ -921,7 +921,7 @@ _init() { void -_fini() { +__attribute__((destructor)) _fini() { if (eqDescriptor) { free((LADSPA_PortDescriptor *)eqDescriptor->PortDescriptors); diff --git a/plugins/ladspa_effect/tap/tap_limiter.c b/plugins/ladspa_effect/tap/tap_limiter.c index 06456bca5..c27c39c88 100644 --- a/plugins/ladspa_effect/tap/tap_limiter.c +++ b/plugins/ladspa_effect/tap/tap_limiter.c @@ -324,10 +324,10 @@ LADSPA_Descriptor * mono_descriptor = NULL; -/* _init() is called automatically when the plugin library is first +/* __attribute__((constructor)) _init() is called automatically when the plugin library is first loaded. */ void -_init() { +__attribute__((constructor)) _init() { char ** port_names; LADSPA_PortDescriptor * port_descriptors; @@ -423,9 +423,9 @@ delete_descriptor(LADSPA_Descriptor * descriptor) { } -/* _fini() is called automatically when the library is unloaded. */ +/* __attribute__((destructor)) _fini() is called automatically when the library is unloaded. */ void -_fini() { +__attribute__((destructor)) _fini() { delete_descriptor(mono_descriptor); } diff --git a/plugins/ladspa_effect/tap/tap_pinknoise.c b/plugins/ladspa_effect/tap/tap_pinknoise.c index 99bfb4172..26c59429b 100644 --- a/plugins/ladspa_effect/tap/tap_pinknoise.c +++ b/plugins/ladspa_effect/tap/tap_pinknoise.c @@ -225,10 +225,10 @@ LADSPA_Descriptor * mono_descriptor = NULL; -/* _init() is called automatically when the plugin library is first +/* __attribute__((constructor)) _init() is called automatically when the plugin library is first loaded. */ void -_init() { +__attribute__((constructor)) _init() { char ** port_names; LADSPA_PortDescriptor * port_descriptors; @@ -325,9 +325,9 @@ delete_descriptor(LADSPA_Descriptor * descriptor) { } -/* _fini() is called automatically when the library is unloaded. */ +/* __attribute__((destructor)) _fini() is called automatically when the library is unloaded. */ void -_fini() { +__attribute__((destructor)) _fini() { delete_descriptor(mono_descriptor); } diff --git a/plugins/ladspa_effect/tap/tap_pitch.c b/plugins/ladspa_effect/tap/tap_pitch.c index d87cd2f1e..bb69e0cd9 100644 --- a/plugins/ladspa_effect/tap/tap_pitch.c +++ b/plugins/ladspa_effect/tap/tap_pitch.c @@ -418,10 +418,10 @@ LADSPA_Descriptor * mono_descriptor = NULL; -/* _init() is called automatically when the plugin library is first +/* __attribute__((constructor)) _init() is called automatically when the plugin library is first loaded. */ void -_init() { +__attribute__((constructor)) _init() { int i; char ** port_names; @@ -536,9 +536,9 @@ delete_descriptor(LADSPA_Descriptor * descriptor) { } -/* _fini() is called automatically when the library is unloaded. */ +/* __attribute__((destructor)) _fini() is called automatically when the library is unloaded. */ void -_fini() { +__attribute__((destructor)) _fini() { delete_descriptor(mono_descriptor); } diff --git a/plugins/ladspa_effect/tap/tap_reflector.c b/plugins/ladspa_effect/tap/tap_reflector.c index c4526a7ee..e94a322d3 100644 --- a/plugins/ladspa_effect/tap/tap_reflector.c +++ b/plugins/ladspa_effect/tap/tap_reflector.c @@ -378,10 +378,10 @@ LADSPA_Descriptor * mono_descriptor = NULL; -/* _init() is called automatically when the plugin library is first +/* __attribute__((constructor)) _init() is called automatically when the plugin library is first loaded. */ void -_init() { +__attribute__((constructor)) _init() { int i; char ** port_names; @@ -480,9 +480,9 @@ delete_descriptor(LADSPA_Descriptor * descriptor) { } -/* _fini() is called automatically when the library is unloaded. */ +/* __attribute__((destructor)) _fini() is called automatically when the library is unloaded. */ void -_fini() { +__attribute__((destructor)) _fini() { delete_descriptor(mono_descriptor); } diff --git a/plugins/ladspa_effect/tap/tap_reverb.c b/plugins/ladspa_effect/tap/tap_reverb.c index b3799cf68..5594d41e2 100644 --- a/plugins/ladspa_effect/tap/tap_reverb.c +++ b/plugins/ladspa_effect/tap/tap_reverb.c @@ -665,10 +665,10 @@ LADSPA_Descriptor * stereo_descriptor = NULL; -/* _init() is called automatically when the plugin library is first +/* __attribute__((constructor)) _init() is called automatically when the plugin library is first loaded. */ void -_init() { +__attribute__((constructor)) _init() { char ** port_names; LADSPA_PortDescriptor * port_descriptors; @@ -815,9 +815,9 @@ delete_descriptor(LADSPA_Descriptor * descriptor) { } -/* _fini() is called automatically when the library is unloaded. */ +/* __attribute__((destructor)) _fini() is called automatically when the library is unloaded. */ void -_fini() { +__attribute__((destructor)) _fini() { delete_descriptor(stereo_descriptor); } diff --git a/plugins/ladspa_effect/tap/tap_rotspeak.c b/plugins/ladspa_effect/tap/tap_rotspeak.c index 119541c27..c35d10843 100644 --- a/plugins/ladspa_effect/tap/tap_rotspeak.c +++ b/plugins/ladspa_effect/tap/tap_rotspeak.c @@ -576,10 +576,10 @@ LADSPA_Descriptor * stereo_descriptor = NULL; -/* _init() is called automatically when the plugin library is first +/* __attribute__((constructor)) _init() is called automatically when the plugin library is first loaded. */ void -_init() { +__attribute__((constructor)) _init() { int i; char ** port_names; @@ -700,9 +700,9 @@ delete_descriptor(LADSPA_Descriptor * descriptor) { } -/* _fini() is called automatically when the library is unloaded. */ +/* __attribute__((destructor)) _fini() is called automatically when the library is unloaded. */ void -_fini() { +__attribute__((destructor)) _fini() { delete_descriptor(stereo_descriptor); } diff --git a/plugins/ladspa_effect/tap/tap_sigmoid.c b/plugins/ladspa_effect/tap/tap_sigmoid.c index 4ce68618c..5a78a5148 100644 --- a/plugins/ladspa_effect/tap/tap_sigmoid.c +++ b/plugins/ladspa_effect/tap/tap_sigmoid.c @@ -187,10 +187,10 @@ LADSPA_Descriptor * mono_descriptor = NULL; -/* _init() is called automatically when the plugin library is first +/* __attribute__((constructor)) _init() is called automatically when the plugin library is first loaded. */ void -_init() { +__attribute__((constructor)) _init() { char ** port_names; LADSPA_PortDescriptor * port_descriptors; @@ -277,9 +277,9 @@ delete_descriptor(LADSPA_Descriptor * descriptor) { } -/* _fini() is called automatically when the library is unloaded. */ +/* __attribute__((destructor)) _fini() is called automatically when the library is unloaded. */ void -_fini() { +__attribute__((destructor)) _fini() { delete_descriptor(mono_descriptor); } diff --git a/plugins/ladspa_effect/tap/tap_tremolo.c b/plugins/ladspa_effect/tap/tap_tremolo.c index c70eb98c2..8374b5536 100644 --- a/plugins/ladspa_effect/tap/tap_tremolo.c +++ b/plugins/ladspa_effect/tap/tap_tremolo.c @@ -220,10 +220,10 @@ LADSPA_Descriptor * mono_descriptor = NULL; -/* _init() is called automatically when the plugin library is first +/* __attribute__((constructor)) _init() is called automatically when the plugin library is first loaded. */ void -_init() { +__attribute__((constructor)) _init() { char ** port_names; LADSPA_PortDescriptor * port_descriptors; @@ -323,9 +323,9 @@ delete_descriptor(LADSPA_Descriptor * descriptor) { } -/* _fini() is called automatically when the library is unloaded. */ +/* __attribute__((destructor)) _fini() is called automatically when the library is unloaded. */ void -_fini() { +__attribute__((destructor)) _fini() { delete_descriptor(mono_descriptor); } diff --git a/plugins/ladspa_effect/tap/tap_tubewarmth.c b/plugins/ladspa_effect/tap/tap_tubewarmth.c index 736fd4104..3551612f3 100644 --- a/plugins/ladspa_effect/tap/tap_tubewarmth.c +++ b/plugins/ladspa_effect/tap/tap_tubewarmth.c @@ -381,10 +381,10 @@ LADSPA_Descriptor * mono_descriptor = NULL; -/* _init() is called automatically when the plugin library is first +/* __attribute__((constructor)) _init() is called automatically when the plugin library is first loaded. */ void -_init() { +__attribute__((constructor)) _init() { char ** port_names; LADSPA_PortDescriptor * port_descriptors; @@ -471,9 +471,9 @@ delete_descriptor(LADSPA_Descriptor * descriptor) { } -/* _fini() is called automatically when the library is unloaded. */ +/* __attribute__((destructor)) _fini() is called automatically when the library is unloaded. */ void -_fini() { +__attribute__((destructor)) _fini() { delete_descriptor(mono_descriptor); } diff --git a/plugins/ladspa_effect/tap/tap_vibrato.c b/plugins/ladspa_effect/tap/tap_vibrato.c index 78a4917ba..577315cfa 100644 --- a/plugins/ladspa_effect/tap/tap_vibrato.c +++ b/plugins/ladspa_effect/tap/tap_vibrato.c @@ -305,10 +305,10 @@ LADSPA_Descriptor * mono_descriptor = NULL; -/* _init() is called automatically when the plugin library is first +/* __attribute__((constructor)) _init() is called automatically when the plugin library is first loaded. */ void -_init() { +__attribute__((constructor)) _init() { int i; char ** port_names; @@ -422,9 +422,9 @@ delete_descriptor(LADSPA_Descriptor * descriptor) { } -/* _fini() is called automatically when the library is unloaded. */ +/* __attribute__((destructor)) _fini() is called automatically when the library is unloaded. */ void -_fini() { +__attribute__((destructor)) _fini() { delete_descriptor(mono_descriptor); }