summaryrefslogtreecommitdiffstats
path: root/googletest
diff options
context:
space:
mode:
authorArkadiy Shapkin <arkady.shapkin@gmail.com>2017-05-03 10:30:11 (GMT)
committerArkady Shapkin <arkady.shapkin@gmail.com>2017-10-25 00:24:49 (GMT)
commit77380cddf77133b98a16b5427ac732648233de29 (patch)
tree5f604f8a0da04feec35e72c662feaacef8dd3d48 /googletest
parent6d0bb75c81bc59770520e303f6a04737b8aedb39 (diff)
downloadgoogletest-77380cddf77133b98a16b5427ac732648233de29.zip
googletest-77380cddf77133b98a16b5427ac732648233de29.tar.gz
googletest-77380cddf77133b98a16b5427ac732648233de29.tar.bz2
Enable C++11 features for VS2015 and VS2017
Diffstat (limited to 'googletest')
-rw-r--r--googletest/include/gtest/internal/gtest-port.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/googletest/include/gtest/internal/gtest-port.h b/googletest/include/gtest/internal/gtest-port.h
index 5529ba5..331483e 100644
--- a/googletest/include/gtest/internal/gtest-port.h
+++ b/googletest/include/gtest/internal/gtest-port.h
@@ -325,7 +325,7 @@
// -std={c,gnu}++{0x,11} is passed. The C++11 standard specifies a
// value for __cplusplus, and recent versions of clang, gcc, and
// probably other compilers set that too in C++11 mode.
-# if __GXX_EXPERIMENTAL_CXX0X__ || __cplusplus >= 201103L
+# if __GXX_EXPERIMENTAL_CXX0X__ || __cplusplus >= 201103L || _MSC_VER >= 1900
// Compiling in at least C++11 mode.
# define GTEST_LANG_CXX11 1
# else
@@ -357,12 +357,16 @@
#if GTEST_STDLIB_CXX11
# define GTEST_HAS_STD_BEGIN_AND_END_ 1
# define GTEST_HAS_STD_FORWARD_LIST_ 1
-# define GTEST_HAS_STD_FUNCTION_ 1
+# if !defined(_MSC_VER) || (_MSC_FULL_VER >= 190023824) // works only with VS2015U2 and better
+# define GTEST_HAS_STD_FUNCTION_ 1
+# endif
# define GTEST_HAS_STD_INITIALIZER_LIST_ 1
# define GTEST_HAS_STD_MOVE_ 1
# define GTEST_HAS_STD_SHARED_PTR_ 1
# define GTEST_HAS_STD_TYPE_TRAITS_ 1
# define GTEST_HAS_STD_UNIQUE_PTR_ 1
+# define GTEST_HAS_UNORDERED_MAP_ 1
+# define GTEST_HAS_UNORDERED_SET_ 1
#endif
// C++11 specifies that <tuple> provides std::tuple.
@@ -660,7 +664,8 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
// support TR1 tuple. libc++ only provides std::tuple, in C++11 mode,
// and it can be used with some compilers that define __GNUC__.
# if (defined(__GNUC__) && !defined(__CUDACC__) && (GTEST_GCC_VER_ >= 40000) \
- && !GTEST_OS_QNX && !defined(_LIBCPP_VERSION)) || _MSC_VER >= 1600
+ && !GTEST_OS_QNX && !defined(_LIBCPP_VERSION)) \
+ || (_MSC_VER >= 1600 && _MSC_VER < 1900)
# define GTEST_ENV_HAS_TR1_TUPLE_ 1
# endif