summaryrefslogtreecommitdiffstats
path: root/generic/tclEnv.c
diff options
context:
space:
mode:
authornijtmans <nijtmans>2009-12-21 23:25:39 (GMT)
committernijtmans <nijtmans>2009-12-21 23:25:39 (GMT)
commitf7e02c57c848c495a77975b927a0f4076bf4822c (patch)
tree86d9a8cc06d969564b99b6d5ed25975042f9300a /generic/tclEnv.c
parente3f5e21f00d98dacf701c346899ada0ef3327513 (diff)
downloadtcl-f7e02c57c848c495a77975b927a0f4076bf4822c.zip
tcl-f7e02c57c848c495a77975b927a0f4076bf4822c.tar.gz
tcl-f7e02c57c848c495a77975b927a0f4076bf4822c.tar.bz2
Various CYGWIN-related fixes. In the win32 configure script, CYGWIN is still not enabled yet, but at least it is a step in the right direction.
Diffstat (limited to 'generic/tclEnv.c')
-rw-r--r--generic/tclEnv.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/generic/tclEnv.c b/generic/tclEnv.c
index ac47ee9..40650de 100644
--- a/generic/tclEnv.c
+++ b/generic/tclEnv.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclEnv.c,v 1.39 2009/01/04 22:55:12 ferrieux Exp $
+ * RCS: @(#) $Id: tclEnv.c,v 1.40 2009/12/21 23:25:40 nijtmans Exp $
*/
#include "tclInt.h"
@@ -45,8 +45,13 @@ static char * EnvTraceProc(ClientData clientData, Tcl_Interp *interp,
static void ReplaceString(const char *oldStr, char *newStr);
MODULE_SCOPE void TclSetEnv(const char *name, const char *value);
MODULE_SCOPE void TclUnsetEnv(const char *name);
-#if defined(__CYGWIN__) && defined(__WIN32__)
-static void TclCygwinPutenv(const char *string);
+
+#if defined(__CYGWIN__)
+/* On Cygwin, the environment is imported from the Cygwin DLL. */
+ DLLIMPORT extern int cygwin_posix_to_win32_path_list_buf_size(char *value);
+ DLLIMPORT extern void cygwin_posix_to_win32_path_list(char *buf, char *value);
+# define putenv TclCygwinPutenv
+static void TclCygwinPutenv(char *string);
#endif
/*
@@ -394,7 +399,7 @@ TclUnsetEnv(
* that no = should be included, and Windows requires it.
*/
-#ifdef WIN32
+#if defined(__WIN32__) || defined(__CYGWIN__)
string = ckalloc((unsigned) length+2);
memcpy(string, name, (size_t) length);
string[length] = '=';
@@ -688,7 +693,7 @@ TclFinalizeEnvironment(void)
}
}
-#if defined(__CYGWIN__) && defined(__WIN32__)
+#if defined(__CYGWIN__)
#include <windows.h>
@@ -701,7 +706,7 @@ TclFinalizeEnvironment(void)
static void
TclCygwinPutenv(
- const char *str)
+ char *str)
{
char *name, *value;
@@ -780,7 +785,7 @@ TclCygwinPutenv(
SetEnvironmentVariable(name, buf);
}
}
-#endif /* __CYGWIN__ && __WIN32__ */
+#endif /* __CYGWIN__ */
/*
* Local Variables: