From a2a15f2cefcfceaa6cee5b674a9b447359268ee9 Mon Sep 17 00:00:00 2001 From: David Schuldenfrei Date: Thu, 6 Sep 2018 17:06:11 +0300 Subject: [PATCH 1/2] Fix Compile error, and warning in Visaul Studio 2013 --- googlemock/include/gmock/gmock-matchers.h | 8 +++++++- googletest/include/gtest/gtest-printers.h | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/googlemock/include/gmock/gmock-matchers.h b/googlemock/include/gmock/gmock-matchers.h index a7bcfc83..41d72529 100644 --- a/googlemock/include/gmock/gmock-matchers.h +++ b/googlemock/include/gmock/gmock-matchers.h @@ -56,11 +56,17 @@ # include // NOLINT -- must be after gtest.h #endif +#if _MSC_VER >= 1900 GTEST_DISABLE_MSC_WARNINGS_PUSH_( 4251 5046 /* class A needs to have dll-interface to be used by clients of class B */ /* Symbol involving type with internal linkage not defined */) - +#else //Pragma 5046 doesn't exist in version of MSC prior to 1900 +GTEST_DISABLE_MSC_WARNINGS_PUSH_( + 4251 /* class A needs to have dll-interface to be used by clients of + class B */ + /* Symbol involving type with internal linkage not defined */) +#endif namespace testing { // To implement a matcher Foo for type T, define: diff --git a/googletest/include/gtest/gtest-printers.h b/googletest/include/gtest/gtest-printers.h index 51865f84..3fddf835 100644 --- a/googletest/include/gtest/gtest-printers.h +++ b/googletest/include/gtest/gtest-printers.h @@ -983,7 +983,7 @@ struct TuplePolicy { template static typename AddReference(I), Tuple>::type>::type + I, Tuple>::type>::type get(const Tuple& tuple) { return ::std::tr1::get(tuple); } From e1d41f3f9f3d8c1b6987ce849120677c380e7f87 Mon Sep 17 00:00:00 2001 From: David Schuldenfrei Date: Wed, 12 Sep 2018 10:43:50 +0300 Subject: [PATCH 2/2] Gennadiy's comment. Reverts to previous code if not using Visual Studio 2013 --- googletest/include/gtest/gtest-printers.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/googletest/include/gtest/gtest-printers.h b/googletest/include/gtest/gtest-printers.h index 3fddf835..71f2aaec 100644 --- a/googletest/include/gtest/gtest-printers.h +++ b/googletest/include/gtest/gtest-printers.h @@ -983,7 +983,11 @@ struct TuplePolicy { template static typename AddReference::type>::type +#else + static_cast(I), Tuple>::type>::type +#endif get(const Tuple& tuple) { return ::std::tr1::get(tuple); }