From 5ee014afe30be26b59097ac06209aceb6d320039 Mon Sep 17 00:00:00 2001 From: Stas Date: Fri, 24 Apr 2026 11:20:35 +0300 Subject: [PATCH] add LIBSEARPC_ASYNC_API_WORKS define Commit ed7b992db fixed async API, but now the application needs a check that the API is usable. Add LIBSEARPC_ASYNC_API_WORKS define. --- lib/searpc-client.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/searpc-client.h b/lib/searpc-client.h index 157a407..9ca734b 100644 --- a/lib/searpc-client.h +++ b/lib/searpc-client.h @@ -19,6 +19,8 @@ extern "C" { #define DFT_DOMAIN g_quark_from_string(G_LOG_DOMAIN) #endif +#define LIBSEARPC_ASYNC_API_WORKS 1 + typedef char *(*TransportCB)(void *arg, const gchar *fcall_str, size_t fcall_len, size_t *ret_len); @@ -36,7 +38,7 @@ typedef void (*AsyncCallback) (void *result, void *user_data, GError *error); struct _SearpcClient { TransportCB send; void *arg; - + AsyncTransportSend async_send; void *async_arg; }; @@ -88,7 +90,7 @@ searpc_client_transport_send (SearpcClient *client, size_t fcall_len, size_t *ret_len); - +#if LIBSEARPC_ASYNC_API_WORKS LIBSEARPC_API int searpc_client_async_call__int (SearpcClient *client, @@ -128,6 +130,7 @@ searpc_client_async_call__json (SearpcClient *client, AsyncCallback callback, void *cbdata, int n_params, ...); +#endif /* called by the transport layer, the rpc layer should be able to * modify the str, but not take ownership of it */