diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/mysql/client_plugin.h | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/include/mysql/client_plugin.h b/include/mysql/client_plugin.h index b2df0019dfe..84fb3c6798d 100644 --- a/include/mysql/client_plugin.h +++ b/include/mysql/client_plugin.h @@ -32,17 +32,18 @@ */ #undef MYSQL_PLUGIN_EXPORT #if defined(_MSC_VER) - #ifdef __cplusplus - #define MYSQL_PLUGIN_EXPORT extern "C" __declspec(dllexport) - #else - #define MYSQL_PLUGIN_EXPORT __declspec(dllexport) - #endif + #define MYSQL_PLUGIN_EXPORT_C __declspec(dllexport) #else /*_MSC_VER */ - #ifdef __cplusplus - #define MYSQL_PLUGIN_EXPORT extern "C" - #else - #define MYSQL_PLUGIN_EXPORT - #endif + #define MYSQL_PLUGIN_EXPORT_C +#endif +#ifdef __cplusplus +#define MYSQL_PLUGIN_EXPORT extern "C" MYSQL_PLUGIN_EXPORT_C +#define C_MODE_START extern "C" { +#define C_MODE_END } +#else +#define MYSQL_PLUGIN_EXPORT MYSQL_PLUGIN_EXPORT_C +#define C_MODE_START +#define C_MODE_END #endif #ifndef MYSQL_ABI_CHECK @@ -60,11 +61,12 @@ #define MYSQL_CLIENT_MAX_PLUGINS 3 #define mysql_declare_client_plugin(X) \ - MYSQL_PLUGIN_EXPORT struct st_mysql_client_plugin_ ## X \ + C_MODE_START MYSQL_PLUGIN_EXPORT_C \ + struct st_mysql_client_plugin_ ## X \ _mysql_client_plugin_declaration_ = { \ MYSQL_CLIENT_ ## X ## _PLUGIN, \ MYSQL_CLIENT_ ## X ## _PLUGIN_INTERFACE_VERSION, -#define mysql_end_client_plugin } +#define mysql_end_client_plugin }; C_MODE_END /* generic plugin header structure */ #define MYSQL_CLIENT_PLUGIN_HEADER \ |