Skip to content

Commit

Permalink
FIX(plugins): Compilation with new unified header
Browse files Browse the repository at this point in the history
The new header (as introduced via
2b35c0c) was missing a typedef and a
utility macro for dealing with the versioned MumbleAPI struct.

Furthermore, plugins that are only build in debug builds were still
including the old (and now non-existing) headers.
  • Loading branch information
Krzmbrzl committed Nov 29, 2023
1 parent 432f62a commit 8a764cf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 4 additions & 1 deletion plugins/MumblePlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -1211,6 +1211,9 @@ mumble_version_t mumble_getPluginFunctionsVersion() {
MUMBLE_ECONCAT(MUMBLE_ECONCAT(MumbleAPI_v, MUMBLE_PLUGIN_API_MAJOR_MACRO), MUMBLE_PLUGIN_API_MINOR_MACRO), \
x)

# undef MUMBLE_API_CAST
# define MUMBLE_API_CAST(ptr) (*((MUMBLE_API_STRUCT_NAME *) ptr))

// Define some helper macros to make version-specific changes to the API functions
# define SELECTED_API_VERSION \
MUMBLE_PLUGIN_VERSION_CHECK(MUMBLE_PLUGIN_API_MAJOR_MACRO, MUMBLE_PLUGIN_API_MINOR_MACRO, \
Expand Down Expand Up @@ -1811,10 +1814,10 @@ struct MUMBLE_API_STRUCT_NAME {
* Typedef for the Mumble API struct for convenient (unversioned) access
*/
typedef struct MUMBLE_API_STRUCT_NAME MumbleAPI;
typedef struct MUMBLE_API_STRUCT_NAME mumble_api_t;
# endif

# undef SELECTED_API_VERSION
# undef MUMBLE_API_STRUCT_NAME
# undef PARAM_v1_2

#endif // EXTERNAL_MUMBLE_PLUGIN_MUMBLE_API_
5 changes: 2 additions & 3 deletions plugins/deadLockPlugin/deadLockPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@

// Include the definitions of the plugin functions
// Not that this will also include ../PluginComponents.h
#include "../MumbleAPI_v_1_0_x.h"
#include "../MumblePlugin_v_1_0_x.h"
#include "../MumblePlugin.h"

#include <condition_variable>
#include <cstring>
#include <iostream>
#include <mutex>
#include <thread>

MumbleAPI_v_1_0_x mumAPI;
MumbleAPI mumAPI;
mumble_connection_t activeConnection;
mumble_plugin_id_t ownID;
std::mutex dummyMutex;
Expand Down
3 changes: 1 addition & 2 deletions plugins/testPlugin/testPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@

// Include the definitions of the plugin functions
// Not that this will also include ../PluginComponents.h
#include "../MumbleAPI_v_1_0_x.h"
#include "../MumblePlugin_v_1_0_x.h"
#include "../MumblePlugin.h"

#include <cstring>
#include <iostream>
Expand Down

0 comments on commit 8a764cf

Please sign in to comment.