summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@sun.com>2009-08-11 18:05:25 +0500
committerSergey Vojtovich <svoj@sun.com>2009-08-11 18:05:25 +0500
commit24e418df6937109bd8167561f46822f02942e375 (patch)
tree51c420178316e108b0380d5666aadf5881384c5a /include
parentc1433ba201f6532aeb36b6ac2cf6718f2665aaa3 (diff)
parent94efc1c6b084ed531b513e70fb66e7b7a1186b56 (diff)
downloadmariadb-git-24e418df6937109bd8167561f46822f02942e375.tar.gz
Merge mysql-5.1-innodb_plugin to mysql-5.1.
Diffstat (limited to 'include')
-rw-r--r--include/m_ctype.h6
-rw-r--r--include/my_global.h13
-rw-r--r--include/my_sys.h8
-rw-r--r--include/mysql/plugin.h16
4 files changed, 33 insertions, 10 deletions
diff --git a/include/m_ctype.h b/include/m_ctype.h
index 04cf921dfee..451c8db549b 100644
--- a/include/m_ctype.h
+++ b/include/m_ctype.h
@@ -285,7 +285,7 @@ typedef struct charset_info_st
#define ILLEGAL_CHARSET_INFO_NUMBER (~0U)
-extern CHARSET_INFO my_charset_bin;
+extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_bin;
extern CHARSET_INFO my_charset_big5_chinese_ci;
extern CHARSET_INFO my_charset_big5_bin;
extern CHARSET_INFO my_charset_cp932_japanese_ci;
@@ -298,7 +298,7 @@ extern CHARSET_INFO my_charset_gb2312_chinese_ci;
extern CHARSET_INFO my_charset_gb2312_bin;
extern CHARSET_INFO my_charset_gbk_chinese_ci;
extern CHARSET_INFO my_charset_gbk_bin;
-extern CHARSET_INFO my_charset_latin1;
+extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_latin1;
extern CHARSET_INFO my_charset_latin1_german2_ci;
extern CHARSET_INFO my_charset_latin1_bin;
extern CHARSET_INFO my_charset_latin2_czech_ci;
@@ -315,7 +315,7 @@ extern CHARSET_INFO my_charset_utf8_general_ci;
extern CHARSET_INFO my_charset_utf8_unicode_ci;
extern CHARSET_INFO my_charset_utf8_bin;
extern CHARSET_INFO my_charset_cp1250_czech_ci;
-extern CHARSET_INFO my_charset_filename;
+extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_filename;
/* declarations for simple charsets */
extern size_t my_strnxfrm_simple(CHARSET_INFO *, uchar *, size_t,
diff --git a/include/my_global.h b/include/my_global.h
index 5b29c7ce000..4ad851e9e5d 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -1573,4 +1573,17 @@ static inline double rint(double x)
}
#endif /* HAVE_RINT */
+/*
+ MYSQL_PLUGIN_IMPORT macro is used to export mysqld data
+ (i.e variables) for usage in storage engine loadable plugins.
+ Outside of Windows, it is dummy.
+*/
+#ifndef MYSQL_PLUGIN_IMPORT
+#if (defined(_WIN32) && defined(MYSQL_DYNAMIC_PLUGIN))
+#define MYSQL_PLUGIN_IMPORT __declspec(dllimport)
+#else
+#define MYSQL_PLUGIN_IMPORT
+#endif
+#endif
+
#endif /* my_global_h */
diff --git a/include/my_sys.h b/include/my_sys.h
index 263b567684d..222564e0b44 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -221,8 +221,8 @@ extern uint my_large_page_size;
#endif
/* charsets */
-extern CHARSET_INFO *default_charset_info;
-extern CHARSET_INFO *all_charsets[256];
+extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *default_charset_info;
+extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *all_charsets[256];
extern CHARSET_INFO compiled_charsets[];
/* statistics */
@@ -237,8 +237,8 @@ extern void (*my_sigtstp_cleanup)(void),
(*my_sigtstp_restart)(void),
(*my_abort_hook)(int);
/* Executed when comming from shell */
-extern int NEAR my_umask, /* Default creation mask */
- NEAR my_umask_dir,
+extern MYSQL_PLUGIN_IMPORT int NEAR my_umask; /* Default creation mask */
+extern int NEAR my_umask_dir,
NEAR my_recived_signals, /* Signals we have got */
NEAR my_safe_to_handle_signal, /* Set when allowed to SIGTSTP */
NEAR my_dont_interrupt; /* call remember_intr when set */
diff --git a/include/mysql/plugin.h b/include/mysql/plugin.h
index a978d44b918..2e59262d061 100644
--- a/include/mysql/plugin.h
+++ b/include/mysql/plugin.h
@@ -16,6 +16,16 @@
#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
+#define MYSQL_PLUGIN_EXPORT
+#endif
+
#ifdef __cplusplus
class THD;
class Item;
@@ -90,9 +100,9 @@ int PSIZE= sizeof(struct st_mysql_plugin); \
struct st_mysql_plugin DECLS[]= {
#else
#define __MYSQL_DECLARE_PLUGIN(NAME, VERSION, PSIZE, DECLS) \
-int _mysql_plugin_interface_version_= MYSQL_PLUGIN_INTERFACE_VERSION; \
-int _mysql_sizeof_struct_st_plugin_= sizeof(struct st_mysql_plugin); \
-struct st_mysql_plugin _mysql_plugin_declarations_[]= {
+MYSQL_PLUGIN_EXPORT int _mysql_plugin_interface_version_= MYSQL_PLUGIN_INTERFACE_VERSION; \
+MYSQL_PLUGIN_EXPORT int _mysql_sizeof_struct_st_plugin_= sizeof(struct st_mysql_plugin); \
+MYSQL_PLUGIN_EXPORT struct st_mysql_plugin _mysql_plugin_declarations_[]= {
#endif
#define mysql_declare_plugin(NAME) \