Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ plugin_sources = files(
)

libs = []
api_args = []
p2p_args = []

if host_machine.cpu_family().startswith('x86')
Expand Down Expand Up @@ -68,9 +69,16 @@ if meson.get_compiler('cpp').get_linker_id() in ['ld.bfd', 'ld.gold', 'ld.mold']
link_args += ['-Wl,-Bsymbolic']
endif

if get_option('default_library') == 'static'
api_args += ['-DBSSHARED_API_STATIC']
else
api_args += ['-DBSSHARED_API_BUILDING']
endif

libbestsource = library('libbestsource', api_sources,
dependencies: deps,
install: true,
cpp_args: api_args,
link_args: link_args,
link_with: libs,
name_prefix: '',
Expand Down
24 changes: 22 additions & 2 deletions src/bsshared.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,33 @@
#include <functional>
#include <filesystem>

#if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(BSSHARED_API_STATIC)
# define BSSHARED_API_EXPORT __declspec(dllexport)
# define BSSHARED_API_IMPORT __declspec(dllimport)
#elif defined(__OS2__) && !defined(BSSHARED_API_STATIC)
# define BSSHARED_API_EXPORT __declspec(dllexport)
# define BSSHARED_API_IMPORT
#elif __GNUC__ >= 4
# define BSSHARED_API_EXPORT __attribute__((visibility("default")))
# define BSSHARED_API_IMPORT __attribute__((visibility("default")))
#else
# define BSSHARED_API_EXPORT
# define BSSHARED_API_IMPORT
#endif

#ifdef BSSHARED_API_BUILDING
# define BSSHARED_API BSSHARED_API_EXPORT
#else
# define BSSHARED_API BSSHARED_API_IMPORT
#endif

constexpr size_t HashSize = 8;

class BestSourceException : public std::runtime_error {
class BSSHARED_API BestSourceException : public std::runtime_error {
using std::runtime_error::runtime_error;
};

class BestSourceHWDecoderException : public BestSourceException {
class BSSHARED_API BestSourceHWDecoderException : public BestSourceException {
using BestSourceException::BestSourceException;
};

Expand Down
Loading