Skip to content

Commit 114b116

Browse files
authored
Merge pull request #131 from OpenBCI/export_symbols
dont export symbols on unix
2 parents 5fc54ba + 81379de commit 114b116

File tree

4 files changed

+23
-17
lines changed

4 files changed

+23
-17
lines changed

CMakeLists.txt

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ set (CMAKE_CXX_STANDARD 11)
55
set (CMAKE_VERBOSE_MAKEFILE ON)
66
set (BRAINFLOW_VERSION 2.1.0)
77

8+
# dont export sumbols on unix by default
9+
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
10+
set(CMAKE_C_VISIBILITY_PRESET hidden)
11+
812
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
913

1014
macro (configure_msvc_runtime)

src/board_controller/inc/board_controller.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#define SHARED_EXPORT __declspec(dllexport)
88
#define CALLING_CONVENTION __cdecl
99
#else
10-
#define SHARED_EXPORT
10+
#define SHARED_EXPORT __attribute__((visibility("default")))
1111
#define CALLING_CONVENTION
1212
#endif
1313

src/board_controller/inc/board_info_getter.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#define SHARED_EXPORT __declspec(dllexport)
55
#define CALLING_CONVENTION __cdecl
66
#else
7-
#define SHARED_EXPORT
7+
#define SHARED_EXPORT __attribute__((visibility("default")))
88
#define CALLING_CONVENTION
99
#endif
1010

src/data_handler/inc/data_handler.h

+17-15
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
#ifdef _WIN32
44
#define SHARED_EXPORT __declspec(dllexport)
5+
#define CALLING_CONVENTION __cdecl
56
#else
6-
#define SHARED_EXPORT
7+
#define SHARED_EXPORT __attribute__((visibility("default")))
8+
#define CALLING_CONVENTION
79
#endif
810

911
#include "brainflow_constants.h"
@@ -33,40 +35,40 @@ extern "C"
3335
#endif
3436
// signal processing methods
3537
// ripple param is used only for chebyshev filter
36-
SHARED_EXPORT int perform_lowpass (double *data, int data_len, int sampling_rate, double cutoff,
38+
SHARED_EXPORT int CALLING_CONVENTION perform_lowpass (double *data, int data_len, int sampling_rate, double cutoff,
3739
int order, int filter_type, double ripple);
38-
SHARED_EXPORT int perform_highpass (double *data, int data_len, int sampling_rate,
40+
SHARED_EXPORT int CALLING_CONVENTION perform_highpass (double *data, int data_len, int sampling_rate,
3941
double cutoff, int order, int filter_type, double ripple);
40-
SHARED_EXPORT int perform_bandpass (double *data, int data_len, int sampling_rate,
42+
SHARED_EXPORT int CALLING_CONVENTION perform_bandpass (double *data, int data_len, int sampling_rate,
4143
double center_freq, double band_width, int order, int filter_type, double ripple);
42-
SHARED_EXPORT int perform_bandstop (double *data, int data_len, int sampling_rate,
44+
SHARED_EXPORT int CALLING_CONVENTION perform_bandstop (double *data, int data_len, int sampling_rate,
4345
double center_freq, double band_width, int order, int filter_type, double ripple);
4446

45-
SHARED_EXPORT int perform_rolling_filter (
47+
SHARED_EXPORT int CALLING_CONVENTION perform_rolling_filter (
4648
double *data, int data_len, int period, int agg_operation);
4749

48-
SHARED_EXPORT int perform_downsampling (
50+
SHARED_EXPORT int CALLING_CONVENTION perform_downsampling (
4951
double *data, int data_len, int period, int agg_operation, double *output_data);
5052

51-
SHARED_EXPORT int perform_wavelet_transform (double *data, int data_len, char *wavelet,
53+
SHARED_EXPORT int CALLING_CONVENTION perform_wavelet_transform (double *data, int data_len, char *wavelet,
5254
int decomposition_level, double *output_data, int *decomposition_lengths);
53-
SHARED_EXPORT int perform_inverse_wavelet_transform (double *wavelet_coeffs,
55+
SHARED_EXPORT int CALLING_CONVENTION perform_inverse_wavelet_transform (double *wavelet_coeffs,
5456
int original_data_len, char *wavelet, int decomposition_level, int *decomposition_lengths,
5557
double *output_data);
56-
SHARED_EXPORT int perform_wavelet_denoising (
58+
SHARED_EXPORT int CALLING_CONVENTION perform_wavelet_denoising (
5759
double *data, int data_len, char *wavelet, int decomposition_level);
58-
SHARED_EXPORT int perform_fft (
60+
SHARED_EXPORT int CALLING_CONVENTION perform_fft (
5961
double *data, int data_len, double *output_re, double *output_im);
60-
SHARED_EXPORT int perform_ifft (
62+
SHARED_EXPORT int CALLING_CONVENTION perform_ifft (
6163
double *input_re, double *input_im, int data_len, double *restored_data);
6264

6365

6466
// file operations
65-
SHARED_EXPORT int write_file (
67+
SHARED_EXPORT int CALLING_CONVENTION write_file (
6668
double *data, int num_rows, int num_cols, char *file_name, char *file_mode);
67-
SHARED_EXPORT int read_file (
69+
SHARED_EXPORT int CALLING_CONVENTION read_file (
6870
double *data, int *num_rows, int *num_cols, char *file_name, int num_elements);
69-
SHARED_EXPORT int get_num_elements_in_file (
71+
SHARED_EXPORT int CALLING_CONVENTION get_num_elements_in_file (
7072
char *file_name, int *num_elements); // its an internal method for bindings its not
7173
// available via high level api
7274
#ifdef __cplusplus

0 commit comments

Comments
 (0)