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.
This commit is contained in:
Ted Mielczarek 2016-01-15 09:58:59 -05:00
parent 855c071fc5
commit 937b5e024d
3 changed files with 8 additions and 4 deletions

View File

@ -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))

View File

@ -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

View File

@ -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