summaryrefslogtreecommitdiffstats
path: root/testing/gtest/mozilla-changes.diff
blob: 292146b2b33daf73e75babd17aaaec9d99b2c194 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
Mozilla changes to upstream googletest.

diff --git a/gtest/include/gtest/internal/gtest-port.h b/gtest/include/gtest/internal/gtest-port.h
--- a/gtest/include/gtest/internal/gtest-port.h
+++ b/gtest/include/gtest/internal/gtest-port.h
@@ -982,8 +982,9 @@ typedef struct _RTL_CRITICAL_SECTION GTE
 // are guarded by #ifndef to give embedders a chance to define GTEST_API_ in
 // gtest/internal/custom/gtest-port.h
 #ifndef GTEST_API_
 
+/*
 #ifdef _MSC_VER
 # if GTEST_LINKED_AS_SHARED_LIBRARY
 #  define GTEST_API_ __declspec(dllimport)
 # elif GTEST_CREATE_SHARED_LIBRARY
@@ -991,8 +992,9 @@ typedef struct _RTL_CRITICAL_SECTION GTE
 # endif
 #elif __GNUC__ >= 4 || defined(__clang__)
 # define GTEST_API_ __attribute__((visibility ("default")))
 #endif  // _MSC_VER
+*/
 
 #endif  // GTEST_API_
 
 #ifndef GTEST_API_
diff --git a/gtest/src/gtest-death-test.cc b/gtest/src/gtest-death-test.cc
--- a/gtest/src/gtest-death-test.cc
+++ b/gtest/src/gtest-death-test.cc
@@ -1161,9 +1161,9 @@ inline char** GetEnviron() {
 }
 #  else
 // Some POSIX platforms expect you to declare environ. extern "C" makes
 // it reside in the global namespace.
-extern "C" char** environ;
+extern "C" __attribute__ ((visibility ("default"))) char** environ;
 inline char** GetEnviron() { return environ; }
 #  endif  // GTEST_OS_MAC
 
 #  if !GTEST_OS_QNX
@@ -1285,9 +1285,9 @@ static pid_t ExecDeathTestSpawnChild(cha
   const bool use_fork = GTEST_FLAG(death_test_use_fork);
 
   if (!use_fork) {
     static const bool stack_grows_down = StackGrowsDown();
-    const size_t stack_size = getpagesize();
+    const size_t stack_size = getpagesize() * 2;
     // MMAP_ANONYMOUS is not defined on Mac, so we use MAP_ANON instead.
     void* const stack = mmap(NULL, stack_size, PROT_READ | PROT_WRITE,
                              MAP_ANON | MAP_PRIVATE, -1, 0);
     GTEST_DEATH_TEST_CHECK_(stack != MAP_FAILED);
diff --git a/gtest/src/gtest.cc b/gtest/src/gtest.cc
--- a/gtest/src/gtest.cc
+++ b/gtest/src/gtest.cc
@@ -33,8 +33,10 @@
 #include "gtest/gtest.h"
 #include "gtest/internal/custom/gtest.h"
 #include "gtest/gtest-spi.h"
 
+#include "mozilla/Unused.h"
+
 #include <ctype.h>
 #include <math.h>
 #include <stdarg.h>
 #include <stdio.h>
@@ -4384,9 +4386,9 @@ class ScopedPrematureExitFile {
       // create the file with a single "0" character in it.  I/O
       // errors are ignored as there's nothing better we can do and we
       // don't want to fail the test because of this.
       FILE* pfile = posix::FOpen(premature_exit_filepath, "w");
-      fwrite("0", 1, 1, pfile);
+      mozilla::Unused << fwrite("0", 1, 1, pfile);
       fclose(pfile);
     }
   }