Fix PR63758 by using the _NSGetEnviron() API on Darwin

include/

	Roland McGrath  <roland@gnu.org>

	PR other/63758
	* environ.h: New file.

libiberty/

	Roland McGrath  <roland@gnu.org>
	Iain Sandoe  <iain@codesourcery.com>

	PR other/63758
	* pex-unix.c: Obtain the environment interface from settings in environ.h
	rather than in-line code.  Update copyright date.
	* setenv.c: Likewise.
	* xmalloc.c: Likewise.




git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@228942 138bc75d-0d04-0410-961f-82ee72b054a4
This commit is contained in:
Iain Sandoe
2015-11-28 16:39:30 +00:00
committed by Pedro Alves
parent e9a3881624
commit 35a88fa501
6 changed files with 55 additions and 12 deletions

View File

@ -1,5 +1,6 @@
/* memory allocation routines with error checking.
Copyright 1989, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
Copyright 1989, 1990, 1991, 1992, 1993, 1994, 2015
Free Software Foundation, Inc.
This file is part of the libiberty library.
Libiberty is free software; you can redistribute it and/or
@ -65,6 +66,7 @@ function will be called to print an error message and terminate execution.
#endif
#include "ansidecl.h"
#include "libiberty.h"
#include "environ.h"
#include <stdio.h>
@ -117,7 +119,6 @@ void
xmalloc_failed (size_t size)
{
#ifdef HAVE_SBRK
extern char **environ;
size_t allocated;
if (first_break != NULL)