Fixes unused function warning on Mac, and fixes compatibility with newer GCC.


git-svn-id: http://googletest.googlecode.com/svn/trunk@643 861a406c-534a-0410-8894-cb66d6ee9925
diff --git a/include/gtest/internal/gtest-port.h b/include/gtest/internal/gtest-port.h
index f78994a..dc4fe0c 100644
--- a/include/gtest/internal/gtest-port.h
+++ b/include/gtest/internal/gtest-port.h
@@ -813,8 +813,8 @@
 };
 
 #define GTEST_COMPILE_ASSERT_(expr, msg) \
-  typedef ::testing::internal::CompileAssert<(bool(expr))> \
-      msg[bool(expr) ? 1 : -1]
+  typedef ::testing::internal::CompileAssert<(static_cast<bool>(expr))> \
+      msg[static_cast<bool>(expr) ? 1 : -1] GTEST_ATTRIBUTE_UNUSED_
 
 // Implementation details of GTEST_COMPILE_ASSERT_:
 //
diff --git a/src/gtest.cc b/src/gtest.cc
index 8e6db0c..62b6929 100644
--- a/src/gtest.cc
+++ b/src/gtest.cc
@@ -3571,13 +3571,13 @@
 // assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc) eventually call
 // this to report their results.  The user code should use the
 // assertion macros instead of calling this directly.
+GTEST_LOCK_EXCLUDED_(mutex_)
 void UnitTest::AddTestPartResult(
     TestPartResult::Type result_type,
     const char* file_name,
     int line_number,
     const std::string& message,
-    const std::string& os_stack_trace)
-        GTEST_LOCK_EXCLUDED_(mutex_) {
+    const std::string& os_stack_trace) {
   Message msg;
   msg << message;
 
diff --git a/test/gtest-death-test_test.cc b/test/gtest-death-test_test.cc
index e42c013..e857bc8 100644
--- a/test/gtest-death-test_test.cc
+++ b/test/gtest-death-test_test.cc
@@ -465,6 +465,8 @@
   EXPECT_DEATH(_exit(1), "");
 }
 
+# if GTEST_HAS_CLONE && GTEST_HAS_PTHREAD
+
 namespace {
 
 bool pthread_flag;
@@ -475,8 +477,6 @@
 
 }  // namespace
 
-# if GTEST_HAS_CLONE && GTEST_HAS_PTHREAD
-
 TEST_F(TestForDeathTest, DoesNotExecuteAtforkHooks) {
   if (!testing::GTEST_FLAG(death_test_use_fork)) {
     testing::GTEST_FLAG(death_test_style) = "threadsafe";