diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | configure.in | 2 | ||||
-rw-r--r-- | libguile/ChangeLog | 8 | ||||
-rw-r--r-- | libguile/numbers.h | 7 | ||||
-rw-r--r-- | libguile/posix.c | 14 |
5 files changed, 31 insertions, 4 deletions
@@ -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 diff --git a/configure.in b/configure.in index 36298aeac..323322a07 100644 --- a/configure.in +++ b/configure.in @@ -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) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 0fa3a937f..8335d136b 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -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. diff --git a/libguile/numbers.h b/libguile/numbers.h index c896d3e7a..8540d3585 100644 --- a/libguile/numbers.h +++ b/libguile/numbers.h @@ -88,7 +88,12 @@ #if SCM_HAVE_STDC_HEADERS # ifndef GO32 -# include <float.h> +# include <float.h> +# ifdef __MINGW32__ +# define copysign _copysign +# define isnan _isnan +# define finite _finite +# endif /* __MINGW32__ */ # endif /* ndef GO32 */ #endif /* def STDC_HEADERS */ diff --git a/libguile/posix.c b/libguile/posix.c index 2269bc365..4ae59a746 100644 --- a/libguile/posix.c +++ b/libguile/posix.c @@ -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); |