Bug 1033188 - #include <stdlib.h> for getenv() function declaration. r=glandium

This commit is contained in:
Chris Peterson 2014-07-01 18:49:52 -07:00
parent efdb483353
commit 01fc5ee208
2 changed files with 4 additions and 1 deletions

View File

@ -46,3 +46,5 @@ if CONFIG['MOZ_MEMORY'] and (CONFIG['OS_TARGET'] in ('WINNT', 'Darwin', 'Android
if CONFIG['MOZ_REPLACE_MALLOC'] and CONFIG['OS_TARGET'] == 'Darwin': if CONFIG['MOZ_REPLACE_MALLOC'] and CONFIG['OS_TARGET'] == 'Darwin':
# The zone allocator for OSX needs some jemalloc internal functions # The zone allocator for OSX needs some jemalloc internal functions
LOCAL_INCLUDES += ['/memory/jemalloc/src/include'] LOCAL_INCLUDES += ['/memory/jemalloc/src/include']
FAIL_ON_WARNINGS = True

View File

@ -76,10 +76,11 @@ replace_malloc_init_funcs()
} }
# elif defined(MOZ_WIDGET_ANDROID) # elif defined(MOZ_WIDGET_ANDROID)
# include <dlfcn.h> # include <dlfcn.h>
# include <stdlib.h>
static void static void
replace_malloc_init_funcs() replace_malloc_init_funcs()
{ {
char *replace_malloc_lib = getenv("MOZ_REPLACE_MALLOC_LIB"); const char *replace_malloc_lib = getenv("MOZ_REPLACE_MALLOC_LIB");
if (replace_malloc_lib && *replace_malloc_lib) { if (replace_malloc_lib && *replace_malloc_lib) {
void *handle = dlopen(replace_malloc_lib, RTLD_LAZY); void *handle = dlopen(replace_malloc_lib, RTLD_LAZY);
if (handle) { if (handle) {