Skip to content

Commit

Permalink
Ensure plugin.h uses C ABI when used via C++ (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sainan authored Oct 25, 2024
1 parent afbf6e1 commit c588569
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions includes/plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,20 @@

#if defined(_WIN32) || defined(WIN32)
#ifdef ANALOGSDK_EXPORTS
#define ANALOGSDK_API __declspec(dllexport)
#define ANALOGSDK_EXPORT __declspec(dllexport)
#else
#define ANALOGSDK_API __declspec(dllimport)
#define ANALOGSDK_EXPORT __declspec(dllimport)
#endif
#pragma comment(lib, "userenv.lib")
#pragma comment(lib, "WS2_32")
#else
#define ANALOGSDK_API
#define ANALOGSDK_EXPORT
#endif

#ifdef __cplusplus
#define ANALOGSDK_API extern "C" ANALOGSDK_EXPORT
#else
#define ANALOGSDK_API ANALOGSDK_EXPORT
#endif

const uint32_t ANALOG_SDK_PLUGIN_ABI_VERSION = 1;
Expand Down

0 comments on commit c588569

Please sign in to comment.