aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGennadiy Civil <gennadiycivil@users.noreply.github.com>2018-04-03 11:44:23 -0400
committerGitHub <noreply@github.com>2018-04-03 11:44:23 -0400
commit27507429cb1f850ac0695c1c05c3d4e815b67bc0 (patch)
tree7548658bcd9ebb032d61d828e04b9db7f801f062
parentb1d18b85bdb04100249851364b6ea7564745e3ff (diff)
parent6c9d07f1123fcf408b3fb3c2e39ad41593627b36 (diff)
downloadgoogletest-27507429cb1f850ac0695c1c05c3d4e815b67bc0.tar.gz
googletest-27507429cb1f850ac0695c1c05c3d4e815b67bc0.tar.bz2
googletest-27507429cb1f850ac0695c1c05c3d4e815b67bc0.zip
Merge branch 'master' into int3
-rw-r--r--googletest/include/gtest/internal/gtest-port.h32
1 files changed, 22 insertions, 10 deletions
diff --git a/googletest/include/gtest/internal/gtest-port.h b/googletest/include/gtest/internal/gtest-port.h
index e8cc5ae1..f7a8d9dd 100644
--- a/googletest/include/gtest/internal/gtest-port.h
+++ b/googletest/include/gtest/internal/gtest-port.h
@@ -228,10 +228,9 @@
//
// Regular expressions:
// RE - a simple regular expression class using the POSIX
-// Extended Regular Expression syntax on UNIX-like
-// platforms, or a reduced regular exception syntax on
-// other platforms, including Windows.
-//
+// Extended Regular Expression syntax on UNIX-like platforms
+// or a reduced regular exception syntax on other
+// platforms, including Windows.
// Logging:
// GTEST_LOG_() - logs messages at the specified severity level.
// LogToStderr() - directs all log messages to stderr.
@@ -652,7 +651,12 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
// 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.`
+// 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
+# elif GTEST_LANG_CXX11 && defined(_LIBCPP_VERSION)
+// libc++ doesn't support TR1.
# define GTEST_HAS_TR1_TUPLE 0
# else
// The user didn't tell us not to do it, so we assume it's OK.
@@ -663,6 +667,10 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
// Determines whether Google Test's own tr1 tuple implementation
// should be used.
#ifndef GTEST_USE_OWN_TR1_TUPLE
+// We use our own tuple implementation on Symbian.
+# if GTEST_OS_SYMBIAN
+# define GTEST_USE_OWN_TR1_TUPLE 1
+# else
// The user didn't tell us, so we need to figure it out.
// We use our own TR1 tuple if we aren't sure the user has an
@@ -693,12 +701,11 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
# else
# define GTEST_USE_OWN_TR1_TUPLE 1
# endif
-
+# endif // GTEST_OS_SYMBIAN
#endif // GTEST_USE_OWN_TR1_TUPLE
-// To avoid conditional compilation everywhere, we make it
-// gtest-port.h's responsibility to #include the header implementing
-// tuple.
+// To avoid conditional compilation we make it gtest-port.h's responsibility
+// to #include the header implementing tuple.
#if GTEST_HAS_STD_TUPLE_
# include <tuple> // IWYU pragma: export
# define GTEST_TUPLE_NAMESPACE_ ::std
@@ -2093,8 +2100,13 @@ class MutexBase {
extern ::testing::internal::MutexBase mutex
// Defines and statically (i.e. at link time) initializes a static mutex.
+// The initialization list here does not explicitly initialize each field,
+// instead relying on default initialization for the unspecified fields. In
+// particular, the owner_ field (a pthread_t) is not explicitly initialized.
+// This allows initialization to work whether pthread_t is a scalar or struct.
+// The flag -Wmissing-field-initializers must not be specified for this to work.
# define GTEST_DEFINE_STATIC_MUTEX_(mutex) \
- ::testing::internal::MutexBase mutex = { PTHREAD_MUTEX_INITIALIZER, false, pthread_t() }
+ ::testing::internal::MutexBase mutex = { PTHREAD_MUTEX_INITIALIZER, false }
// The Mutex class can only be used for mutexes created at runtime. It
// shares its API with MutexBase otherwise.