diff options
author | Sergei Golubchik <serg@mariadb.org> | 2017-03-06 22:42:00 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2017-03-10 18:21:28 +0100 |
commit | 269ab56f8b4056ec63e712ba305761dd835ea10e (patch) | |
tree | 9e2659b5b3bba59f23836d1dee8fd348bfd0f3c7 | |
parent | 227f63db3b0b9a1ce29c37f1c104ba5d204d0392 (diff) | |
download | mariadb-git-269ab56f8b4056ec63e712ba305761dd835ea10e.tar.gz |
small plugin API related fixes
* define MYSQL_DYNAMIC_PLUGIN only for server plugins
* don't typedef my_bool in mysql.h if plugin.h has already done it
* fix the include guard in plugin.h
-rw-r--r-- | cmake/plugin.cmake | 7 | ||||
-rw-r--r-- | include/mysql.h | 4 | ||||
-rw-r--r-- | include/mysql/plugin.h | 4 | ||||
-rw-r--r-- | libmysql/get_password.c | 2 | ||||
-rw-r--r-- | plugin/auth_dialog/CMakeLists.txt | 1 |
5 files changed, 13 insertions, 5 deletions
diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake index 818264f9edf..3fbb19381bc 100644 --- a/cmake/plugin.cmake +++ b/cmake/plugin.cmake @@ -186,8 +186,11 @@ MACRO(MYSQL_ADD_PLUGIN) ADD_LIBRARY(${target} MODULE ${SOURCES}) DTRACE_INSTRUMENT(${target}) - SET_TARGET_PROPERTIES (${target} PROPERTIES PREFIX "" - COMPILE_DEFINITIONS "MYSQL_DYNAMIC_PLUGIN") + SET_TARGET_PROPERTIES (${target} PROPERTIES PREFIX "") + IF (NOT ARG_CLIENT) + SET_TARGET_PROPERTIES (${target} PROPERTIES + COMPILE_DEFINITIONS "MYSQL_DYNAMIC_PLUGIN") + ENDIF() TARGET_LINK_LIBRARIES (${target} mysqlservices ${ARG_LINK_LIBRARIES}) diff --git a/include/mysql.h b/include/mysql.h index f088ad668a1..53c86aee889 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -48,7 +48,11 @@ extern "C" { #ifndef MYSQL_ABI_CHECK #include <sys/types.h> #endif + +#ifndef MYSQL_PLUGIN_INCLUDED typedef char my_bool; +#endif + #if (defined(_WIN32) || defined(_WIN64)) && !defined(__WIN__) #define __WIN__ #endif diff --git a/include/mysql/plugin.h b/include/mysql/plugin.h index 255d009f029..a5bfa1bbc9e 100644 --- a/include/mysql/plugin.h +++ b/include/mysql/plugin.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef _my_plugin_h -#define _my_plugin_h +#ifndef MYSQL_PLUGIN_INCLUDED +#define MYSQL_PLUGIN_INCLUDED /* On Windows, exports from DLL need to be declared diff --git a/libmysql/get_password.c b/libmysql/get_password.c index e704aec8337..36f8f9b0845 100644 --- a/libmysql/get_password.c +++ b/libmysql/get_password.c @@ -217,7 +217,7 @@ void get_tty_password_buff(const char *opt_message, char *buff, size_t buflen) } #endif /*__WIN__*/ -#ifndef MYSQL_DYNAMIC_PLUGIN +#ifndef NO_GET_TTY_PASSWORD char *get_tty_password(const char *opt_message) { char buff[80]; diff --git a/plugin/auth_dialog/CMakeLists.txt b/plugin/auth_dialog/CMakeLists.txt index 7253b2b2f97..771bc615bd5 100644 --- a/plugin/auth_dialog/CMakeLists.txt +++ b/plugin/auth_dialog/CMakeLists.txt @@ -14,5 +14,6 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +ADD_DEFINITIONS(-DNO_GET_TTY_PASSWORD) MYSQL_ADD_PLUGIN(dialog dialog.c ${CMAKE_SOURCE_DIR}/libmysql/get_password.c MODULE_ONLY CLIENT COMPONENT ClientPlugins) |