aboutsummaryrefslogtreecommitdiffstats
path: root/unmaintained/ladspa/0002-plugin-constructor-destructor.patch
blob: f0061e823d22821bdf0fffb5671ad588f517e768 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
From d281f99e3776027e98f3b9d952fad0d456a75b8a Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Sat, 4 Feb 2012 22:04:33 +0000
Subject: [PATCH 2/3] plugin constructor destructor

---
 src/plugins/amp.c    |    8 ++++----
 src/plugins/delay.c  |    8 ++++----
 src/plugins/filter.c |    8 ++++----
 src/plugins/noise.c  |    8 ++++----
 4 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/src/plugins/amp.c b/src/plugins/amp.c
index b6d2345..a447fa1 100644
--- a/src/plugins/amp.c
+++ b/src/plugins/amp.c
@@ -152,8 +152,8 @@ LADSPA_Descriptor * g_psStereoDescriptor = NULL;
 
 /* _init() is called automatically when the plugin library is first
    loaded. */
-void 
-_init() {
+void __attribute__ ((constructor))
+my_init() {
 
   char ** pcPortNames;
   LADSPA_PortDescriptor * piPortDescriptors;
@@ -335,8 +335,8 @@ deleteDescriptor(LADSPA_Descriptor * psDescriptor) {
 /*****************************************************************************/
 
 /* _fini() is called automatically when the library is unloaded. */
-void
-_fini() {
+void __attribute__ ((destructor))
+my_fini() {
   deleteDescriptor(g_psMonoDescriptor);
   deleteDescriptor(g_psStereoDescriptor);
 }
diff --git a/src/plugins/delay.c b/src/plugins/delay.c
index 8b03979..22e477b 100644
--- a/src/plugins/delay.c
+++ b/src/plugins/delay.c
@@ -228,8 +228,8 @@ LADSPA_Descriptor * g_psDescriptor = NULL;
 
 /* _init() is called automatically when the plugin library is first
    loaded. */
-void 
-_init() {
+void __attribute__ ((constructor))
+my_init() {
 
   char ** pcPortNames;
   LADSPA_PortDescriptor * piPortDescriptors;
@@ -322,8 +322,8 @@ _init() {
 /*****************************************************************************/
 
 /* _fini() is called automatically when the library is unloaded. */
-void 
-_fini() {
+void __attribute__ ((destructor))
+my_fini() {
   long lIndex;
   if (g_psDescriptor) {
     free((char *)g_psDescriptor->Label);
diff --git a/src/plugins/filter.c b/src/plugins/filter.c
index 3f50457..06f7bc6 100644
--- a/src/plugins/filter.c
+++ b/src/plugins/filter.c
@@ -252,8 +252,8 @@ LADSPA_Descriptor * g_psHPFDescriptor = NULL;
 
 /* _init() is called automatically when the plugin library is first
    loaded. */
-void 
-_init() {
+void __attribute__ ((constructor)) 
+my_init() {
 
   char ** pcPortNames;
   LADSPA_PortDescriptor * piPortDescriptors;
@@ -431,8 +431,8 @@ deleteDescriptor(LADSPA_Descriptor * psDescriptor) {
 /*****************************************************************************/
 
 /* _fini() is called automatically when the library is unloaded. */
-void
-_fini() {
+void __attribute__ ((destructor))
+my_fini() {
   deleteDescriptor(g_psLPFDescriptor);
   deleteDescriptor(g_psHPFDescriptor);
 }
diff --git a/src/plugins/noise.c b/src/plugins/noise.c
index 0fdd938..de6fc81 100644
--- a/src/plugins/noise.c
+++ b/src/plugins/noise.c
@@ -142,8 +142,8 @@ LADSPA_Descriptor * g_psDescriptor;
 
 /* _init() is called automatically when the plugin library is first
    loaded. */
-void 
-_init() {
+void __attribute__ ((constructor))
+my_init() {
 
   char ** pcPortNames;
   LADSPA_PortDescriptor * piPortDescriptors;
@@ -219,8 +219,8 @@ _init() {
 /*****************************************************************************/
 
 /* _fini() is called automatically when the library is unloaded. */
-void 
-_fini() {
+void __attribute__ ((destructor)) 
+my_fini() {
   long lIndex;
   if (g_psDescriptor) {
     free((char *)g_psDescriptor->Label);
-- 
1.7.9