Skip to content

Commit

Permalink
Windows build fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
9EOR9 committed Nov 4, 2015
1 parent 052e5db commit a7ce3ad
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion include/my_global.h
Expand Up @@ -454,7 +454,8 @@ typedef SOCKET_SIZE_TYPE size_socket;
#ifdef _WIN32
#define NO_DIR_LIBRARY /* Not standar dir-library */
#define USE_MY_STAT_STRUCT /* For my_lib */
#ifdef _MSVC
#ifdef _MSC_VER

typedef SSIZE_T ssize_t;
#endif
#endif
Expand Down
5 changes: 4 additions & 1 deletion libmariadb/get_password.c
Expand Up @@ -51,7 +51,11 @@ static char *get_password(FILE *file, char *buffer, int length)
{
char inChar;
int CharsProcessed= 1;
#ifdef _WIN32
DWORD Offset= 0;
#else
int Offset= 0;
#endif

memset(buffer, 0, length);

Expand Down Expand Up @@ -117,7 +121,6 @@ char* get_tty_password(char *prompt, char *buffer, int length)
HANDLE Hdl;
int Offset= 0;
DWORD CharsProcessed= 0;
char inChar;

if (prompt)
fprintf(stderr, "%s", prompt);
Expand Down
2 changes: 1 addition & 1 deletion libmariadb/violite.c
Expand Up @@ -360,7 +360,7 @@ size_t vio_read(Vio * vio, gptr buf, size_t size)

if (vio->cache + vio->cache_size > vio->cache_pos)
{
r= MIN(size, vio->cache + vio->cache_size - vio->cache_pos);
r= MIN(size, (size_t)(vio->cache + vio->cache_size - vio->cache_pos));
memcpy(buf, vio->cache_pos, r);
vio->cache_pos+= r;
}
Expand Down
1 change: 1 addition & 0 deletions unittest/libmariadb/async.c
Expand Up @@ -204,6 +204,7 @@ static int test_conc129(MYSQL *my)
{
MYSQL *mysql= mysql_init(NULL);
FAIL_IF(mysql_close_start(mysql), "No error expected");
return OK;
}


Expand Down
4 changes: 2 additions & 2 deletions unittest/libmariadb/misc.c
Expand Up @@ -831,7 +831,7 @@ static int test_conc49(MYSQL *mysql)
rc= mysql_query(mysql, "SELECT a FROM conc49");
check_mysql_rc(rc, mysql);
res= mysql_store_result(mysql);
rc= mysql_num_rows(res);
rc= (int)mysql_num_rows(res);
mysql_free_result(res);
FAIL_IF(rc != 3, "3 rows expected");
return OK;
Expand Down Expand Up @@ -950,7 +950,7 @@ static int test_connect_attrs(MYSQL *my)
rc= mysql_query(mysql, "SELECT * FROM performance_schema.session_connect_attrs where attr_name like 'foo%'");
check_mysql_rc(rc, mysql);
result= mysql_store_result(mysql);
rc= mysql_num_rows(result);
rc= (int)mysql_num_rows(result);
mysql_free_result(result);

mysql_options(mysql, MYSQL_OPT_CONNECT_ATTR_RESET, NULL);
Expand Down

0 comments on commit a7ce3ad

Please sign in to comment.