1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 19:50:24 +02:00

2003-05-30 Stefan Jahn <stefan@lkcc.org>

* configure.in: Checking for unsetenv().

2003-05-30  Stefan Jahn  <stefan@lkcc.org>

        * posix.c (s_scm_putenv): Use the new HAVE_UNSETENV
        appropriately for mingw32 hosts.

        * numbers.h: Defining copysign(), isnan() and finite() to
        be prefixed by a single '_' for mingw32 hosts.
This commit is contained in:
Stefan Jahn 2003-05-30 09:39:34 +00:00
parent c47e2599cb
commit 1e498fbd0f
5 changed files with 31 additions and 4 deletions

View file

@ -1,3 +1,7 @@
2003-05-30 Stefan Jahn <stefan@lkcc.org>
* configure.in: Checking for unsetenv().
2003-05-29 Stefan Jahn <stefan@lkcc.org>
* configure.in: Removed -lm check and added a cached check for

View file

@ -528,7 +528,7 @@ AC_SUBST(DLPREOPEN)
AC_CHECK_HEADERS([assert.h])
AC_CHECK_FUNCS([ctermid ftime fchown getcwd geteuid gettimeofday lstat mkdir mknod nice readlink rename rmdir select setegid seteuid setlocale setpgid setsid sigaction siginterrupt strftime strptime symlink sync tcgetpgrp tcsetpgrp times uname waitpid strdup system usleep atexit on_exit chown link fcntl ttyname getpwent getgrent kill getppid getpgrp fork setitimer getitimer strchr strcmp index bcopy memcpy rindex])
AC_CHECK_FUNCS([ctermid ftime fchown getcwd geteuid gettimeofday lstat mkdir mknod nice readlink rename rmdir select setegid seteuid setlocale setpgid setsid sigaction siginterrupt strftime strptime symlink sync tcgetpgrp tcsetpgrp times uname waitpid strdup system usleep atexit on_exit chown link fcntl ttyname getpwent getgrent kill getppid getpgrp fork setitimer getitimer strchr strcmp index bcopy memcpy rindex unsetenv])
AC_CHECK_HEADERS(crypt.h sys/resource.h sys/file.h)
AC_CHECK_FUNCS(chroot flock getlogin cuserid getpriority setpriority getpass sethostname gethostname)

View file

@ -1,3 +1,11 @@
2003-05-30 Stefan Jahn <stefan@lkcc.org>
* posix.c (s_scm_putenv): Use the new HAVE_UNSETENV
appropriately for mingw32 hosts.
* numbers.h: Defining copysign(), isnan() and finite() to
be prefixed by a single '_' for mingw32 hosts.
2003-05-30 Kevin Ryde <user42@zip.com.au>
* numbers.c (z_negative_one): New variable.

View file

@ -89,6 +89,11 @@
#if SCM_HAVE_STDC_HEADERS
# ifndef GO32
# include <float.h>
# ifdef __MINGW32__
# define copysign _copysign
# define isnan _isnan
# define finite _finite
# endif /* __MINGW32__ */
# endif /* ndef GO32 */
#endif /* def STDC_HEADERS */

View file

@ -1162,16 +1162,26 @@ SCM_DEFINE (scm_putenv, "putenv", 1, 0, 0,
SCM_VALIDATE_STRING (1, str);
#ifndef __MINGW32__
if (strchr (SCM_STRING_CHARS (str), '=') == NULL)
{
#ifdef HAVE_UNSETENV
/* No '=' in argument means we should remove the variable from
the environment. Not all putenvs understand this. To be
safe, we do it explicitely using unsetenv. */
unsetenv (SCM_STRING_CHARS (str));
#else
/* On e.g. Win32 hosts putenv() called with 'name=' removes the
environment variable 'name'. */
ptr = scm_malloc (SCM_STRING_LENGTH (str) + 2);
strncpy (ptr, SCM_STRING_CHARS (str), SCM_STRING_LENGTH (str));
ptr[SCM_STRING_LENGTH (str)] = '=';
ptr[SCM_STRING_LENGTH (str) + 1] = 0;
rv = putenv (ptr);
if (rv < 0)
SCM_SYSERROR;
#endif
}
else
#endif
{
/* must make a new copy to be left in the environment, safe from gc. */
ptr = scm_malloc (SCM_STRING_LENGTH (str) + 1);