summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Mielczarek <ted@mielczarek.org>2016-01-15 09:58:59 -0500
committerTed Mielczarek <ted@mielczarek.org>2016-01-15 09:58:59 -0500
commit114ef8ab0c411f0d742ec275e10c0c0d724e9ff3 (patch)
tree02578069d03a9ff7d3a720e2b6bdd9d11115227f
parentb4c6a2bbff4c2be4e275ef2a9cf29e03dce9b970 (diff)
downloadnspr-hg-114ef8ab0c411f0d742ec275e10c0c0d724e9ff3.tar.gz
bug 1237869 - Tweak NSPR to build with Mozilla's build system. r=glandium
Fixes three issues that occur when building using Mozilla's build system instead of NSPR's build system: 1) The top-level configure defines WIN32_LEAN_AND_MEAN which makes a Windows header not get included for ntinrval.c. 2) Visibility issue with __mmap2 on Android in unix.c. 3) Visibility issue with __asan_{poison,unpoison}_memory in plarena.h.
-rw-r--r--lib/ds/plarena.h6
-rw-r--r--pr/src/md/unix/unix.c2
-rw-r--r--pr/src/md/windows/ntinrval.c4
3 files changed, 8 insertions, 4 deletions
diff --git a/lib/ds/plarena.h b/lib/ds/plarena.h
index 4daafa8c..2673a2ae 100644
--- a/lib/ds/plarena.h
+++ b/lib/ds/plarena.h
@@ -96,11 +96,11 @@ struct PLArenaPool {
/* These definitions are usually provided through the
* sanitizer/asan_interface.h header installed by ASan.
- * See https://code.google.com/p/address-sanitizer/wiki/ManualPoisoning
+ * See https://github.com/google/sanitizers/wiki/AddressSanitizerManualPoisoning
*/
-void __asan_poison_memory_region(void const volatile *addr, size_t size);
-void __asan_unpoison_memory_region(void const volatile *addr, size_t size);
+PR_IMPORT(void) __asan_poison_memory_region(void const volatile *addr, size_t size);
+PR_IMPORT(void) __asan_unpoison_memory_region(void const volatile *addr, size_t size);
#define PL_MAKE_MEM_NOACCESS(addr, size) \
__asan_poison_memory_region((addr), (size))
diff --git a/pr/src/md/unix/unix.c b/pr/src/md/unix/unix.c
index 4f27b82f..7405053f 100644
--- a/pr/src/md/unix/unix.c
+++ b/pr/src/md/unix/unix.c
@@ -2715,7 +2715,7 @@ static void* _MD_Unix_mmap64(
/* Android <= 19 doesn't have mmap64. */
#if defined(ANDROID) && __ANDROID_API__ <= 19
-extern void *__mmap2(void *, size_t, int, int, int, size_t);
+PR_IMPORT(void) *__mmap2(void *, size_t, int, int, int, size_t);
#define ANDROID_PAGE_SIZE 4096
diff --git a/pr/src/md/windows/ntinrval.c b/pr/src/md/windows/ntinrval.c
index dab9e3fe..10aca11b 100644
--- a/pr/src/md/windows/ntinrval.c
+++ b/pr/src/md/windows/ntinrval.c
@@ -8,6 +8,10 @@
*
*/
+/* Mozilla's build system defines this globally. */
+#ifdef WIN32_LEAN_AND_MEAN
+#undef WIN32_LEAN_AND_MEAN
+#endif
#include "primpl.h"
#ifdef WINCE