about summary refs log tree commit diff
path: root/absl/base/config.h
diff options
context:
space:
mode:
authorGennadiy Civil <gennadiycivil@users.noreply.github.com>2017-10-30T14·56-0400
committerGitHub <noreply@github.com>2017-10-30T14·56-0400
commit200b5a7cb0fb256ab47c933b3150aed91d9d3470 (patch)
tree300713d880c593eb36cc6cea4bc8d1073bb03112 /absl/base/config.h
parentd5134a7f11e32d11caa67e75ae2ae2e506fb54ba (diff)
parent0fece732a21c5ae8fef5fa8b3f0b8487bca68d83 (diff)
Merge branch 'master' into master
Diffstat (limited to 'absl/base/config.h')
-rw-r--r--absl/base/config.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/absl/base/config.h b/absl/base/config.h
index 5f0dd04c8e66..495811bd88c3 100644
--- a/absl/base/config.h
+++ b/absl/base/config.h
@@ -372,4 +372,19 @@
 #endif
 #endif
 
+// For MSVC, `__has_include` is supported in VS 2017 15.3, which is later than
+// the support for <optional>, <any>, <string_view>. So we use _MSC_VER to check
+// whether we have VS 2017 RTM (when <optional>, <any>, <string_view> is
+// implemented) or higher.
+// Also, `__cplusplus` is not correctly set by MSVC, so we use `_MSVC_LANG` to
+// check the language version.
+// TODO(zhangxy): fix tests before enabling aliasing for `std::any`,
+// `std::string_view`.
+#if defined(_MSC_VER) && _MSC_VER >= 1910 && \
+    ((defined(_MSVC_LANG) && _MSVC_LANG > 201402) || __cplusplus > 201402)
+// #define ABSL_HAVE_STD_ANY 1
+#define ABSL_HAVE_STD_OPTIONAL 1
+// #define ABSL_HAVE_STD_STRING_VIEW 1
+#endif
+
 #endif  // ABSL_BASE_CONFIG_H_