diff --git a/lib/searpc-client.h b/lib/searpc-client.h index aa293e6..725fadd 100644 --- a/lib/searpc-client.h +++ b/lib/searpc-client.h @@ -1,16 +1,20 @@ #ifndef SEARPC_CLIENT_H #define SEARPC_CLIENT_H +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + #ifdef LIBSEARPC_EXPORTS #define LIBSEARPC_API __declspec(dllexport) #else #define LIBSEARPC_API #endif -#include -#include -#include - #ifndef DFT_DOMAIN #define DFT_DOMAIN g_quark_from_string(G_LOG_DOMAIN) #endif @@ -137,5 +141,9 @@ searpc_client_generic_callback (char *retstr, size_t len, #define TRANSPORT_ERROR "Transport Error" #define TRANSPORT_ERROR_CODE 500 +#ifdef __cplusplus +} +#endif + #endif diff --git a/lib/searpc-named-pipe-transport.h b/lib/searpc-named-pipe-transport.h index bac5566..0ddbdc4 100644 --- a/lib/searpc-named-pipe-transport.h +++ b/lib/searpc-named-pipe-transport.h @@ -1,12 +1,6 @@ #ifndef SEARPC_NAMED_PIPE_TRANSPORT_H #define SEARPC_NAMED_PIPE_TRANSPORT_H -#ifdef LIBSEARPC_EXPORTS -#define LIBSEARPC_API __declspec(dllexport) -#else -#define LIBSEARPC_API -#endif - #include #include #include @@ -16,6 +10,16 @@ #include #endif +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef LIBSEARPC_EXPORTS +#define LIBSEARPC_API __declspec(dllexport) +#else +#define LIBSEARPC_API +#endif + // Implementatin of a searpc transport based on named pipe. It uses unix domain // sockets on linux/osx, and named pipes on windows. // @@ -72,4 +76,8 @@ int searpc_named_pipe_client_connect(SearpcNamedPipeClient *client); LIBSEARPC_API void searpc_free_client_with_pipe_transport (SearpcClient *client); +#ifdef __cplusplus +} +#endif + #endif // SEARPC_NAMED_PIPE_TRANSPORT_H diff --git a/lib/searpc-server.h b/lib/searpc-server.h index 6c7e301..79cccf1 100644 --- a/lib/searpc-server.h +++ b/lib/searpc-server.h @@ -1,16 +1,20 @@ #ifndef SEARPC_SERVER_H #define SEARPC_SERVER_H +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + #ifdef LIBSEARPC_EXPORTS #define LIBSEARPC_API __declspec(dllexport) #else #define LIBSEARPC_API #endif -#include -#include -#include - #ifndef DFT_DOMAIN #define DFT_DOMAIN g_quark_from_string(G_LOG_DOMAIN) #endif @@ -134,4 +138,8 @@ gchar *searpc_server_call_function (const char *service, LIBSEARPC_API char* searpc_compute_signature (const gchar *ret_type, int pnum, ...); +#ifdef __cplusplus +} +#endif + #endif