mirror of
https://github.com/google/googletest.git
synced 2024-12-29 03:33:40 +08:00
Merge pull request #633 from plopresti/master
Fix missing-field-initializers GCC/Clang warning (issue 433).
This commit is contained in:
commit
ffce1a8578
@ -1969,13 +1969,8 @@ 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 }
|
||||
::testing::internal::MutexBase mutex = { PTHREAD_MUTEX_INITIALIZER, false, pthread_t() }
|
||||
|
||||
// The Mutex class can only be used for mutexes created at runtime. It
|
||||
// shares its API with MutexBase otherwise.
|
||||
|
Loading…
x
Reference in New Issue
Block a user