Skip to content

Commit 1107a91

Browse files
committed
Explicitly mark the backend init symbol visible
1 parent bd9ab57 commit 1107a91

23 files changed

+34
-22
lines changed

backends/artnet.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ static int artnet_listener(char* host, char* port){
4141
return 0;
4242
}
4343

44-
int init(){
44+
MM_PLUGIN_API int init(){
4545
backend artnet = {
4646
.name = BACKEND_NAME,
4747
.conf = artnet_configure,

backends/artnet.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#endif
44
#include "midimonster.h"
55

6-
int init();
6+
MM_PLUGIN_API int init();
77
static int artnet_configure(char* option, char* value);
88
static int artnet_configure_instance(instance* instance, char* option, char* value);
99
static instance* artnet_instance();

backends/evdev.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ static struct {
2424
.detect = 0
2525
};
2626

27-
int init(){
27+
MM_PLUGIN_API int init(){
2828
backend evdev = {
2929
.name = BACKEND_NAME,
3030
.conf = evdev_configure,

backends/evdev.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* disabled by building with -DEVDEV_NO_UINPUT
99
*/
1010

11-
int init();
11+
MM_PLUGIN_API int init();
1212
static int evdev_configure(char* option, char* value);
1313
static int evdev_configure_instance(instance* instance, char* option, char* value);
1414
static instance* evdev_instance();

backends/jack.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
#include <sys/socket.h>
55
#include <unistd.h>
66

7+
#define DEBUG
8+
79
#include "jack.h"
810
#include <jack/midiport.h>
911
#include <jack/metadata.h>
@@ -27,7 +29,7 @@ static struct /*_mmjack_backend_cfg*/ {
2729
.jack_shutdown = 0
2830
};
2931

30-
int init(){
32+
MM_PLUGIN_API int init(){
3133
backend mmjack = {
3234
.name = BACKEND_NAME,
3335
.conf = mmjack_configure,

backends/jack.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include <jack/jack.h>
33
#include <pthread.h>
44

5-
int init();
5+
MM_PLUGIN_API int init();
66
static int mmjack_configure(char* option, char* value);
77
static int mmjack_configure_instance(instance* inst, char* option, char* value);
88
static instance* mmjack_instance();

backends/loopback.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#define BACKEND_NAME "loopback"
55

6-
int init(){
6+
MM_PLUGIN_API int init(){
77
backend loopback = {
88
.name = BACKEND_NAME,
99
.conf = loopback_configure,

backends/loopback.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "midimonster.h"
22

3-
int init();
3+
MM_PLUGIN_API int init();
44
static int loopback_configure(char* option, char* value);
55
static int loopback_configure_instance(instance* inst, char* option, char* value);
66
static instance* loopback_instance();

backends/lua.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ static int timer_fd = -1;
1919
static uint64_t last_timestamp;
2020
#endif
2121

22-
int init(){
22+
MM_PLUGIN_API int init(){
2323
backend lua = {
2424
#ifndef MMBACKEND_LUA_TIMERFD
2525
.interval = lua_interval,

backends/lua.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#define MMBACKEND_LUA_TIMERFD
1010
#endif
1111

12-
int init();
12+
MM_PLUGIN_API int init();
1313
static int lua_configure(char* option, char* value);
1414
static int lua_configure_instance(instance* inst, char* option, char* value);
1515
static instance* lua_instance();

backends/maweb.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ static maweb_command_key cmdline_keys[] = {
7272
{"GO_MINUS_SMALL", 50}, {"PAUSE_SMALL", 51}, {"GO_PLUS_SMALL", 52}
7373
};
7474

75-
int init(){
75+
MM_PLUGIN_API int init(){
7676
backend maweb = {
7777
.name = BACKEND_NAME,
7878
.conf = maweb_configure,

backends/maweb.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "midimonster.h"
22

3-
int init();
3+
MM_PLUGIN_API int init();
44
static int maweb_configure(char* option, char* value);
55
static int maweb_configure_instance(instance* inst, char* option, char* value);
66
static instance* maweb_instance();

backends/midi.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ static struct {
2323
.detect = 0
2424
};
2525

26-
int init(){
26+
MM_PLUGIN_API int init(){
2727
backend midi = {
2828
.name = BACKEND_NAME,
2929
.conf = midi_configure,

backends/midi.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "midimonster.h"
22

3-
int init();
3+
MM_PLUGIN_API int init();
44
static int midi_configure(char* option, char* value);
55
static int midi_configure_instance(instance* instance, char* option, char* value);
66
static instance* midi_instance();

backends/ola.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
static ola::io::SelectServer* ola_select = NULL;
1212
static ola::OlaCallbackClient* ola_client = NULL;
1313

14-
int init(){
14+
MM_PLUGIN_API int init(){
1515
backend ola = {
1616
.name = BACKEND_NAME,
1717
.conf = ola_configure,

backends/ola.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ extern "C" {
44
#undef min
55
#undef max
66

7-
int init();
7+
MM_PLUGIN_API int init();
88
static int ola_configure(char* option, char* value);
99
static int ola_configure_instance(instance* instance, char* option, char* value);
1010
static instance* ola_instance();

backends/osc.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ static struct {
1919
.detect = 0
2020
};
2121

22-
int init(){
22+
MM_PLUGIN_API int init(){
2323
backend osc = {
2424
.name = BACKEND_NAME,
2525
.conf = osc_configure,

backends/osc.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#define OSC_RECV_BUF 8192
88
#define OSC_XMIT_BUF 8192
99

10-
int init();
10+
MM_PLUGIN_API int init();
1111
static int osc_configure(char* option, char* value);
1212
static int osc_configure_instance(instance* inst, char* option, char* value);
1313
static instance* osc_instance();

backends/sacn.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ static struct /*_sacn_global_config*/ {
3131
.last_announce = 0
3232
};
3333

34-
int init(){
34+
MM_PLUGIN_API int init(){
3535
backend sacn = {
3636
.name = BACKEND_NAME,
3737
.conf = sacn_configure,

backends/sacn.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "midimonster.h"
22

3-
int init();
3+
MM_PLUGIN_API int init();
44
static int sacn_configure(char* option, char* value);
55
static int sacn_configure_instance(instance* instance, char* option, char* value);
66
static instance* sacn_instance();

backends/winmidi.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ static struct {
2323

2424
//TODO receive feedback socket until EAGAIN
2525

26-
int init(){
26+
MM_PLUGIN_API int init(){
2727
backend winmidi = {
2828
.name = BACKEND_NAME,
2929
.conf = winmidi_configure,

backends/winmidi.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "midimonster.h"
22

3-
int init();
3+
MM_PLUGIN_API int init();
44
static int winmidi_configure(char* option, char* value);
55
static int winmidi_configure_instance(instance* inst, char* option, char* value);
66
static instance* winmidi_instance();

midimonster.h

+10
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include <stdint.h>
66
#include <inttypes.h>
77

8+
/* API call attributes and visibilities */
89
#ifndef MM_API
910
#ifdef _WIN32
1011
#define MM_API __attribute__((dllimport))
@@ -13,6 +14,15 @@
1314
#endif
1415
#endif
1516

17+
/* Some build systems may apply the -fvisibility=hidden parameter from the core build to the backends, so mark the init function visible */
18+
#ifndef MM_PLUGIN_API
19+
#ifdef _WIN32
20+
#define MM_PLUGIN_API __attribute__((dllexport))
21+
#else
22+
#define MM_PLUGIN_API __attribute__((visibility ("default")))
23+
#endif
24+
#endif
25+
1626
/* Straight-forward min / max macros */
1727
#define max(a,b) (((a) > (b)) ? (a) : (b))
1828
#define min(a,b) (((a) < (b)) ? (a) : (b))

0 commit comments

Comments
 (0)