diff options
| author | Stephen Sinclair <radarsat1@gmail.com> | 2018-08-08 14:15:00 -0400 |
|---|---|---|
| committer | Stephen Sinclair <radarsat1@gmail.com> | 2018-08-08 19:16:38 -0400 |
| commit | 5f0720fef77af2b19abd684d0dc9eed1bca9a64d (patch) | |
| tree | fdfc83dca3d5841eaf1a669276981c8339b10b88 | |
| parent | bc469fab7b18df4253db52f17726697ae5c9c564 (diff) | |
Export C API symbols when compiled with g++
| -rw-r--r-- | Makefile.am | 1 | ||||
| -rw-r--r-- | rtaudio_c.h | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am index f83007c..2a05035 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,6 +6,7 @@ endif AM_CXXFLAGS = @visibility@ lib_LTLIBRARIES = %D%/librtaudio.la +%C%_librtaudio_la_CXXFLAGS = -DRTAUDIO_EXPORT %C%_librtaudio_la_LDFLAGS = -no-undefined -export-dynamic -version-info @SO_VERSION@ %C%_librtaudio_la_SOURCES = \ %D%/RtAudio.cpp \ diff --git a/rtaudio_c.h b/rtaudio_c.h index 893917c..a13ea79 100644 --- a/rtaudio_c.h +++ b/rtaudio_c.h @@ -2,8 +2,12 @@ #define RTAUDIO_C_H #if defined(RTAUDIO_EXPORT) +#ifdef WIN32 #define RTAUDIOAPI __declspec(dllexport) #else +#define RTAUDIOAPI __attribute__((visibility("default"))) +#endif +#else #define RTAUDIOAPI //__declspec(dllimport) #endif |
