1
0
mirror of https://github.com/haiwen/libsearpc.git synced 2025-09-01 21:07:24 +00:00

Wrap public declarations with G_BEGIN_DECLS/G_END_DECLS

Glib release 2.67.3 started conditionally using some C++ code[1] in the
public headers and it's no longer legal to include "glib.h" or anything
that includes it transitively from `extern "C"` block.

The solution recommended by the glib developers is to enclose all
declarations in a header within G_BEGIN_DECLS and G_END_DECLS as shown
in gobject developer manual[2].

[1] https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1715
[2] https://developer.gnome.org/gobject/stable/howto-gobject.html#howto-gobject-header
This commit is contained in:
Aleksei Bavshin
2021-02-12 08:58:26 +00:00
parent e889dbcb50
commit 36d75a8efe
4 changed files with 15 additions and 0 deletions

View File

@@ -15,6 +15,8 @@
#define DFT_DOMAIN g_quark_from_string(G_LOG_DOMAIN)
#endif
G_BEGIN_DECLS
typedef gchar* (*SearpcMarshalFunc) (void *func, json_t *param_array,
gsize *ret_len);
typedef void (*RegisterMarshalFunc) (void);
@@ -134,4 +136,6 @@ gchar *searpc_server_call_function (const char *service,
LIBSEARPC_API
char* searpc_compute_signature (const gchar *ret_type, int pnum, ...);
G_END_DECLS
#endif