mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-23 13:00:34 +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
|
@ -159,6 +159,10 @@ extern char ** environ;
|
||||||
# include <sys/file.h>
|
# include <sys/file.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if HAVE_CRT_EXTERNS_H
|
||||||
|
#include <crt_externs.h> /* for Darwin _NSGetEnviron */
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Some Unix systems don't define these. CPP hair is dangerous, but
|
/* Some Unix systems don't define these. CPP hair is dangerous, but
|
||||||
this seems safe enough... */
|
this seems safe enough... */
|
||||||
#ifndef R_OK
|
#ifndef R_OK
|
||||||
|
@ -196,6 +200,13 @@ extern char ** environ;
|
||||||
above means that _POSIX_SOURCE may be #defined, which will
|
above means that _POSIX_SOURCE may be #defined, which will
|
||||||
encourage header files to do strange things. */
|
encourage header files to do strange things. */
|
||||||
|
|
||||||
|
/* 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
|
||||||
|
|
||||||
|
|
||||||
SCM_SYMBOL (sym_read_pipe, "read pipe");
|
SCM_SYMBOL (sym_read_pipe, "read pipe");
|
||||||
SCM_SYMBOL (sym_write_pipe, "write pipe");
|
SCM_SYMBOL (sym_write_pipe, "write pipe");
|
||||||
|
|
|
@ -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
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -73,12 +73,23 @@ char *malloc ();
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if HAVE_CRT_EXTERNS_H
|
||||||
|
#include <crt_externs.h> /* for Darwin _NSGetEnviron */
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef NULL
|
#ifndef NULL
|
||||||
#define NULL 0
|
#define NULL 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern char **environ;
|
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. */
|
/* Put STRING, which is of the form "NAME=VALUE", in the environment. */
|
||||||
int
|
int
|
||||||
putenv (const char *string)
|
putenv (const char *string)
|
||||||
|
|
|
@ -87,6 +87,10 @@
|
||||||
# include <sys/timeb.h>
|
# include <sys/timeb.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if HAVE_CRT_EXTERNS_H
|
||||||
|
#include <crt_externs.h> /* for Darwin _NSGetEnviron */
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef tzname /* For SGI. */
|
#ifndef tzname /* For SGI. */
|
||||||
extern char *tzname[]; /* RS6000 and others reject char **tzname. */
|
extern char *tzname[]; /* RS6000 and others reject char **tzname. */
|
||||||
#endif
|
#endif
|
||||||
|
@ -112,6 +116,15 @@ extern char *strptime ();
|
||||||
# define timet long
|
# define timet long
|
||||||
#endif
|
#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
|
||||||
|
|
||||||
#ifdef HAVE_TIMES
|
#ifdef HAVE_TIMES
|
||||||
static
|
static
|
||||||
timet mytime()
|
timet mytime()
|
||||||
|
@ -294,7 +307,6 @@ filltime (struct tm *bd_time, int zoff, char *zname)
|
||||||
}
|
}
|
||||||
|
|
||||||
static char tzvar[3] = "TZ";
|
static char tzvar[3] = "TZ";
|
||||||
extern char ** environ;
|
|
||||||
|
|
||||||
/* if zone is set, create a temporary environment with only a TZ
|
/* if zone is set, create a temporary environment with only a TZ
|
||||||
string. other threads or interrupt handlers shouldn't be allowed
|
string. other threads or interrupt handlers shouldn't be allowed
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue