diff options
author | Sergei Golubchik <sergii@pisem.net> | 2011-10-07 00:18:30 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2011-10-07 00:18:30 +0200 |
commit | eeca1f8694ccd0a8271d10e73c628b4a062ed9a5 (patch) | |
tree | bdc3aa6c3bc64c0e737a8b1298895fbe9f8d6b5b /include | |
parent | 9c32088322f69155d91f6033319ebb03d108f044 (diff) | |
parent | 4a4aa358f39c85fef7486a857abde11615544f71 (diff) | |
download | mariadb-git-eeca1f8694ccd0a8271d10e73c628b4a062ed9a5.tar.gz |
merge with 5.1
Diffstat (limited to 'include')
-rw-r--r-- | include/mysql/plugin.h | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/include/mysql/plugin.h b/include/mysql/plugin.h index 77d141d5282..801cab0ffa6 100644 --- a/include/mysql/plugin.h +++ b/include/mysql/plugin.h @@ -16,13 +16,27 @@ #ifndef _my_plugin_h #define _my_plugin_h - /* On Windows, exports from DLL need to be declared -*/ -#if (defined(_WIN32) && defined(MYSQL_DYNAMIC_PLUGIN)) -#define MYSQL_PLUGIN_EXPORT extern "C" __declspec(dllexport) -#else + Also, plugin needs to be declared as extern "C" because MSVC + unlike other compilers, uses C++ mangling for variables not only + for functions. +*/ +#if defined(_MSC_VER) +#if defined(MYSQL_DYNAMIC_PLUGIN) + #ifdef __cplusplus + #define MYSQL_PLUGIN_EXPORT extern "C" __declspec(dllexport) + #else + #define MYSQL_PLUGIN_EXPORT __declspec(dllexport) + #endif +#else /* MYSQL_DYNAMIC_PLUGIN */ + #ifdef __cplusplus + #define MYSQL_PLUGIN_EXPORT extern "C" + #else + #define MYSQL_PLUGIN_EXPORT + #endif +#endif /*MYSQL_DYNAMIC_PLUGIN */ +#else /*_MSC_VER */ #define MYSQL_PLUGIN_EXPORT #endif |