diff --git a/src/backend/backend.c b/src/backend/backend.c index 36840986..059b6974 100644 --- a/src/backend/backend.c +++ b/src/backend/backend.c @@ -21,9 +21,10 @@ static struct backend_info { bool can_present; } *backend_registry = NULL; -bool backend_register(uint64_t major, uint64_t minor, const char *name, - struct backend_base *(*init)(session_t *ps, xcb_window_t target), - bool can_present) { +bool PICOM_PUBLIC_API backend_register(uint64_t major, uint64_t minor, const char *name, + struct backend_base *(*init)(session_t *ps, + xcb_window_t target), + bool can_present) { if (major != PICOM_BACKEND_MAJOR) { log_error("Backend %s has incompatible major version %" PRIu64 ", expected %lu", diff --git a/src/backend/backend.h b/src/backend/backend.h index ff882d0f..307a9c85 100644 --- a/src/backend/backend.h +++ b/src/backend/backend.h @@ -463,9 +463,10 @@ bool backend_execute(struct backend_base *backend, image_handle target, unsigned /// `name` is the name of the backend, `init` is the function to initialize the backend, /// `can_present` should be true if the backend can present the back buffer to the screen, /// false otherwise (e.g. if the backend does off screen rendering, etc.) -bool backend_register(uint64_t major, uint64_t minor, const char *name, - struct backend_base *(*init)(session_t *ps, xcb_window_t target), - bool can_present); +bool PICOM_PUBLIC_API backend_register(uint64_t major, uint64_t minor, const char *name, + struct backend_base *(*init)(session_t *ps, + xcb_window_t target), + bool can_present); struct backend_info *backend_find(const char *name); struct backend_base * backend_init(struct backend_info *info, session_t *ps, xcb_window_t target); diff --git a/src/compiler.h b/src/compiler.h index 54ed1ea6..03674be8 100644 --- a/src/compiler.h +++ b/src/compiler.h @@ -126,6 +126,8 @@ #else # define thread_local _Pragma("GCC error \"No thread local storage support\"") __error__ #endif + +#define PICOM_PUBLIC_API __attribute__((visibility("default"))) // clang-format on typedef unsigned long ulong; diff --git a/src/meson.build b/src/meson.build index 52baf220..7904c31b 100644 --- a/src/meson.build +++ b/src/meson.build @@ -86,7 +86,8 @@ subdir('backend') picom = executable('picom', srcs, c_args: cflags, dependencies: [ base_deps, deps, test_h_dep ], - install: true, include_directories: picom_inc) + install: true, include_directories: picom_inc, + export_dynamic: true, gnu_symbol_visibility: 'hidden') if get_option('unittest') test('picom unittest', picom, args: [ '--unittest' ])