summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-04-27 14:37:37 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-04-27 14:37:37 (GMT)
commit28eb0289077aad0052036addef782cce499d0857 (patch)
treecbb2ef3605bfac2d9176a53132f1329d8edcd7ac
parentb1b14e036e39b348932a8c24e424b79a67af2e00 (diff)
parent4457676798e94230b3296a67ab9caed2dc95e8d5 (diff)
downloadtcl-28eb0289077aad0052036addef782cce499d0857.zip
tcl-28eb0289077aad0052036addef782cce499d0857.tar.gz
tcl-28eb0289077aad0052036addef782cce499d0857.tar.bz2
Move CYGWIN-specific stuff from tclPort.h to tclUnixPort.h, where it belongs
-rw-r--r--ChangeLog7
-rw-r--r--generic/tclEnv.c1
-rw-r--r--generic/tclPort.h13
-rw-r--r--unix/tclUnixFile.c11
-rw-r--r--unix/tclUnixPort.h13
-rw-r--r--win/tclWinInit.c2
6 files changed, 25 insertions, 22 deletions
diff --git a/ChangeLog b/ChangeLog
index 4120c61..bc314a3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-04-27 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * generic/tclPort.h: Move CYGWIN-specific stuff from tclPort.h to
+ * generic/tclEnv.c: tclUnixPort.h, where it belongs.
+ * unix/tclUnixPort.h:
+ * unix/tclUnixFile.c:
+
2012-04-27 Donal K. Fellows <dkf@users.sf.net>
* library/init.tcl (auto_execok): Allow shell builtins to be detected
diff --git a/generic/tclEnv.c b/generic/tclEnv.c
index 72d6fba..e45ae6a 100644
--- a/generic/tclEnv.c
+++ b/generic/tclEnv.c
@@ -698,6 +698,7 @@ TclFinalizeEnvironment(void)
* fork) and the Windows environment (in case the application TCL code calls
* exec, which calls the Windows CreateProcess function).
*/
+DLLIMPORT extern void __stdcall SetEnvironmentVariableA(const char*, const char *);
static void
TclCygwinPutenv(
diff --git a/generic/tclPort.h b/generic/tclPort.h
index d9361ca..7021b8d 100644
--- a/generic/tclPort.h
+++ b/generic/tclPort.h
@@ -25,19 +25,6 @@
# include "tclUnixPort.h"
#endif
-#if defined(__CYGWIN__)
-# define USE_PUTENV 1
-# define USE_PUTENV_FOR_UNSET 1
-/* On Cygwin, the environment is imported from the Cygwin DLL. */
-# 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)
# ifdef TCL_WIDE_INT_IS_LONG
# define LLONG_MIN LONG_MIN
diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c
index b4a1012..a4426b7 100644
--- a/unix/tclUnixFile.c
+++ b/unix/tclUnixFile.c
@@ -39,6 +39,7 @@ TclpFindExecutable(
const char *argv0) /* The value of the application's argv[0]
* (native). */
{
+ Tcl_Encoding encoding;
#ifdef __CYGWIN__
int length;
char buf[PATH_MAX * TCL_UTF_MAX + 1];
@@ -46,9 +47,9 @@ TclpFindExecutable(
/* Make some symbols available without including <windows.h> */
# define CP_UTF8 65001
- extern int cygwin_conv_to_full_posix_path(const char *, char *);
- extern __stdcall int GetModuleFileNameW(void *, const char *, int);
- extern __stdcall int WideCharToMultiByte(int, int, const char *, int,
+ DLLIMPORT extern int cygwin_conv_to_full_posix_path(const char *, char *);
+ DLLIMPORT extern __stdcall int GetModuleFileNameW(void *, const char *, int);
+ DLLIMPORT extern __stdcall int WideCharToMultiByte(int, int, const char *, int,
const char *, int, const char *, const char *);
GetModuleFileNameW(NULL, name, PATH_MAX);
@@ -59,13 +60,13 @@ TclpFindExecutable(
/* Strip '.exe' part. */
length -= 4;
}
+ encoding = Tcl_GetEncoding(NULL, NULL);
TclSetObjNameOfExecutable(
- Tcl_NewStringObj(name, length), Tcl_GetEncoding(NULL, NULL));
+ Tcl_NewStringObj(name, length), encoding);
#else
const char *name, *p;
Tcl_StatBuf statBuf;
Tcl_DString buffer, nameString, cwd, utfName;
- Tcl_Encoding encoding;
if (argv0 == NULL) {
return;
diff --git a/unix/tclUnixPort.h b/unix/tclUnixPort.h
index 98ef3c8..22872e4 100644
--- a/unix/tclUnixPort.h
+++ b/unix/tclUnixPort.h
@@ -79,8 +79,17 @@ typedef off_t Tcl_SeekOffset;
#endif
#ifdef __CYGWIN__
-MODULE_SCOPE int TclOSstat(const char *name, Tcl_StatBuf *statBuf);
-MODULE_SCOPE int TclOSlstat(const char *name, Tcl_StatBuf *statBuf);
+# define USE_PUTENV 1
+# define USE_PUTENV_FOR_UNSET 1
+/* On Cygwin, the environment is imported from the Cygwin DLL. */
+# 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);
+ MODULE_SCOPE int TclOSstat(const char *name, Tcl_StatBuf *statBuf);
+ MODULE_SCOPE int TclOSlstat(const char *name, Tcl_StatBuf *statBuf);
#elif defined(HAVE_STRUCT_STAT64)
# define TclOSstat stat64
# define TclOSlstat lstat64
diff --git a/win/tclWinInit.c b/win/tclWinInit.c
index 3bfff63..d89c98e 100644
--- a/win/tclWinInit.c
+++ b/win/tclWinInit.c
@@ -288,8 +288,6 @@ AppendEnvironment(
*/
if ((pathc > 0) && (lstrcmpiA(shortlib, pathv[pathc - 1]) != 0)) {
- const char *str;
-
/*
* TCL_LIBRARY is set but refers to a different tcl installation
* than the current version. Try fiddling with the specified