1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-08-08 14:02:17 +03:00

Fixed windows build

This commit is contained in:
Georg Richter
2015-10-05 08:06:48 +02:00
parent d4637c42da
commit ba301da127
4 changed files with 11 additions and 7 deletions

View File

@@ -82,9 +82,7 @@ MARIADB_CIO_PLUGIN _mysql_client_plugin_declaration_ =
"LGPL", "LGPL",
NULL, NULL,
NULL, NULL,
&cio_npipe_methods, &cio_npipe_methods
NULL,
NULL
}; };
struct st_cio_npipe { struct st_cio_npipe {

View File

@@ -84,8 +84,7 @@ MARIADB_CIO_PLUGIN _mysql_client_plugin_declaration_=
NULL, NULL,
NULL, NULL,
&cio_shm_methods, &cio_shm_methods,
NULL,
NULL
}; };
enum enum_shm_events enum enum_shm_events

View File

@@ -29,7 +29,10 @@
#include <mysql/client_plugin.h> #include <mysql/client_plugin.h>
#include <string.h> #include <string.h>
#include <m_string.h> #include <m_string.h>
#ifndef WIN32
#include <sys/time.h> #include <sys/time.h>
#endif
/* function prototypes */ /* function prototypes */
MYSQL *repl_connect(MYSQL *mysql, const char *host, const char *user, const char *passwd, MYSQL *repl_connect(MYSQL *mysql, const char *host, const char *user, const char *passwd,
@@ -129,10 +132,14 @@ my_bool repl_parse_url(const char *url, REPL_DATA *data)
data->host[MARIADB_SLAVE]= slaves[0]; data->host[MARIADB_SLAVE]= slaves[0];
else else
{ {
struct timeval tp;
int random_nr; int random_nr;
#ifndef WIN32
struct timeval tp;
gettimeofday(&tp,NULL); gettimeofday(&tp,NULL);
srand(tp.tv_usec / 1000 + tp.tv_sec * 1000); srand(tp.tv_usec / 1000 + tp.tv_sec * 1000);
#else
srand(GetTickCount());
#endif
random_nr= rand() % num_slaves; random_nr= rand() % num_slaves;
data->host[MARIADB_SLAVE]= slaves[random_nr]; data->host[MARIADB_SLAVE]= slaves[random_nr];

View File

@@ -47,7 +47,7 @@ void trace_callback(int mode, MYSQL *mysql, const uchar *buffer, size_t length);
#ifndef HAVE_TRACE_EXAMPLE_PLUGIN_DYNAMIC #ifndef HAVE_TRACE_EXAMPLE_PLUGIN_DYNAMIC
struct st_mysql_client_plugin trace_example_plugin= struct st_mysql_client_plugin trace_example_plugin=
#else #else
struct st_mysql_client_plugin _mysql_client_plugin_declare_= struct st_mysql_client_plugin _mysql_client_plugin_declaration_ =
#endif #endif
{ {
MARIADB_CLIENT_TRACE_PLUGIN, MARIADB_CLIENT_TRACE_PLUGIN,