diff --git a/include/mysql/client_plugin.h b/include/mysql/client_plugin.h index 9c7b1aee9f9..fc4db6b6553 100644 --- a/include/mysql/client_plugin.h +++ b/include/mysql/client_plugin.h @@ -28,6 +28,16 @@ #include #endif +#if defined(_MSC_VER) + #ifdef __cplusplus + #define MYSQL_PLUGIN_EXPORT extern "C" __declspec(dllexport) + #else + #define MYSQL_PLUGIN_EXPORT __declspec(dllexport) + #endif +#else /*_MSC_VER */ +#define MYSQL_PLUGIN_EXPORT +#endif + /* known plugin types */ #define MYSQL_CLIENT_reserved1 0 #define MYSQL_CLIENT_reserved2 1 @@ -38,6 +48,7 @@ #define MYSQL_CLIENT_MAX_PLUGINS 3 #define mysql_declare_client_plugin(X) \ + MYSQL_PLUGIN_EXPORT \ struct st_mysql_client_plugin_ ## X \ _mysql_client_plugin_declaration_ = { \ MYSQL_CLIENT_ ## X ## _PLUGIN, \ diff --git a/include/mysql/plugin_auth_common.h b/include/mysql/plugin_auth_common.h index b71591d6eb6..ed613b2a5ce 100644 --- a/include/mysql/plugin_auth_common.h +++ b/include/mysql/plugin_auth_common.h @@ -14,6 +14,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#ifdef _WIN32 +#include +#endif + /** @file diff --git a/plugin/auth/CMakeLists.txt b/plugin/auth/CMakeLists.txt new file mode 100644 index 00000000000..931a47fec5e --- /dev/null +++ b/plugin/auth/CMakeLists.txt @@ -0,0 +1,3 @@ +INCLUDE("${PROJECT_SOURCE_DIR}/storage/mysql_storage_engine.cmake") +SET(AUTH_SOURCES dialog.c) +MYSQL_PLUGIN(AUTH) diff --git a/plugin/auth/dialog.c b/plugin/auth/dialog.c index 49ab0c9a158..76b2ddae528 100644 --- a/plugin/auth/dialog.c +++ b/plugin/auth/dialog.c @@ -33,13 +33,16 @@ a correct password. It shows the situation when a number of questions is not known in advance. */ -#define _GNU_SOURCE /* for RTLD_DEFAULT */ +#include +#include +#include +#include + +#if defined (_WIN32) +# define RTLD_DEFAULT GetModuleHandle(NULL) +#endif #include -#include -#include -#include -#include /** first byte of the question string is the question "type". @@ -51,8 +54,6 @@ #define PASSWORD_QUESTION "\4" #define LAST_PASSWORD "\5" -typedef unsigned char uchar; - /********************* SERVER SIDE ****************************************/ /** @@ -216,9 +217,6 @@ maria_declare_plugin_end; dialog plugin will use it for communication with the user. Otherwise a default gets() based implementation will be used. */ -#include -#include - static mysql_authentication_dialog_ask_t ask; static char *builtin_ask(MYSQL *mysql __attribute__((unused)),