mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-24 12:20:20 +02:00
(environ): Use _NSGetEnviron in Darwin shared library, since environ
is not directly available there.
This commit is contained in:
parent
13aa46a9de
commit
3c14f331d6
3 changed files with 36 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 1991, 2000, 2001 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991, 2000, 2001, 2004 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -73,12 +73,23 @@ char *malloc ();
|
|||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_CRT_EXTERNS_H
|
||||
#include <crt_externs.h> /* for Darwin _NSGetEnviron */
|
||||
#endif
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
extern char **environ;
|
||||
|
||||
/* On Apple Darwin in a shared library there's no "environ" to access
|
||||
directly, instead the address of that variable must be obtained with
|
||||
_NSGetEnviron(). */
|
||||
#if HAVE__NSGETENVIRON && defined (PIC)
|
||||
#define environ (*_NSGetEnviron())
|
||||
#endif
|
||||
|
||||
/* Put STRING, which is of the form "NAME=VALUE", in the environment. */
|
||||
int
|
||||
putenv (const char *string)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue