libseat: Use symbol file instead of -fvisibility
This commit is contained in:
parent
b2cbe576d1
commit
3e301b8e70
4 changed files with 19 additions and 12 deletions
|
@ -3,10 +3,8 @@
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
#define ATTRIB_PRINTF(start, end) __attribute__((format(printf, start, end)))
|
#define ATTRIB_PRINTF(start, end) __attribute__((format(printf, start, end)))
|
||||||
#define LIBSEAT_EXPORT __attribute__((visibility("default")))
|
|
||||||
#else
|
#else
|
||||||
#define ATTRIB_PRINTF(start, end)
|
#define ATTRIB_PRINTF(start, end)
|
||||||
#define LIBSEAT_EXPORT
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define STRLEN(s) ((sizeof(s) / sizeof(s[0])) - 1)
|
#define STRLEN(s) ((sizeof(s) / sizeof(s[0])) - 1)
|
||||||
|
|
|
@ -32,7 +32,7 @@ static const struct named_backend impls[] = {
|
||||||
#error At least one backend must be enabled
|
#error At least one backend must be enabled
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
LIBSEAT_EXPORT struct libseat *libseat_open_seat(struct libseat_seat_listener *listener, void *data) {
|
struct libseat *libseat_open_seat(struct libseat_seat_listener *listener, void *data) {
|
||||||
if (listener == NULL) {
|
if (listener == NULL) {
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -70,42 +70,42 @@ LIBSEAT_EXPORT struct libseat *libseat_open_seat(struct libseat_seat_listener *l
|
||||||
return backend;
|
return backend;
|
||||||
}
|
}
|
||||||
|
|
||||||
LIBSEAT_EXPORT int libseat_disable_seat(struct libseat *seat) {
|
int libseat_disable_seat(struct libseat *seat) {
|
||||||
assert(seat && seat->impl);
|
assert(seat && seat->impl);
|
||||||
return seat->impl->disable_seat(seat);
|
return seat->impl->disable_seat(seat);
|
||||||
}
|
}
|
||||||
|
|
||||||
LIBSEAT_EXPORT int libseat_close_seat(struct libseat *seat) {
|
int libseat_close_seat(struct libseat *seat) {
|
||||||
assert(seat && seat->impl);
|
assert(seat && seat->impl);
|
||||||
return seat->impl->close_seat(seat);
|
return seat->impl->close_seat(seat);
|
||||||
}
|
}
|
||||||
|
|
||||||
LIBSEAT_EXPORT const char *libseat_seat_name(struct libseat *seat) {
|
const char *libseat_seat_name(struct libseat *seat) {
|
||||||
assert(seat && seat->impl);
|
assert(seat && seat->impl);
|
||||||
return seat->impl->seat_name(seat);
|
return seat->impl->seat_name(seat);
|
||||||
}
|
}
|
||||||
|
|
||||||
LIBSEAT_EXPORT int libseat_open_device(struct libseat *seat, const char *path, int *fd) {
|
int libseat_open_device(struct libseat *seat, const char *path, int *fd) {
|
||||||
assert(seat && seat->impl);
|
assert(seat && seat->impl);
|
||||||
return seat->impl->open_device(seat, path, fd);
|
return seat->impl->open_device(seat, path, fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
LIBSEAT_EXPORT int libseat_close_device(struct libseat *seat, int device_id) {
|
int libseat_close_device(struct libseat *seat, int device_id) {
|
||||||
assert(seat && seat->impl);
|
assert(seat && seat->impl);
|
||||||
return seat->impl->close_device(seat, device_id);
|
return seat->impl->close_device(seat, device_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
LIBSEAT_EXPORT int libseat_get_fd(struct libseat *seat) {
|
int libseat_get_fd(struct libseat *seat) {
|
||||||
assert(seat && seat->impl);
|
assert(seat && seat->impl);
|
||||||
return seat->impl->get_fd(seat);
|
return seat->impl->get_fd(seat);
|
||||||
}
|
}
|
||||||
|
|
||||||
LIBSEAT_EXPORT int libseat_dispatch(struct libseat *seat, int timeout) {
|
int libseat_dispatch(struct libseat *seat, int timeout) {
|
||||||
assert(seat && seat->impl);
|
assert(seat && seat->impl);
|
||||||
return seat->impl->dispatch(seat, timeout);
|
return seat->impl->dispatch(seat, timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
LIBSEAT_EXPORT int libseat_switch_session(struct libseat *seat, int session) {
|
int libseat_switch_session(struct libseat *seat, int session) {
|
||||||
assert(seat && seat->impl);
|
assert(seat && seat->impl);
|
||||||
return seat->impl->switch_session(seat, session);
|
return seat->impl->switch_session(seat, session);
|
||||||
}
|
}
|
||||||
|
|
6
libseat/libseat.syms
Normal file
6
libseat/libseat.syms
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
global:
|
||||||
|
libseat_*;
|
||||||
|
local:
|
||||||
|
*;
|
||||||
|
};
|
|
@ -25,7 +25,6 @@ add_project_arguments(
|
||||||
'-Wno-unused-command-line-argument',
|
'-Wno-unused-command-line-argument',
|
||||||
'-Wvla',
|
'-Wvla',
|
||||||
'-Wl,--exclude-libs=ALL',
|
'-Wl,--exclude-libs=ALL',
|
||||||
'-fvisibility=hidden',
|
|
||||||
'-D_XOPEN_SOURCE=700',
|
'-D_XOPEN_SOURCE=700',
|
||||||
'-D__BSD_VISIBLE',
|
'-D__BSD_VISIBLE',
|
||||||
],
|
],
|
||||||
|
@ -128,12 +127,16 @@ private_lib = static_library(
|
||||||
include_directories: [include_directories('.', 'include')],
|
include_directories: [include_directories('.', 'include')],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
symbols_file = 'libseat/libseat.syms'
|
||||||
|
symbols_flag = '-Wl,--version-script,@0@/@1@'.format(meson.current_source_dir(), symbols_file)
|
||||||
lib = library(
|
lib = library(
|
||||||
'seat', # This results in the library being called 'libseat'
|
'seat', # This results in the library being called 'libseat'
|
||||||
[ 'libseat/libseat.c' ],
|
[ 'libseat/libseat.c' ],
|
||||||
link_with: private_lib,
|
link_with: private_lib,
|
||||||
include_directories: [include_directories('.', 'include')],
|
include_directories: [include_directories('.', 'include')],
|
||||||
install: true,
|
install: true,
|
||||||
|
link_args: symbols_flag,
|
||||||
|
link_depends: symbols_file,
|
||||||
)
|
)
|
||||||
|
|
||||||
install_headers('include/libseat.h')
|
install_headers('include/libseat.h')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue