aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2009-02-19 00:34:36 +0000
committerzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2009-02-19 00:34:36 +0000
commit3c7868a9a8fab4fd9209bbd2d2f1ae269d063680 (patch)
treea3bc5c1ae1aef8d745c746080762862445532261 /include
parentf0048c1bea4a4c9960a6af345b178eb623494f1f (diff)
downloadgoogletest-3c7868a9a8fab4fd9209bbd2d2f1ae269d063680.tar.gz
googletest-3c7868a9a8fab4fd9209bbd2d2f1ae269d063680.tar.bz2
googletest-3c7868a9a8fab4fd9209bbd2d2f1ae269d063680.zip
Updates the definitions of GTEST_HAS_EXCEPTIONS and GTEST_HAS_STD_STRING to be C++ standard compliant.
Diffstat (limited to 'include')
-rw-r--r--include/gtest/internal/gtest-port.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/include/gtest/internal/gtest-port.h b/include/gtest/internal/gtest-port.h
index 9b8f39f3..c502efac 100644
--- a/include/gtest/internal/gtest-port.h
+++ b/include/gtest/internal/gtest-port.h
@@ -220,7 +220,11 @@
// gcc defines __EXCEPTIONS to 1 iff exceptions are enabled. For
// other compilers, we assume exceptions are disabled to be
// conservative.
-#define GTEST_HAS_EXCEPTIONS (defined(__GNUC__) && __EXCEPTIONS)
+#if defined(__GNUC__) && __EXCEPTIONS
+#define GTEST_HAS_EXCEPTIONS 1
+#else
+#define GTEST_HAS_EXCEPTIONS 0
+#endif // defined(__GNUC__) && __EXCEPTIONS
#endif // _MSC_VER
// Determines whether ::std::string and ::string are available.
@@ -230,8 +234,11 @@
// need to figure it out. The only environment that we know
// ::std::string is not available is MSVC 7.1 or lower with exceptions
// disabled.
-#define GTEST_HAS_STD_STRING \
- (!(defined(_MSC_VER) && (_MSC_VER < 1400) && !GTEST_HAS_EXCEPTIONS))
+#if defined(_MSC_VER) && (_MSC_VER < 1400) && !GTEST_HAS_EXCEPTIONS
+#define GTEST_HAS_STD_STRING 0
+#else
+#define GTEST_HAS_STD_STRING 1
+#endif
#endif // GTEST_HAS_STD_STRING
#ifndef GTEST_HAS_GLOBAL_STRING