aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGennadiy Civil <gennadiycivil@users.noreply.github.com>2017-12-08 11:08:17 -0500
committerGitHub <noreply@github.com>2017-12-08 11:08:17 -0500
commit887a6c642006aa7475bdedb2b3652feb6a05f417 (patch)
tree5272a50fd90343c1c9568c5f90ab44925945bbe3
parenta868e618c0607259c63f37d948b72586a13922ff (diff)
parent57bb0bbbf80b006f35a249951fe2e051221173ae (diff)
downloadgoogletest-887a6c642006aa7475bdedb2b3652feb6a05f417.tar.gz
Merge pull request #1348 from wmamrak/master
Remove C4996 warning in VS2017
-rw-r--r--googlemock/CMakeLists.txt2
-rw-r--r--googletest/CMakeLists.txt2
-rw-r--r--googletest/include/gtest/internal/gtest-port.h3
3 files changed, 7 insertions, 0 deletions
diff --git a/googlemock/CMakeLists.txt b/googlemock/CMakeLists.txt
index 724fdd5f..c474947e 100644
--- a/googlemock/CMakeLists.txt
+++ b/googlemock/CMakeLists.txt
@@ -74,6 +74,8 @@ include_directories("${gmock_SOURCE_DIR}/include"
# <= VS 2010 <= 10 <= 1600 Use Google Tests's own tuple.
# VS 2012 11 1700 std::tr1::tuple + _VARIADIC_MAX=10
# VS 2013 12 1800 std::tr1::tuple
+# VS 2015 14 1900 std::tuple
+# VS 2017 15 >= 1910 std::tuple
if (MSVC AND MSVC_VERSION EQUAL 1700)
add_definitions(/D _VARIADIC_MAX=10)
endif()
diff --git a/googletest/CMakeLists.txt b/googletest/CMakeLists.txt
index b9a920b7..31fef2cd 100644
--- a/googletest/CMakeLists.txt
+++ b/googletest/CMakeLists.txt
@@ -83,6 +83,8 @@ include_directories(
# <= VS 2010 <= 10 <= 1600 Use Google Tests's own tuple.
# VS 2012 11 1700 std::tr1::tuple + _VARIADIC_MAX=10
# VS 2013 12 1800 std::tr1::tuple
+# VS 2015 14 1900 std::tuple
+# VS 2017 15 >= 1910 std::tuple
if (MSVC AND MSVC_VERSION EQUAL 1700)
add_definitions(/D _VARIADIC_MAX=10)
endif()
diff --git a/googletest/include/gtest/internal/gtest-port.h b/googletest/include/gtest/internal/gtest-port.h
index 0c360072..0a0cd1d7 100644
--- a/googletest/include/gtest/internal/gtest-port.h
+++ b/googletest/include/gtest/internal/gtest-port.h
@@ -642,6 +642,9 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
# if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR)
// STLport, provided with the Android NDK, has neither <tr1/tuple> or <tuple>.
# define GTEST_HAS_TR1_TUPLE 0
+# elif defined(_MSC_VER) && (_MSC_VER >= 1910)
+// Prevent `warning C4996: 'std::tr1': warning STL4002: The non-Standard std::tr1 namespace and TR1-only machinery are deprecated and will be REMOVED.`
+# define GTEST_HAS_TR1_TUPLE 0
# else
// The user didn't tell us not to do it, so we assume it's OK.
# define GTEST_HAS_TR1_TUPLE 1