1Mozilla changes to upstream googletest. 2 3diff --git a/gtest/include/gtest/internal/gtest-port.h b/gtest/include/gtest/internal/gtest-port.h 4--- a/gtest/include/gtest/internal/gtest-port.h 5+++ b/gtest/include/gtest/internal/gtest-port.h 6@@ -982,8 +982,9 @@ typedef struct _RTL_CRITICAL_SECTION GTE 7 // are guarded by #ifndef to give embedders a chance to define GTEST_API_ in 8 // gtest/internal/custom/gtest-port.h 9 #ifndef GTEST_API_ 10 11+/* 12 #ifdef _MSC_VER 13 # if GTEST_LINKED_AS_SHARED_LIBRARY 14 # define GTEST_API_ __declspec(dllimport) 15 # elif GTEST_CREATE_SHARED_LIBRARY 16@@ -991,8 +992,9 @@ typedef struct _RTL_CRITICAL_SECTION GTE 17 # endif 18 #elif __GNUC__ >= 4 || defined(__clang__) 19 # define GTEST_API_ __attribute__((visibility ("default"))) 20 #endif // _MSC_VER 21+*/ 22 23 #endif // GTEST_API_ 24 25 #ifndef GTEST_API_ 26diff --git a/gtest/src/gtest-death-test.cc b/gtest/src/gtest-death-test.cc 27--- a/gtest/src/gtest-death-test.cc 28+++ b/gtest/src/gtest-death-test.cc 29@@ -1161,9 +1161,9 @@ inline char** GetEnviron() { 30 } 31 # else 32 // Some POSIX platforms expect you to declare environ. extern "C" makes 33 // it reside in the global namespace. 34-extern "C" char** environ; 35+extern "C" __attribute__ ((visibility ("default"))) char** environ; 36 inline char** GetEnviron() { return environ; } 37 # endif // GTEST_OS_MAC 38 39 # if !GTEST_OS_QNX 40@@ -1285,9 +1285,9 @@ static pid_t ExecDeathTestSpawnChild(cha 41 const bool use_fork = GTEST_FLAG(death_test_use_fork); 42 43 if (!use_fork) { 44 static const bool stack_grows_down = StackGrowsDown(); 45- const size_t stack_size = getpagesize(); 46+ const size_t stack_size = getpagesize() * 2; 47 // MMAP_ANONYMOUS is not defined on Mac, so we use MAP_ANON instead. 48 void* const stack = mmap(NULL, stack_size, PROT_READ | PROT_WRITE, 49 MAP_ANON | MAP_PRIVATE, -1, 0); 50 GTEST_DEATH_TEST_CHECK_(stack != MAP_FAILED); 51diff --git a/gtest/src/gtest.cc b/gtest/src/gtest.cc 52--- a/gtest/src/gtest.cc 53+++ b/gtest/src/gtest.cc 54@@ -33,8 +33,10 @@ 55 #include "gtest/gtest.h" 56 #include "gtest/internal/custom/gtest.h" 57 #include "gtest/gtest-spi.h" 58 59+#include "mozilla/Unused.h" 60+ 61 #include <ctype.h> 62 #include <math.h> 63 #include <stdarg.h> 64 #include <stdio.h> 65@@ -4384,9 +4386,9 @@ class ScopedPrematureExitFile { 66 // create the file with a single "0" character in it. I/O 67 // errors are ignored as there's nothing better we can do and we 68 // don't want to fail the test because of this. 69 FILE* pfile = posix::FOpen(premature_exit_filepath, "w"); 70- fwrite("0", 1, 1, pfile); 71+ mozilla::Unused << fwrite("0", 1, 1, pfile); 72 fclose(pfile); 73 } 74 } 75 76