From 301a7fa52593213c354d992d2858e8ce136f3f36 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Fri, 28 Feb 2014 17:37:52 -0800 Subject: [PATCH] Fixing up gtest to work with scons (better!) --- lib/gtest/gtest-death-test.cc | 2 +- lib/gtest/gtest-port.cc | 2 +- lib/gtest/gtest-test-part.cc | 2 +- lib/gtest/gtest.cc | 7 ++++++- lib/gtest/include/gtest/internal/gtest-port.h | 5 +++++ 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/lib/gtest/gtest-death-test.cc b/lib/gtest/gtest-death-test.cc index a6023fc..8a33e8c 100644 --- a/lib/gtest/gtest-death-test.cc +++ b/lib/gtest/gtest-death-test.cc @@ -72,7 +72,7 @@ // prevent a user from accidentally including gtest-internal-inl.h in // his code. #define GTEST_IMPLEMENTATION_ 1 -#include "src/gtest-internal-inl.h" +#include "gtest-internal-inl.h" #undef GTEST_IMPLEMENTATION_ namespace testing { diff --git a/lib/gtest/gtest-port.cc b/lib/gtest/gtest-port.cc index 0c4df5f..2de9d4f 100644 --- a/lib/gtest/gtest-port.cc +++ b/lib/gtest/gtest-port.cc @@ -67,7 +67,7 @@ // prevent a user from accidentally including gtest-internal-inl.h in // his code. #define GTEST_IMPLEMENTATION_ 1 -#include "src/gtest-internal-inl.h" +#include "gtest-internal-inl.h" #undef GTEST_IMPLEMENTATION_ namespace testing { diff --git a/lib/gtest/gtest-test-part.cc b/lib/gtest/gtest-test-part.cc index c60eef3..25c9064 100644 --- a/lib/gtest/gtest-test-part.cc +++ b/lib/gtest/gtest-test-part.cc @@ -39,7 +39,7 @@ // prevent a user from accidentally including gtest-internal-inl.h in // his code. #define GTEST_IMPLEMENTATION_ 1 -#include "src/gtest-internal-inl.h" +#include "gtest-internal-inl.h" #undef GTEST_IMPLEMENTATION_ namespace testing { diff --git a/lib/gtest/gtest.cc b/lib/gtest/gtest.cc index 6de53dd..1deda1e 100644 --- a/lib/gtest/gtest.cc +++ b/lib/gtest/gtest.cc @@ -132,7 +132,7 @@ // prevent a user from accidentally including gtest-internal-inl.h in // his code. #define GTEST_IMPLEMENTATION_ 1 -#include "src/gtest-internal-inl.h" +#include "gtest-internal-inl.h" #undef GTEST_IMPLEMENTATION_ #if GTEST_OS_WINDOWS @@ -366,9 +366,14 @@ void AssertHelper::operator=(const Message& message) const { ); // NOLINT } +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wmissing-field-initializers" + // Mutex for linked pointers. GTEST_API_ GTEST_DEFINE_STATIC_MUTEX_(g_linked_ptr_mutex); +#pragma clang diagnostic pop + // Application pathname gotten in InitGoogleTest. std::string g_executable_path; diff --git a/lib/gtest/include/gtest/internal/gtest-port.h b/lib/gtest/include/gtest/internal/gtest-port.h index dc4fe0c..76c1861 100644 --- a/lib/gtest/include/gtest/internal/gtest-port.h +++ b/lib/gtest/include/gtest/internal/gtest-port.h @@ -1380,6 +1380,9 @@ class MutexBase { # define GTEST_DECLARE_STATIC_MUTEX_(mutex) \ extern ::testing::internal::MutexBase mutex +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wmissing-field-initializers" + // 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 @@ -1389,6 +1392,8 @@ class MutexBase { # define GTEST_DEFINE_STATIC_MUTEX_(mutex) \ ::testing::internal::MutexBase mutex = { PTHREAD_MUTEX_INITIALIZER, false } +#pragma clang diagnostic pop + // The Mutex class can only be used for mutexes created at runtime. It // shares its API with MutexBase otherwise. class Mutex : public MutexBase {