From 60888caadcdac6aabee3f52ee0a4404ccc4dca97 Mon Sep 17 00:00:00 2001 From: Robert Adam Date: Sun, 14 Nov 2021 17:51:41 +0100 Subject: FEAT(plugins): Add typedef for API type This typedef can be used by plugins that don't want to hard-code the type of the Mumble API type (which contains the API's version) into their source code. If this typedef is used, a newer API can be used simply by including a different API header. --- plugins/MumbleAPI_v_1_0_x.h | 2 ++ plugins/testPlugin/testPlugin.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/MumbleAPI_v_1_0_x.h b/plugins/MumbleAPI_v_1_0_x.h index cfc699c76..2cd80a807 100644 --- a/plugins/MumbleAPI_v_1_0_x.h +++ b/plugins/MumbleAPI_v_1_0_x.h @@ -527,4 +527,6 @@ struct MumbleAPI_v_1_0_x { mumble_error_t(PLUGIN_CALLING_CONVENTION *playSample)(mumble_plugin_id_t callerID, const char *samplePath); }; +typedef struct MumbleAPI_v_1_0_x mumble_api_t; + #endif // EXTERNAL_MUMBLE_PLUGIN_API_H_ diff --git a/plugins/testPlugin/testPlugin.cpp b/plugins/testPlugin/testPlugin.cpp index ebeab6b19..4ea6a41f2 100644 --- a/plugins/testPlugin/testPlugin.cpp +++ b/plugins/testPlugin/testPlugin.cpp @@ -34,7 +34,7 @@ std::ostream &operator<<(std::ostream &stream, const mumble_version_t version) { ////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////// -MumbleAPI_v_1_0_x mumAPI; +mumble_api_t mumAPI; mumble_connection_t activeConnection; mumble_plugin_id_t ownID; -- cgit v1.2.3