From 14027781cc45abfe27715b78ac520ace7d178d6a Mon Sep 17 00:00:00 2001 From: Andy Green Date: Fri, 13 Mar 2020 07:25:33 +0000 Subject: [PATCH] lws_struct: conditional prototypes make trouble with visibility Although the code is correct and the symbols should be defined, making some prototypes conditional on cmake defines breaks their visibility when the library is built. They're conditional here to get around use of sqlite3 type in the prototypes where we may not be including sqlite3 headers. Replace the conditional with a grauitous typedef as a forward ref, since it's only referred to via pointer types. --- include/libwebsockets/lws-struct.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/libwebsockets/lws-struct.h b/include/libwebsockets/lws-struct.h index 4468fdfc6..3091feae7 100644 --- a/include/libwebsockets/lws-struct.h +++ b/include/libwebsockets/lws-struct.h @@ -242,7 +242,7 @@ LWS_VISIBLE LWS_EXTERN lws_struct_json_serialize_result_t lws_struct_json_serialize(lws_struct_serialize_t *js, uint8_t *buf, size_t len, size_t *written); -#if defined(LWS_WITH_STRUCT_SQLITE3) +typedef struct sqlite3 sqlite3; LWS_VISIBLE LWS_EXTERN int lws_struct_sq3_serialize(sqlite3 *pdb, const lws_struct_map_t *schema, @@ -263,4 +263,3 @@ lws_struct_sq3_open(struct lws_context *context, const char *sqlite3_path, LWS_VISIBLE LWS_EXTERN int lws_struct_sq3_close(sqlite3 **pdb); -#endif