From 238f53d7028cc0ff8a5798d18871ea82271d981d Mon Sep 17 00:00:00 2001 From: Frediano Ziglio Date: Sat, 18 May 2019 20:19:50 +0100 Subject: [PATCH] Declare public exported functions as C Allows to link externally from a C program. This will allow C++ code to respect C ABI. Signed-off-by: Frediano Ziglio --- server/spice-audio.h | 4 ++++ server/spice-char.h | 4 ++++ server/spice-input.h | 4 ++++ server/spice-migration.h | 4 ++++ server/spice-qxl.h | 4 ++++ server/spice-replay.h | 4 ++++ server/spice-server.h | 4 ++++ 7 files changed, 28 insertions(+) diff --git a/server/spice-audio.h b/server/spice-audio.h index 3de4a8d0..9da59b15 100644 --- a/server/spice-audio.h +++ b/server/spice-audio.h @@ -24,6 +24,8 @@ #include "spice-core.h" +SPICE_BEGIN_DECLS + /* sound interfaces */ #define SPICE_INTERFACE_PLAYBACK "playback" @@ -93,4 +95,6 @@ void spice_server_set_playback_rate(SpicePlaybackInstance *sin, uint32_t fre uint32_t spice_server_get_best_record_rate(SpiceRecordInstance *sin); void spice_server_set_record_rate(SpiceRecordInstance *sin, uint32_t frequency); +SPICE_END_DECLS + #endif /* SPICE_AUDIO_H_ */ diff --git a/server/spice-char.h b/server/spice-char.h index a3b9d26b..18117f0c 100644 --- a/server/spice-char.h +++ b/server/spice-char.h @@ -24,6 +24,8 @@ #include "spice-core.h" +SPICE_BEGIN_DECLS + /* char device interfaces */ #define SPICE_INTERFACE_CHAR_DEVICE "char_device" @@ -85,4 +87,6 @@ void spice_server_port_event(SpiceCharDeviceInstance *char_device, uint8_t event /* TODO change return to const char *const * when API break */ const char** spice_server_char_device_recognized_subtypes(void); +SPICE_END_DECLS + #endif /* SPICE_CHAR_H_ */ diff --git a/server/spice-input.h b/server/spice-input.h index dc07c4fe..91e64e83 100644 --- a/server/spice-input.h +++ b/server/spice-input.h @@ -24,6 +24,8 @@ #include "spice-core.h" +SPICE_BEGIN_DECLS + /* input interfaces */ #define SPICE_INTERFACE_KEYBOARD "keyboard" @@ -88,4 +90,6 @@ struct SpiceTabletInstance { SpiceTabletState *st; }; +SPICE_END_DECLS + #endif /* SPICE_INPUT_H_ */ diff --git a/server/spice-migration.h b/server/spice-migration.h index 58b1cbb8..e8dd496c 100644 --- a/server/spice-migration.h +++ b/server/spice-migration.h @@ -24,6 +24,8 @@ #include "spice-core.h" +SPICE_BEGIN_DECLS + /* migration interface */ #define SPICE_INTERFACE_MIGRATION "migration" #define SPICE_INTERFACE_MIGRATION_MAJOR 1 @@ -58,4 +60,6 @@ int spice_server_migrate_end(SpiceServer *s, int completed); void spice_server_set_seamless_migration(SpiceServer *s, int enable); +SPICE_END_DECLS + #endif /* SPICE_MIGRATION_H_ */ diff --git a/server/spice-qxl.h b/server/spice-qxl.h index bc02e2ee..13f93516 100644 --- a/server/spice-qxl.h +++ b/server/spice-qxl.h @@ -24,6 +24,8 @@ #include "spice-core.h" +SPICE_BEGIN_DECLS + #ifndef SPICE_CAPABILITIES_SIZE #define SPICE_CAPABILITIES_SIZE (sizeof(((QXLRom*)0)->client_capabilities)) #endif @@ -232,4 +234,6 @@ struct QXLInstance { QXLState *st; }; +SPICE_END_DECLS + #endif /* SPICE_QXL_H_ */ diff --git a/server/spice-replay.h b/server/spice-replay.h index 167a1563..9540df75 100644 --- a/server/spice-replay.h +++ b/server/spice-replay.h @@ -26,6 +26,8 @@ #include #include "spice-core.h" +SPICE_BEGIN_DECLS + typedef struct SpiceReplay SpiceReplay; /* reads until encountering a cmd, processing any recorded messages (io) on the @@ -35,4 +37,6 @@ void spice_replay_free_cmd(SpiceReplay *replay, QXLCommandExt *cmd); void spice_replay_free(SpiceReplay *replay); SpiceReplay * spice_replay_new(FILE *file, int nsurfaces); +SPICE_END_DECLS + #endif /* SPICE_REPLAY_H_ */ diff --git a/server/spice-server.h b/server/spice-server.h index c6c8646a..f10ffeb9 100644 --- a/server/spice-server.h +++ b/server/spice-server.h @@ -24,6 +24,8 @@ #include "spice-core.h" +SPICE_BEGIN_DECLS + /* Don't use features incompatible with a specific spice version, so that migration to/from that version works. */ typedef enum { @@ -170,4 +172,6 @@ void spice_server_vm_stop(SpiceServer *s); int spice_server_get_num_clients(SpiceServer *s) SPICE_GNUC_DEPRECATED; +SPICE_END_DECLS + #endif /* SPICE_SERVER_H_ */