~ chicken-core (chicken-5) 5e69e49bdadcdfe92877fa98379f9d1ae222b637


commit 5e69e49bdadcdfe92877fa98379f9d1ae222b637
Author:     Peter Bex <peter.bex@xs4all.nl>
AuthorDate: Thu Feb 20 22:07:01 2014 +0100
Commit:     Mario Domenech Goulart <mario.goulart@gmail.com>
CommitDate: Thu Feb 20 19:51:56 2014 -0300

    Fix unsetenv() on Solaris, and start an effort to get rid of the strange "GNU_ENV" definition
    
    Signed-off-by: Mario Domenech Goulart <mario.goulart@gmail.com>

diff --git a/Makefile.aix b/Makefile.aix
index 724bca65..77667347 100644
--- a/Makefile.aix
+++ b/Makefile.aix
@@ -90,6 +90,7 @@ chicken-config.h: chicken-defaults.h
 	echo "#define HAVE_STRTOQ 0" >>$@
 	echo "#define HAVE_SYS_STAT_H 1" >>$@
 	echo "#define HAVE_SYS_TYPES_H 1" >>$@
+	echo "#define HAVE_SETENV 1" >>$@
 	echo "#define HAVE_UNISTD_H 1" >>$@
 	echo "#define HAVE_UNSIGNED_LONG_LONG 1" >>$@
 	echo "#define STDC_HEADERS 1" >>$@
diff --git a/Makefile.bsd b/Makefile.bsd
index 4dd003fa..9006d861 100644
--- a/Makefile.bsd
+++ b/Makefile.bsd
@@ -92,6 +92,7 @@ chicken-config.h: chicken-defaults.h
 	echo "#define HAVE_STRTOQ 1" >>$@
 	echo "#define HAVE_SYS_STAT_H 1" >>$@
 	echo "#define HAVE_SYS_TYPES_H 1" >>$@
+	echo "#define HAVE_SETENV 1" >>$@
 	echo "#define HAVE_UNISTD_H 1" >>$@
 	echo "#define HAVE_UNSIGNED_LONG_LONG 1" >>$@
 	echo "#define STDC_HEADERS 1" >>$@
diff --git a/Makefile.haiku b/Makefile.haiku
index 58c2c727..749fbc36 100644
--- a/Makefile.haiku
+++ b/Makefile.haiku
@@ -84,6 +84,7 @@ chicken-config.h: chicken-defaults.h
 	echo "#define HAVE_STRTOQ 1" >>$@
 	echo "#define HAVE_SYS_STAT_H 1" >>$@
 	echo "#define HAVE_SYS_TYPES_H 1" >>$@
+	echo "#define HAVE_SETENV 1" >>$@
 	echo "#define HAVE_UNISTD_H 1" >>$@
 	echo "#define HAVE_UNSIGNED_LONG_LONG 1" >>$@
 	echo "#define STDC_HEADERS 1" >>$@
diff --git a/Makefile.hurd b/Makefile.hurd
index 59dad053..cbb0176d 100644
--- a/Makefile.hurd
+++ b/Makefile.hurd
@@ -85,6 +85,7 @@ chicken-config.h: chicken-defaults.h
 	echo "#define HAVE_STRTOQ 1" >>$@
 	echo "#define HAVE_SYS_STAT_H 1" >>$@
 	echo "#define HAVE_SYS_TYPES_H 1" >>$@
+	echo "#define HAVE_SETENV 1" >>$@
 	echo "#define HAVE_UNISTD_H 1" >>$@
 	echo "#define HAVE_UNSIGNED_LONG_LONG 1" >>$@
 	echo "#define STDC_HEADERS 1" >>$@
diff --git a/Makefile.linux b/Makefile.linux
index 36d5c369..ee8161eb 100644
--- a/Makefile.linux
+++ b/Makefile.linux
@@ -85,6 +85,7 @@ chicken-config.h: chicken-defaults.h
 	echo "#define HAVE_STRTOQ 1" >>$@
 	echo "#define HAVE_SYS_STAT_H 1" >>$@
 	echo "#define HAVE_SYS_TYPES_H 1" >>$@
+	echo "#define HAVE_SETENV 1" >>$@
 	echo "#define HAVE_UNISTD_H 1" >>$@
 	echo "#define HAVE_UNSIGNED_LONG_LONG 1" >>$@
 	echo "#define STDC_HEADERS 1" >>$@
diff --git a/Makefile.macosx b/Makefile.macosx
index 1a29aefd..d0134905 100644
--- a/Makefile.macosx
+++ b/Makefile.macosx
@@ -115,6 +115,7 @@ chicken-config.h: chicken-defaults.h
 	echo "#define HAVE_STRTOQ 1" >>$@
 	echo "#define HAVE_SYS_STAT_H 1" >>$@
 	echo "#define HAVE_SYS_TYPES_H 1" >>$@
+	echo "#define HAVE_SETENV 1" >>$@
 	echo "#define HAVE_UNISTD_H 1" >>$@
 	echo "#define HAVE_UNSIGNED_LONG_LONG 1" >>$@
 	echo "#define STDC_HEADERS 1" >>$@
diff --git a/Makefile.solaris b/Makefile.solaris
index 75b60b29..9ce111e9 100644
--- a/Makefile.solaris
+++ b/Makefile.solaris
@@ -115,6 +115,7 @@ chicken-config.h: chicken-defaults.h
 	echo "#define HAVE_STRTOLL 1" >>$@
 	echo "#define HAVE_SYS_STAT_H 1" >>$@
 	echo "#define HAVE_SYS_TYPES_H 1" >>$@
+	echo "#define HAVE_SETENV 1" >>$@
 	echo "#define HAVE_UNISTD_H 1" >>$@
 	echo "#define HAVE_UNSIGNED_LONG_LONG 1" >>$@
 	echo "#define STDC_HEADERS 1" >>$@
diff --git a/posix-common.scm b/posix-common.scm
index 93884def..0a04ccc2 100644
--- a/posix-common.scm
+++ b/posix-common.scm
@@ -96,7 +96,7 @@ static char C_time_string [TIME_STRING_MAXLENGTH + 1];
 #define C_readdir(h,e)      C_set_block_item(e, 0, (C_word) readdir((DIR *)C_block_item(h, 0)))
 #define C_foundfile(e,b,l)    (C_strlcpy(C_c_string(b), ((struct dirent *) C_block_item(e, 0))->d_name, l), C_fix(strlen(((struct dirent *) C_block_item(e, 0))->d_name)))
 
-#ifdef C_GNU_ENV
+#ifdef HAVE_SETENV
 # define C_unsetenv(s)      (unsetenv((char *)C_data_pointer(s)), C_SCHEME_TRUE)
 # define C_setenv(x, y)     C_fix(setenv((char *)C_data_pointer(x), (char *)C_data_pointer(y), 1))
 #else
Trap