From 7fe02715aac68b958250b43f9d48d641af0a045c Mon Sep 17 00:00:00 2001 From: Onur Gündüz Date: Wed, 10 Jun 2026 15:49:59 +0200 Subject: build: export only the public API from the shared library --- embed_server.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'embed_server.h') diff --git a/embed_server.h b/embed_server.h index c38f0ca..179ed0b 100644 --- a/embed_server.h +++ b/embed_server.h @@ -1,6 +1,17 @@ #ifndef PPLX_SERVER_H #define PPLX_SERVER_H +/* Public-API export annotation. The libraries are built with + * -fvisibility=hidden, so only declarations carrying PPLX_API are exported + * from the shared library; everything else stays internal. */ +#ifndef PPLX_API +#if defined(__GNUC__) +#define PPLX_API __attribute__((visibility("default"))) +#else +#define PPLX_API +#endif +#endif + #include typedef struct { @@ -27,6 +38,6 @@ typedef struct { const char *api_key; } pplx_server_config_t; -int pplx_run_server(const pplx_server_config_t *cfg); +PPLX_API int pplx_run_server(const pplx_server_config_t *cfg); #endif -- cgit v1.3.1