diff --git a/.bzr-mysql/default.conf b/.bzr-mysql/default.conf
index f79c1cd6319..e613cefc614 100644
--- a/.bzr-mysql/default.conf
+++ b/.bzr-mysql/default.conf
@@ -1,4 +1,4 @@
[MYSQL]
post_commit_to = "commits@lists.mysql.com"
post_push_to = "commits@lists.mysql.com"
-tree_name = "mysql-5.0"
+tree_name = "mysql-5.1-bugteam"
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 37956204faa..ae069498da1 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -82,18 +82,18 @@ SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -DDBUG_OFF")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4800 /wd4805")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4800 /wd4805")
-IF(CMAKE_GENERATOR MATCHES "Visual Studio 8")
+# Disable warnings in Visual Studio 8 and above
+IF(MSVC AND NOT CMAKE_GENERATOR MATCHES "Visual Studio 7")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /wd4996")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /wd4996")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /wd4996")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /wd4996")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /wd4996")
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /wd4996")
-ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 8")
-
-IF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR
- CMAKE_GENERATOR MATCHES "Visual Studio 8")
+ENDIF(MSVC AND NOT CMAKE_GENERATOR MATCHES "Visual Studio 7")
+# Settings for Visual Studio 7 and above.
+IF(MSVC)
# replace /MDd with /MTd
STRING(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})
STRING(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS_RELWITHDEBINFO})
@@ -123,9 +123,7 @@ IF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR
IF(NOT tmp_manifest)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO")
ENDIF(NOT tmp_manifest)
-
-ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR
- CMAKE_GENERATOR MATCHES "Visual Studio 8")
+ENDIF(MSVC)
ADD_DEFINITIONS("-D_WINDOWS -D__WIN__ -D_CRT_SECURE_NO_DEPRECATE")
diff --git a/client/mysqldump.c b/client/mysqldump.c
index 364e80ee56b..ced34f16212 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -1836,7 +1836,13 @@ static uint get_table_structure(char *table, char *db, char *table_type,
fprintf(sql_file, ",\n %s %s",
quote_name(row[0], name_buff, 0), row[1]);
}
- fprintf(sql_file, "\n) */;\n");
+ /*
+ Stand-in tables are always MyISAM tables as the default
+ engine might have a column-limit that's lower than the
+ number of columns in the view, and MyISAM support is
+ guaranteed to be in the server anyway.
+ */
+ fprintf(sql_file, "\n) ENGINE=MyISAM */;\n");
check_io(sql_file);
}
}
diff --git a/extra/yassl/taocrypt/taocrypt.vcproj b/extra/yassl/taocrypt/taocrypt.vcproj
deleted file mode 100755
index bcbc0f82192..00000000000
--- a/extra/yassl/taocrypt/taocrypt.vcproj
+++ /dev/null
@@ -1,268 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/extra/yassl/yassl.vcproj b/extra/yassl/yassl.vcproj
deleted file mode 100755
index bc020747096..00000000000
--- a/extra/yassl/yassl.vcproj
+++ /dev/null
@@ -1,211 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/libmysql/dll.c b/libmysql/dll.c
index b0e4b9cab3b..7bea5f880c5 100644
--- a/libmysql/dll.c
+++ b/libmysql/dll.c
@@ -89,9 +89,20 @@ BOOL APIENTRY LibMain(HANDLE hInst,DWORD ul_reason_being_called,
UNREFERENCED_PARAMETER(lpReserved);
} /* LibMain */
+
+static BOOL do_libmain;
int __stdcall DllMain(HANDLE hInst,DWORD ul_reason_being_called,LPVOID lpReserved)
{
- return LibMain(hInst,ul_reason_being_called,lpReserved);
+ /*
+ Unless environment variable LIBMYSQL_DLLINIT is set, do nothing.
+ The environment variable is checked once, during the first call to DllMain()
+ (in DLL_PROCESS_ATTACH hook).
+ */
+ if (ul_reason_being_called == DLL_PROCESS_ATTACH)
+ do_libmain = (getenv("LIBMYSQL_DLLINIT") != NULL);
+ if (do_libmain)
+ return LibMain(hInst,ul_reason_being_called,lpReserved);
+ return TRUE;
}
#elif defined(WINDOWS)
diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result
index b484cf7c51d..163231c9f66 100644
--- a/mysql-test/r/mysqldump.result
+++ b/mysql-test/r/mysqldump.result
@@ -1996,7 +1996,7 @@ DROP TABLE IF EXISTS `v2`;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
/*!50001 CREATE TABLE `v2` (
`a` varchar(30)
-) */;
+) ENGINE=MyISAM */;
/*!50001 DROP TABLE `v2`*/;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
@@ -2078,7 +2078,7 @@ DROP TABLE IF EXISTS `v1`;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
/*!50001 CREATE TABLE `v1` (
`a` int(11)
-) */;
+) ENGINE=MyISAM */;
/*!50001 DROP TABLE `v1`*/;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
@@ -2140,7 +2140,7 @@ DROP TABLE IF EXISTS `v2`;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
/*!50001 CREATE TABLE `v2` (
`a` varchar(30)
-) */;
+) ENGINE=MyISAM */;
/*!50001 DROP TABLE `v2`*/;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
@@ -2244,19 +2244,19 @@ DROP TABLE IF EXISTS `v1`;
`a` int(11),
`b` int(11),
`c` varchar(30)
-) */;
+) ENGINE=MyISAM */;
DROP TABLE IF EXISTS `v2`;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
/*!50001 CREATE TABLE `v2` (
`a` int(11)
-) */;
+) ENGINE=MyISAM */;
DROP TABLE IF EXISTS `v3`;
/*!50001 DROP VIEW IF EXISTS `v3`*/;
/*!50001 CREATE TABLE `v3` (
`a` int(11),
`b` int(11),
`c` varchar(30)
-) */;
+) ENGINE=MyISAM */;
/*!50001 DROP TABLE `v1`*/;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
@@ -2860,21 +2860,21 @@ DROP TABLE IF EXISTS `v0`;
`a` int(11),
`b` varchar(32),
`c` varchar(32)
-) */;
+) ENGINE=MyISAM */;
DROP TABLE IF EXISTS `v1`;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
/*!50001 CREATE TABLE `v1` (
`a` int(11),
`b` varchar(32),
`c` varchar(32)
-) */;
+) ENGINE=MyISAM */;
DROP TABLE IF EXISTS `v2`;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
/*!50001 CREATE TABLE `v2` (
`a` int(11),
`b` varchar(32),
`c` varchar(32)
-) */;
+) ENGINE=MyISAM */;
USE `test`;
/*!50001 DROP TABLE `v0`*/;
@@ -3198,7 +3198,7 @@ DROP TABLE IF EXISTS `v1`;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
/*!50001 CREATE TABLE `v1` (
`id` int(11)
-) */;
+) ENGINE=MyISAM */;
USE `mysqldump_test_db`;
/*!50001 DROP TABLE `v1`*/;
@@ -3246,7 +3246,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqldump_views` /*!40100 DEFAULT CHAR
USE `mysqldump_views`;
/*!50001 CREATE TABLE `nasishnasifu` (
`id` bigint(20) unsigned
-) */;
+) ENGINE=MyISAM */;
USE `mysqldump_tables`;
diff --git a/mysql-test/r/rpl_log.result b/mysql-test/r/rpl_log.result
index 6ee0eb283b5..ae3fe107038 100644
--- a/mysql-test/r/rpl_log.result
+++ b/mysql-test/r/rpl_log.result
@@ -7,7 +7,7 @@ start slave;
stop slave;
reset master;
reset slave;
-reset master;
+start slave;
create table t1(n int not null auto_increment primary key);
insert into t1 values (NULL);
drop table t1;
@@ -25,8 +25,8 @@ master-bin.000001 219 Intvar 1 247 INSERT_ID=1
master-bin.000001 247 Query 1 338 use `test`; insert into t1 values (NULL)
master-bin.000001 338 Query 1 414 use `test`; drop table t1
master-bin.000001 414 Query 1 517 use `test`; create table t1 (word char(20) not null)
-master-bin.000001 517 Begin_load_query 1 1121 ;file_id=1;block_len=581
-master-bin.000001 1121 Execute_load_query 1 1269 use `test`; load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines ;file_id=1
+master-bin.000001 517 Begin_load_query 1 1121 ;file_id=#;block_len=#
+master-bin.000001 1121 Execute_load_query 1 1269 use `test`; load data infile 'words.dat' into table t1 ignore 1 lines ;file_id=#
master-bin.000001 1269 Query 1 1345 use `test`; drop table t1
show binlog events from 98 limit 1;
Log_name Pos Event_type Server_id End_log_pos Info
@@ -41,7 +41,6 @@ master-bin.000001 247 Query 1 338 use `test`; insert into t1 values (NULL)
flush logs;
create table t5 (a int);
drop table t5;
-start slave;
flush logs;
stop slave;
create table t1 (n int);
@@ -55,8 +54,8 @@ master-bin.000001 219 Intvar 1 247 INSERT_ID=1
master-bin.000001 247 Query 1 338 use `test`; insert into t1 values (NULL)
master-bin.000001 338 Query 1 414 use `test`; drop table t1
master-bin.000001 414 Query 1 517 use `test`; create table t1 (word char(20) not null)
-master-bin.000001 517 Begin_load_query 1 1121 ;file_id=1;block_len=581
-master-bin.000001 1121 Execute_load_query 1 1269 use `test`; load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines ;file_id=1
+master-bin.000001 517 Begin_load_query 1 1121 ;file_id=#;block_len=#
+master-bin.000001 1121 Execute_load_query 1 1269 use `test`; load data infile 'words.dat' into table t1 ignore 1 lines ;file_id=#
master-bin.000001 1269 Query 1 1345 use `test`; drop table t1
master-bin.000001 1345 Rotate 1 1389 master-bin.000002;pos=4
show binlog events in 'master-bin.000002';
@@ -84,8 +83,8 @@ slave-bin.000001 219 Intvar 1 247 INSERT_ID=1
slave-bin.000001 247 Query 1 338 use `test`; insert into t1 values (NULL)
slave-bin.000001 338 Query 1 414 use `test`; drop table t1
slave-bin.000001 414 Query 1 517 use `test`; create table t1 (word char(20) not null)
-slave-bin.000001 517 Begin_load_query 1 1121 ;file_id=1;block_len=581
-slave-bin.000001 1121 Execute_load_query 1 1271 use `test`; load data INFILE '../tmp/SQL_LOAD-2-1-1.data' INTO table t1 ignore 1 lines ;file_id=1
+slave-bin.000001 517 Begin_load_query 1 1121 ;file_id=#;block_len=#
+slave-bin.000001 1121 Execute_load_query 1 1271 use `test`; load data INFILE 'words.dat' INTO table t1 ignore 1 lines ;file_id=#
slave-bin.000001 1271 Query 1 1347 use `test`; drop table t1
slave-bin.000001 1347 Query 1 1433 use `test`; create table t5 (a int)
slave-bin.000001 1433 Query 1 1509 use `test`; drop table t5
diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def
index 297b6e70f39..49f422af298 100644
--- a/mysql-test/t/disabled.def
+++ b/mysql-test/t/disabled.def
@@ -17,8 +17,6 @@ im_options_set : Bug#20294: Instance manager tests fail randomly
im_options_unset : Bug#20294: Instance manager tests fail randomly
im_utils : Bug#20294: Instance manager tests fail randomly
grant_cache : Bug#32651: grant_cache.test fails
-rpl_log : Bug#32653: rpl_log.test fails randomly
-rpl_view : Bug#32654: rpl_view.test fails randomly
ndb_backup_print : Bug#32357: ndb_backup_print test fails sometimes in pushbuild
rpl_log_pos : Bug#8693 Test 'rpl_log_pos' fails sometimes
kill : Bug#29149 Test "kill" fails on Windows
diff --git a/mysql-test/t/rpl_ddl.test b/mysql-test/t/rpl_ddl.test
index d2a41a305b6..23841ee3491 100644
--- a/mysql-test/t/rpl_ddl.test
+++ b/mysql-test/t/rpl_ddl.test
@@ -55,6 +55,18 @@ DROP DATABASE IF EXISTS mysqltest3;
CREATE DATABASE mysqltest1;
CREATE DATABASE mysqltest2;
CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE= "InnoDB";
+# Prevent Bug#26687 rpl_ddl test fails if run with --innodb option
+# The current testscripts + the expected result need that the slave uses MyISAM
+# for the table mysqltest.t1.
+sync_slave_with_master;
+connection slave;
+if (`SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES
+ WHERE TABLE_SCHEMA = 'mysqltest1' AND TABLE_NAME = 't1'
+ AND ENGINE <> 'MyISAM'`)
+{
+ skip This test needs on slave side: InnoDB disabled, default engine: MyISAM;
+}
+connection master;
INSERT INTO mysqltest1.t1 SET f1= 0;
CREATE TABLE mysqltest1.t2 (f1 BIGINT) ENGINE= "InnoDB";
CREATE TABLE mysqltest1.t3 (f1 BIGINT) ENGINE= "InnoDB";
diff --git a/mysql-test/t/rpl_log-slave.opt b/mysql-test/t/rpl_log-slave.opt
index 8b137891791..203fc2287ec 100644
--- a/mysql-test/t/rpl_log-slave.opt
+++ b/mysql-test/t/rpl_log-slave.opt
@@ -1 +1 @@
-
+--log-slave-updates
diff --git a/mysql-test/t/rpl_log.test b/mysql-test/t/rpl_log.test
index 578a39efd6e..52c4a3e0606 100644
--- a/mysql-test/t/rpl_log.test
+++ b/mysql-test/t/rpl_log.test
@@ -13,22 +13,15 @@ save_master_pos;
connection slave;
sync_with_master;
stop slave;
+--source include/wait_for_slave_to_stop.inc
reset master;
reset slave;
-# We are going to read the slave's binlog which contains file_id (for some LOAD
-# DATA INFILE); to make it repeatable (not influenced by other tests), we need
-# to stop and start the slave, to be sure file_id will start from 1.
-# This can be done with 'server_stop slave', but
-# this would require the manager, so most of the time the test will be skipped
-# :(
-# To workaround this, I (Guilhem) add a (empty) rpl_log-slave.opt (because when
-# mysql-test-run finds such a file it restarts the slave before doing the
-# test). That's not very elegant but I could find no better way, sorry.
+start slave;
+--source include/wait_for_slave_to_start.inc
let $VERSION=`select version()`;
connection master;
-reset master;
create table t1(n int not null auto_increment primary key);
insert into t1 values (NULL);
drop table t1;
@@ -37,6 +30,7 @@ load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines;
select count(*) from t1;
drop table t1;
--replace_result $VERSION VERSION
+--replace_regex /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/ /infile '.+'/infile 'words.dat'/
show binlog events;
show binlog events from 98 limit 1;
show binlog events from 98 limit 2;
@@ -69,10 +63,10 @@ connection slave;
# Note that the above 'slave start' will cause a 3rd rotate event (a fake one)
# to go into the relay log (the master always sends a fake one when replication
# starts).
-start slave;
sync_with_master;
flush logs;
stop slave;
+--source include/wait_for_slave_to_stop.inc
connection master;
# Create some entries for second log
@@ -81,6 +75,7 @@ create table t1 (n int);
insert into t1 values (1);
drop table t1;
--replace_result $VERSION VERSION
+--replace_regex /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/ /infile '.+'/infile 'words.dat'/
show binlog events;
--replace_result $VERSION VERSION
show binlog events in 'master-bin.000002';
@@ -88,9 +83,11 @@ show binary logs;
save_master_pos;
connection slave;
start slave;
+--source include/wait_for_slave_to_start.inc
sync_with_master;
show binary logs;
--replace_result $MASTER_MYPORT MASTER_PORT $VERSION VERSION
+--replace_regex /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/ /INFILE '.+'/INFILE 'words.dat'/
show binlog events in 'slave-bin.000001' from 4;
--replace_result $MASTER_MYPORT MASTER_PORT $VERSION VERSION
show binlog events in 'slave-bin.000002' from 4;
diff --git a/mysql-test/t/rpl_view-slave.opt b/mysql-test/t/rpl_view-slave.opt
deleted file mode 100644
index 79b3bf6174b..00000000000
--- a/mysql-test/t/rpl_view-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---replicate-ignore-table=test.foo
diff --git a/server-tools/instance-manager/mysqlmanager.vcproj b/server-tools/instance-manager/mysqlmanager.vcproj
deleted file mode 100644
index a38565fc1f3..00000000000
--- a/server-tools/instance-manager/mysqlmanager.vcproj
+++ /dev/null
@@ -1,382 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/win/build-vs9.bat b/win/build-vs9.bat
new file mode 100644
index 00000000000..09f1e343013
--- /dev/null
+++ b/win/build-vs9.bat
@@ -0,0 +1,18 @@
+@echo off
+
+REM Copyright (C) 2006 MySQL AB
+REM
+REM This program is free software; you can redistribute it and/or modify
+REM it under the terms of the GNU General Public License as published by
+REM the Free Software Foundation; version 2 of the License.
+REM
+REM This program is distributed in the hope that it will be useful,
+REM but WITHOUT ANY WARRANTY; without even the implied warranty of
+REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+REM GNU General Public License for more details.
+REM
+REM You should have received a copy of the GNU General Public License
+REM along with this program; if not, write to the Free Software
+REM Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+cmake -G "Visual Studio 9 2008"
+
diff --git a/win/build-vs9_x64.bat b/win/build-vs9_x64.bat
new file mode 100644
index 00000000000..61c7253132d
--- /dev/null
+++ b/win/build-vs9_x64.bat
@@ -0,0 +1,18 @@
+@echo off
+
+REM Copyright (C) 2006 MySQL AB
+REM
+REM This program is free software; you can redistribute it and/or modify
+REM it under the terms of the GNU General Public License as published by
+REM the Free Software Foundation; version 2 of the License.
+REM
+REM This program is distributed in the hope that it will be useful,
+REM but WITHOUT ANY WARRANTY; without even the implied warranty of
+REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+REM GNU General Public License for more details.
+REM
+REM You should have received a copy of the GNU General Public License
+REM along with this program; if not, write to the Free Software
+REM Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+cmake -G "Visual Studio 9 2008 Win64"
+
diff --git a/zlib/zutil.h b/zlib/zutil.h
index b7d5eff81b6..4482957d6ac 100644
--- a/zlib/zutil.h
+++ b/zlib/zutil.h
@@ -194,7 +194,7 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
# ifdef __TURBOC__
# define NO_vsnprintf
# endif
-# ifdef WIN32
+# if defined(WIN32) && (!defined(_MSC_VER) || _MSC_VER < 1500)
/* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */
# if !defined(vsnprintf) && !defined(NO_vsnprintf)
# define vsnprintf _vsnprintf