symbol visibility

main
pantonshire 4 weeks ago
parent 6b80a026cf
commit ed6d2d1cd5

@ -0,0 +1,7 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
#pragma once
#define EXPORT __attribute__((visibility("default")))

@ -56,6 +56,7 @@ tlsl_lib = shared_library(
sources, sources,
include_directories: includes, include_directories: includes,
c_args: args, c_args: args,
gnu_symbol_visibility: 'hidden',
) )
tlsl_dep = declare_dependency( tlsl_dep = declare_dependency(

@ -4,9 +4,10 @@
#include <stdlib.h> #include <stdlib.h>
#include "export.h"
#include "public/array_list.h" #include "public/array_list.h"
int array_list_raw_alloc(struct array_list *al, size_t cap, size_t elem_size) { EXPORT int array_list_raw_alloc(struct array_list *al, size_t cap, size_t elem_size) {
void *buf; void *buf;
if (!(buf = realloc(al->buf, cap * elem_size))) if (!(buf = realloc(al->buf, cap * elem_size)))
@ -16,7 +17,7 @@ int array_list_raw_alloc(struct array_list *al, size_t cap, size_t elem_size) {
return 0; return 0;
} }
void array_list_raw_cleanup(struct array_list *al) { EXPORT void array_list_raw_cleanup(struct array_list *al) {
if (al->buf && al->cap) { if (al->buf && al->cap) {
free(al->buf); free(al->buf);
al->buf = NULL; al->buf = NULL;

@ -2,11 +2,12 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/. // file, You can obtain one at https://mozilla.org/MPL/2.0/.
#include "export.h"
#include "eventloop_platform.h" #include "eventloop_platform.h"
#include "public/container_of.h" #include "public/container_of.h"
#include "public/list.h" #include "public/list.h"
int tlsl_eventloop_init(struct tlsl_eventloop *el) { EXPORT int tlsl_eventloop_init(struct tlsl_eventloop *el) {
int platform_res; int platform_res;
intrusive_list_init_empty(&el->event_list); intrusive_list_init_empty(&el->event_list);
@ -18,7 +19,7 @@ int tlsl_eventloop_init(struct tlsl_eventloop *el) {
return 0; return 0;
} }
void tlsl_eventloop_cleanup(struct tlsl_eventloop *el) { EXPORT void tlsl_eventloop_cleanup(struct tlsl_eventloop *el) {
struct intrusive_list *li; struct intrusive_list *li;
struct tlsl_event *e; struct tlsl_event *e;
@ -34,7 +35,7 @@ void tlsl_eventloop_cleanup(struct tlsl_eventloop *el) {
el->valid = false; el->valid = false;
} }
int tlsl_eventloop_wait( EXPORT int tlsl_eventloop_wait(
struct tlsl_eventloop *el, struct tlsl_eventloop *el,
tlsl_event_id_t *id_out, tlsl_event_id_t *id_out,
uint32_t *flags_out, uint32_t *flags_out,
@ -43,16 +44,16 @@ int tlsl_eventloop_wait(
return tlsl_platform_el_wait(el, id_out, flags_out, timeout_ms); return tlsl_platform_el_wait(el, id_out, flags_out, timeout_ms);
} }
int tlsl_eventloop_clear(struct tlsl_eventloop *el, struct tlsl_event *e) { EXPORT int tlsl_eventloop_clear(struct tlsl_eventloop *el, struct tlsl_event *e) {
return tlsl_platform_el_event_clear(el, e); return tlsl_platform_el_event_clear(el, e);
} }
void tlsl_eventloop_remove(struct tlsl_eventloop *el, struct tlsl_event *e) { EXPORT void tlsl_eventloop_remove(struct tlsl_eventloop *el, struct tlsl_event *e) {
tlsl_platform_el_event_remove(el, e); tlsl_platform_el_event_remove(el, e);
tlsl_platform_el_event_cleanup(el, e); tlsl_platform_el_event_cleanup(el, e);
} }
int tlsl_eventloop_add_timer( EXPORT int tlsl_eventloop_add_timer(
struct tlsl_eventloop *el, struct tlsl_eventloop *el,
struct tlsl_event *e, struct tlsl_event *e,
uint64_t millis, uint64_t millis,
@ -66,7 +67,7 @@ int tlsl_eventloop_add_timer(
return 0; return 0;
} }
int tlsl_eventloop_add_fd( EXPORT int tlsl_eventloop_add_fd(
struct tlsl_eventloop *el, struct tlsl_eventloop *el,
struct tlsl_event *e, struct tlsl_event *e,
int fd, int fd,

@ -5,9 +5,10 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "export.h"
#include "public/str.h" #include "public/str.h"
str_buf_t sbuf_from_sview(str_view_t s) { EXPORT str_buf_t sbuf_from_sview(str_view_t s) {
char *buf; char *buf;
if (sview_is_null(s) || sview_is_empty(s)) if (sview_is_null(s) || sview_is_empty(s))

Loading…
Cancel
Save