summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-04-05 07:07:10 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-04-05 07:07:10 (GMT)
commit32dda4af9bc7d9e23f8dc6722d26609e4714a470 (patch)
treed60c6429b2047f18a48d24225c79630fdd2010ec /generic
parentcb6044b9fc72e9d050461b42b760f19b44b0680d (diff)
downloadtcl-32dda4af9bc7d9e23f8dc6722d26609e4714a470.zip
tcl-32dda4af9bc7d9e23f8dc6722d26609e4714a470.tar.gz
tcl-32dda4af9bc7d9e23f8dc6722d26609e4714a470.tar.bz2
cygwin should use SetEnvironmentVariable for windows env
Diffstat (limited to 'generic')
-rw-r--r--generic/tclEnv.c23
-rw-r--r--generic/tclPort.h7
2 files changed, 11 insertions, 19 deletions
diff --git a/generic/tclEnv.c b/generic/tclEnv.c
index a516cce..24fa106 100644
--- a/generic/tclEnv.c
+++ b/generic/tclEnv.c
@@ -45,11 +45,8 @@ MODULE_SCOPE void TclSetEnv(const char *name, const char *value);
MODULE_SCOPE void TclUnsetEnv(const char *name);
#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);
+ static void TclCygwinPutenv(char *string);
+# define putenv TclCygwinPutenv
#endif
/*
@@ -753,15 +750,11 @@ TclCygwinPutenv(
*/
if (strcmp(name, "Path") == 0) {
-#ifdef __WIN32__
- SetEnvironmentVariable("PATH", NULL);
-#endif
+ SetEnvironmentVariableA("PATH", NULL);
unsetenv("PATH");
}
-#ifdef __WIN32__
- SetEnvironmentVariable(name, value);
-#endif
+ SetEnvironmentVariableA(name, value);
} else {
char *buf;
@@ -769,9 +762,7 @@ TclCygwinPutenv(
* Eliminate any Path variable, to prevent any confusion.
*/
-#ifdef __WIN32__
- SetEnvironmentVariable("Path", NULL);
-#endif
+ SetEnvironmentVariableA("Path", NULL);
unsetenv("Path");
if (value == NULL) {
@@ -784,9 +775,7 @@ TclCygwinPutenv(
cygwin_posix_to_win32_path_list(value, buf);
}
-#ifdef __WIN32__
- SetEnvironmentVariable(name, buf);
-#endif
+ SetEnvironmentVariableA(name, buf);
}
}
#endif /* __CYGWIN__ */
diff --git a/generic/tclPort.h b/generic/tclPort.h
index 23c6191..79bea88 100644
--- a/generic/tclPort.h
+++ b/generic/tclPort.h
@@ -29,10 +29,13 @@
# define USE_PUTENV 1
# define USE_PUTENV_FOR_UNSET 1
/* On Cygwin, the environment is imported from the Cygwin DLL. */
- DLLIMPORT extern char **__cygwin_environ;
- DLLIMPORT extern int cygwin_conv_to_win32_path(const char *, char *);
# define environ __cygwin_environ
# define timezone _timezone
+ DLLIMPORT extern char **__cygwin_environ;
+ DLLIMPORT extern int cygwin_conv_to_win32_path(const char *, char *);
+ 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);
+ DLLIMPORT extern void __stdcall SetEnvironmentVariableA(const char*, const char *);
#endif
#if !defined(LLONG_MIN)