summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog40
-rw-r--r--generic/tclInt.decls42
-rw-r--r--generic/tclIntPlatDecls.h313
-rw-r--r--generic/tclPipe.c2
-rw-r--r--generic/tclStubInit.c58
-rw-r--r--library/dde/pkgIndex.tcl4
-rwxr-xr-xlibrary/reg/pkgIndex.tcl4
-rw-r--r--unix/Makefile.in5
-rwxr-xr-xunix/configure87
-rw-r--r--unix/configure.in14
-rw-r--r--unix/tcl.m49
-rw-r--r--unix/tclUnixCompat.c6
-rw-r--r--unix/tclUnixFile.c33
-rw-r--r--unix/tclUnixPort.h2
-rw-r--r--win/tclWinPipe.c2
15 files changed, 500 insertions, 121 deletions
diff --git a/ChangeLog b/ChangeLog
index 78c4940..19761ac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2012-04-24 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * generic/tclInt.decls: [Bug 3508771] load tclreg.dll in cygwin tclsh
+ * generic/tclIntPlatDecls.h: Implement TclWinGetSockOpt, TclWinGetServByName
+ * generic/tclStubInit.c: and TclWinCPUID for Cygwin
+ * generic/tclUnixCompat.c:
+ * unix/configure.in:
+ * unix/configure:
+ * unix/tclUnixCompat.c:
+
2012-04-18 Kevin B. Kenny <kennykb@acm.org>
* library/tzdata/Africa/Casablanca:
@@ -62,7 +72,7 @@
* generic/tclInt.decls: [Bug 3508771] load tclreg.dll in cygwin tclsh
* generic/tclIntPlatDecls.h: Implement TclWinConvertError, TclWinConvertWSAError,
- * generic/tclStubInit.c: and various more win32-specific internal functions for
+ * generic/tclStubInit.c: and various more win32-specific internal functions for
* unix/Makefile.in: Cygwin, so win32 extensions using those can be
* unix/tcl.m4: loaded in the cygwin version of tclsh.
* unix/configure:
@@ -82,7 +92,7 @@
* generic/tcl.decls: [Bug 3508771] load tclreg.dll in cygwin tclsh
* generic/tclInt.decls: Implement TclWinGetPlatformId, Tcl_WinUtfToTChar,
- * generic/tclIntPlatDecls.h: Tcl_WinTCharToUtf (and a dummy TclWinCPUID) for
+ * generic/tclIntPlatDecls.h: Tcl_WinTCharToUtf (and a dummy TclWinCPUID) for
* generic/tclPlatDecls.h: Cygwin, so win32 extensions using those can be
* generic/tclStubInit.c: loaded in the cygwin version of tclsh.
* unix/tclUnixCompat.c:
@@ -213,7 +223,7 @@
2012-01-22 Jan Nijtmans <nijtmans@users.sf.net>
- * tools/uniClass.tcl: [Frq 3473670]: Various Unicode-related
+ * tools/uniClass.tcl: [Frq 3473670]: Various Unicode-related
* tools/uniParse.tcl: speedups/robustness. Enhanced tools to
* generic/tclUniData.c: be able to handle characters > 0xffff
* generic/tclUtf.c: Done in all branches in order to simplify
@@ -698,7 +708,7 @@
* generic/tclListObj.c: of a boolean var, where the caller can be told
* generic/tclParse.c: whether or not the parsed list element was
* generic/tclUtil.c: enclosed in braces. In practice, no callers
- really care about that. What the callers really want to know is
+ really care about that. What the callers really want to know is
whether the list element value exists as a literal substring of the
string being parsed, or whether a call to TclCopyAndCollpase() is
needed to produce the list element value. Now the final argument
@@ -736,7 +746,7 @@
* generic/tclStrToD.c:
* generic/tclUtf.c:
* unix/tclUnixFile.c:
-
+
2011-04-27 Don Porter <dgp@users.sourceforge.net>
* generic/tclListObj.c: FreeListInternalRep() cleanup.
@@ -1199,7 +1209,7 @@
2010-09-23 Don Porter <dgp@users.sourceforge.net>
- * generic/tclCmdAH.c: Fix cases where value returned by
+ * generic/tclCmdAH.c: Fix cases where value returned by
* generic/tclEvent.c: Tcl_GetReturnOptions() was leaked.
* generic/tclMain.c: Thanks to Jeff Hobbs for discovery of the
anti-pattern to seek and destroy.
@@ -1498,7 +1508,7 @@
* library/platform/platform.tcl: Fix cpu name for Solaris/Intel 64bit.
* library/platform/pkgIndex.tcl: Package updated to version 1.0.8.
- * unix/Makefile.in:
+ * unix/Makefile.in:
* win/Makefile.in:
2010-04-30 Don Porter <dgp@users.sourceforge.net>
@@ -1534,7 +1544,7 @@
* library/tzdata/Pacific/Apia:
* library/tzdata/Pacific/Easter:
* library/tzdata/Pacific/Fiji: Olson's tzdata2010i.
-
+
2010-04-19 Jan Nijtmans <nijtmans@users.sf.net>
* win/tclWinPort.h: [Patch 2986105]: Conditionally defining
@@ -1870,9 +1880,9 @@
2009-11-27 Donal K. Fellows <dkf@users.sf.net>
- * doc/BoolObj.3, doc/CrtChannel.3, doc/DictObj.3, doc/DoubleObj.3:
- * doc/Ensemble.3, doc/Environment.3, doc/FileSystem.3, doc/Hash.3:
- * doc/IntObj.3, doc/Limit.3, doc/ObjectType.3, doc/PkgRequire.3:
+ * doc/BoolObj.3, doc/CrtChannel.3, doc/DictObj.3, doc/DoubleObj.3:
+ * doc/Ensemble.3, doc/Environment.3, doc/FileSystem.3, doc/Hash.3:
+ * doc/IntObj.3, doc/Limit.3, doc/ObjectType.3, doc/PkgRequire.3:
* doc/SetChanErr.3, doc/SetResult.3: [Patch 2903921]: Many small
spelling fixes from Larry Virden.
@@ -1888,7 +1898,7 @@
* generic/tclEncoding.c: Fix [Bug 2891556] and improve test to detect
* tests/decoding.test: similar manifestations in the future.
-
+
2009-11-12 Don Porter <dgp@users.sourceforge.net>
*** 8.5.8 TAGGED FOR RELEASE ***
@@ -1917,7 +1927,7 @@
* library/http/http.tcl: [Bug 2891171]: Update the URL syntax
check to RFC 3986 compliance on the subject of non-encoded question
mark characters.
-
+
* library/http/pkgIndex.tcl: Bump to http 2.7.5 to avoid any
* unix/Makefile.in: confusion with snapshot "releases"
* win/Makefile.in: that might be in ActiveTcl, etc.
@@ -1943,7 +1953,7 @@
2009-11-09 Don Porter <dgp@users.sourceforge.net>
- * generic/tclBasic.c (TclEvalObjEx): Plug memory leak in
+ * generic/tclBasic.c (TclEvalObjEx): Plug memory leak in
TCL_EVAL_DIRECT evaluation.
* tests/info.test: Resolve ambiguous resolution of variable "res".
@@ -1972,7 +1982,7 @@
subdirectories.
2009-11-03 Kevin B. Kenny <kennykb@acm.org>
-
+
* library/tzdata/Asia/Novokuznetsk: New tzdata locale for Kemerovo
oblast', which now keeps Novosibirsk time and not Kranoyarsk time.
* library/tzdata/Asia/Damascus: Syrian DST changes.
diff --git a/generic/tclInt.decls b/generic/tclInt.decls
index 859f491..0ba4542 100644
--- a/generic/tclInt.decls
+++ b/generic/tclInt.decls
@@ -975,7 +975,7 @@ declare 7 win {
const char *optval, int optlen)
}
declare 8 win {
- unsigned long TclpGetPid(Tcl_Pid pid)
+ int TclpGetPid(Tcl_Pid pid)
}
declare 9 win {
int TclWinGetPlatformId(void)
@@ -1073,12 +1073,14 @@ declare 0 unix {
declare 1 unix {
void TclWinConvertWSAError(unsigned int errCode)
}
+# On non-cygwin, this is actually a reference to TclpCreateCommandChannel
declare 2 unix {
- Tcl_Channel TclpCreateCommandChannel(TclFile readFile,
- TclFile writeFile, TclFile errorFile, int numPids, Tcl_Pid *pidPtr)
+ struct servent *TclWinGetServByName(const char *nm, const char *proto)
}
+# On non-cygwin, this is actually a reference to TclpCreatePipe
declare 3 unix {
- int TclpCreatePipe(TclFile *readPipe, TclFile *writePipe)
+ int TclWinGetSockOpt(void *s, int level, int optname,
+ char *optval, int *optlen)
}
# On non-cygwin, this is actually a reference to TclpCreateProcess
declare 4 unix {
@@ -1098,8 +1100,9 @@ declare 7 unix {
int TclWinSetSockOpt(void *s, int level, int optname,
const char *optval, int optlen)
}
+# On non-cygwin, this is actually a reference to TclUnixWaitForFile
declare 8 unix {
- int TclUnixWaitForFile(int fd, int mask, int timeout)
+ int TclpGetPid(Tcl_Pid pid)
}
# Added in 8.1:
@@ -1124,8 +1127,10 @@ declare 11 unix {
declare 12 unix {
struct tm *TclpGmtime_unix(const time_t *clock)
}
+# On cygwin, this is a reference to TclpCreateCommandChannel
+# Otherwise, this is a reference to TclpInetNtoa
declare 13 unix {
- char *TclpInetNtoa(struct in_addr addr)
+ void TclIntPlatReserved13(void)
}
# Added in 8.5:
@@ -1188,7 +1193,30 @@ declare 30 unix {
declare 31 unix {
int TclpCloseFile(TclFile file)
}
-
+declare 32 unix {
+ Tcl_Channel TclpCreateCommandChannel(TclFile readFile,
+ TclFile writeFile, TclFile errorFile, int numPids, Tcl_Pid *pidPtr)
+}
+declare 33 unix {
+ int TclpCreatePipe(TclFile *readPipe, TclFile *writePipe)
+}
+declare 34 unix {
+ int TclpCreateProcess(Tcl_Interp *interp,
+ int argc, const char **argv, TclFile inputFile,
+ TclFile outputFile, TclFile errorFile, Tcl_Pid *pidPtr)
+}
+declare 35 unix {
+ char *TclpInetNtoa(struct in_addr addr)
+}
+declare 36 unix {
+ TclFile TclpMakeFile(Tcl_Channel channel, int direction)
+}
+declare 37 unix {
+ TclFile TclpOpenFile(const char *fname, int mode)
+}
+declare 38 unix {
+ int TclUnixWaitForFile(int fd, int mask, int timeout)
+}
# Local Variables:
# mode: tcl
diff --git a/generic/tclIntPlatDecls.h b/generic/tclIntPlatDecls.h
index b3976c8..8c9545a 100644
--- a/generic/tclIntPlatDecls.h
+++ b/generic/tclIntPlatDecls.h
@@ -24,16 +24,6 @@
# endif
#endif
-#if !defined(__WIN32__) /* UNIX */
-EXTERN int TclpCreateProcess(Tcl_Interp *interp,
- int argc, CONST char **argv, TclFile inputFile,
- TclFile outputFile, TclFile errorFile, Tcl_Pid *pidPtr);
-EXTERN TclFile TclpMakeFile(Tcl_Channel channel,
- int direction);
-EXTERN TclFile TclpOpenFile(CONST char *fname,
- int mode);
-#endif
-
/*
* WARNING: This file is automatically generated by the tools/genStubs.tcl
* script. Any modifications to the function declarations below should be made
@@ -57,17 +47,17 @@ EXTERN void TclWinConvertError(unsigned int errCode);
/* 1 */
EXTERN void TclWinConvertWSAError(unsigned int errCode);
#endif
-#ifndef TclpCreateCommandChannel_TCL_DECLARED
-#define TclpCreateCommandChannel_TCL_DECLARED
+#ifndef TclWinGetServByName_TCL_DECLARED
+#define TclWinGetServByName_TCL_DECLARED
/* 2 */
-EXTERN Tcl_Channel TclpCreateCommandChannel(TclFile readFile,
- TclFile writeFile, TclFile errorFile,
- int numPids, Tcl_Pid *pidPtr);
+EXTERN struct servent * TclWinGetServByName(CONST char *nm,
+ CONST char *proto);
#endif
-#ifndef TclpCreatePipe_TCL_DECLARED
-#define TclpCreatePipe_TCL_DECLARED
+#ifndef TclWinGetSockOpt_TCL_DECLARED
+#define TclWinGetSockOpt_TCL_DECLARED
/* 3 */
-EXTERN int TclpCreatePipe(TclFile *readPipe, TclFile *writePipe);
+EXTERN int TclWinGetSockOpt(VOID *s, int level, int optname,
+ char *optval, int *optlen);
#endif
#ifndef TclWinGetTclInstance_TCL_DECLARED
#define TclWinGetTclInstance_TCL_DECLARED
@@ -86,10 +76,10 @@ EXTERN unsigned short TclWinNToHS(unsigned short ns);
EXTERN int TclWinSetSockOpt(VOID *s, int level, int optname,
CONST char *optval, int optlen);
#endif
-#ifndef TclUnixWaitForFile_TCL_DECLARED
-#define TclUnixWaitForFile_TCL_DECLARED
+#ifndef TclpGetPid_TCL_DECLARED
+#define TclpGetPid_TCL_DECLARED
/* 8 */
-EXTERN int TclUnixWaitForFile(int fd, int mask, int timeout);
+EXTERN int TclpGetPid(Tcl_Pid pid);
#endif
#ifndef TclWinGetPlatformId_TCL_DECLARED
#define TclWinGetPlatformId_TCL_DECLARED
@@ -111,10 +101,10 @@ EXTERN struct tm * TclpLocaltime_unix(CONST time_t *clock);
/* 12 */
EXTERN struct tm * TclpGmtime_unix(CONST time_t *clock);
#endif
-#ifndef TclpInetNtoa_TCL_DECLARED
-#define TclpInetNtoa_TCL_DECLARED
+#ifndef TclIntPlatReserved13_TCL_DECLARED
+#define TclIntPlatReserved13_TCL_DECLARED
/* 13 */
-EXTERN char * TclpInetNtoa(struct in_addr addr);
+EXTERN void TclIntPlatReserved13(void);
#endif
#ifndef TclUnixCopyFile_TCL_DECLARED
#define TclUnixCopyFile_TCL_DECLARED
@@ -195,6 +185,46 @@ EXTERN void TclGetAndDetachPids(Tcl_Interp *interp,
/* 31 */
EXTERN int TclpCloseFile(TclFile file);
#endif
+#ifndef TclpCreateCommandChannel_TCL_DECLARED
+#define TclpCreateCommandChannel_TCL_DECLARED
+/* 32 */
+EXTERN Tcl_Channel TclpCreateCommandChannel(TclFile readFile,
+ TclFile writeFile, TclFile errorFile,
+ int numPids, Tcl_Pid *pidPtr);
+#endif
+#ifndef TclpCreatePipe_TCL_DECLARED
+#define TclpCreatePipe_TCL_DECLARED
+/* 33 */
+EXTERN int TclpCreatePipe(TclFile *readPipe, TclFile *writePipe);
+#endif
+#ifndef TclpCreateProcess_TCL_DECLARED
+#define TclpCreateProcess_TCL_DECLARED
+/* 34 */
+EXTERN int TclpCreateProcess(Tcl_Interp *interp, int argc,
+ CONST char **argv, TclFile inputFile,
+ TclFile outputFile, TclFile errorFile,
+ Tcl_Pid *pidPtr);
+#endif
+#ifndef TclpInetNtoa_TCL_DECLARED
+#define TclpInetNtoa_TCL_DECLARED
+/* 35 */
+EXTERN char * TclpInetNtoa(struct in_addr addr);
+#endif
+#ifndef TclpMakeFile_TCL_DECLARED
+#define TclpMakeFile_TCL_DECLARED
+/* 36 */
+EXTERN TclFile TclpMakeFile(Tcl_Channel channel, int direction);
+#endif
+#ifndef TclpOpenFile_TCL_DECLARED
+#define TclpOpenFile_TCL_DECLARED
+/* 37 */
+EXTERN TclFile TclpOpenFile(CONST char *fname, int mode);
+#endif
+#ifndef TclUnixWaitForFile_TCL_DECLARED
+#define TclUnixWaitForFile_TCL_DECLARED
+/* 38 */
+EXTERN int TclUnixWaitForFile(int fd, int mask, int timeout);
+#endif
#endif /* UNIX */
#ifdef __WIN32__ /* WIN */
#ifndef TclWinConvertError_TCL_DECLARED
@@ -239,7 +269,7 @@ EXTERN int TclWinSetSockOpt(SOCKET s, int level, int optname,
#ifndef TclpGetPid_TCL_DECLARED
#define TclpGetPid_TCL_DECLARED
/* 8 */
-EXTERN unsigned long TclpGetPid(Tcl_Pid pid);
+EXTERN int TclpGetPid(Tcl_Pid pid);
#endif
#ifndef TclWinGetPlatformId_TCL_DECLARED
#define TclWinGetPlatformId_TCL_DECLARED
@@ -344,17 +374,17 @@ EXTERN void TclWinConvertError(unsigned int errCode);
/* 1 */
EXTERN void TclWinConvertWSAError(unsigned int errCode);
#endif
-#ifndef TclpCreateCommandChannel_TCL_DECLARED
-#define TclpCreateCommandChannel_TCL_DECLARED
+#ifndef TclWinGetServByName_TCL_DECLARED
+#define TclWinGetServByName_TCL_DECLARED
/* 2 */
-EXTERN Tcl_Channel TclpCreateCommandChannel(TclFile readFile,
- TclFile writeFile, TclFile errorFile,
- int numPids, Tcl_Pid *pidPtr);
+EXTERN struct servent * TclWinGetServByName(CONST char *nm,
+ CONST char *proto);
#endif
-#ifndef TclpCreatePipe_TCL_DECLARED
-#define TclpCreatePipe_TCL_DECLARED
+#ifndef TclWinGetSockOpt_TCL_DECLARED
+#define TclWinGetSockOpt_TCL_DECLARED
/* 3 */
-EXTERN int TclpCreatePipe(TclFile *readPipe, TclFile *writePipe);
+EXTERN int TclWinGetSockOpt(VOID *s, int level, int optname,
+ char *optval, int *optlen);
#endif
#ifndef TclWinGetTclInstance_TCL_DECLARED
#define TclWinGetTclInstance_TCL_DECLARED
@@ -373,10 +403,10 @@ EXTERN unsigned short TclWinNToHS(unsigned short ns);
EXTERN int TclWinSetSockOpt(VOID *s, int level, int optname,
CONST char *optval, int optlen);
#endif
-#ifndef TclUnixWaitForFile_TCL_DECLARED
-#define TclUnixWaitForFile_TCL_DECLARED
+#ifndef TclpGetPid_TCL_DECLARED
+#define TclpGetPid_TCL_DECLARED
/* 8 */
-EXTERN int TclUnixWaitForFile(int fd, int mask, int timeout);
+EXTERN int TclpGetPid(Tcl_Pid pid);
#endif
#ifndef TclWinGetPlatformId_TCL_DECLARED
#define TclWinGetPlatformId_TCL_DECLARED
@@ -398,10 +428,10 @@ EXTERN struct tm * TclpLocaltime_unix(CONST time_t *clock);
/* 12 */
EXTERN struct tm * TclpGmtime_unix(CONST time_t *clock);
#endif
-#ifndef TclpInetNtoa_TCL_DECLARED
-#define TclpInetNtoa_TCL_DECLARED
+#ifndef TclIntPlatReserved13_TCL_DECLARED
+#define TclIntPlatReserved13_TCL_DECLARED
/* 13 */
-EXTERN char * TclpInetNtoa(struct in_addr addr);
+EXTERN void TclIntPlatReserved13(void);
#endif
#ifndef TclUnixCopyFile_TCL_DECLARED
#define TclUnixCopyFile_TCL_DECLARED
@@ -494,6 +524,46 @@ EXTERN void TclGetAndDetachPids(Tcl_Interp *interp,
/* 31 */
EXTERN int TclpCloseFile(TclFile file);
#endif
+#ifndef TclpCreateCommandChannel_TCL_DECLARED
+#define TclpCreateCommandChannel_TCL_DECLARED
+/* 32 */
+EXTERN Tcl_Channel TclpCreateCommandChannel(TclFile readFile,
+ TclFile writeFile, TclFile errorFile,
+ int numPids, Tcl_Pid *pidPtr);
+#endif
+#ifndef TclpCreatePipe_TCL_DECLARED
+#define TclpCreatePipe_TCL_DECLARED
+/* 33 */
+EXTERN int TclpCreatePipe(TclFile *readPipe, TclFile *writePipe);
+#endif
+#ifndef TclpCreateProcess_TCL_DECLARED
+#define TclpCreateProcess_TCL_DECLARED
+/* 34 */
+EXTERN int TclpCreateProcess(Tcl_Interp *interp, int argc,
+ CONST char **argv, TclFile inputFile,
+ TclFile outputFile, TclFile errorFile,
+ Tcl_Pid *pidPtr);
+#endif
+#ifndef TclpInetNtoa_TCL_DECLARED
+#define TclpInetNtoa_TCL_DECLARED
+/* 35 */
+EXTERN char * TclpInetNtoa(struct in_addr addr);
+#endif
+#ifndef TclpMakeFile_TCL_DECLARED
+#define TclpMakeFile_TCL_DECLARED
+/* 36 */
+EXTERN TclFile TclpMakeFile(Tcl_Channel channel, int direction);
+#endif
+#ifndef TclpOpenFile_TCL_DECLARED
+#define TclpOpenFile_TCL_DECLARED
+/* 37 */
+EXTERN TclFile TclpOpenFile(CONST char *fname, int mode);
+#endif
+#ifndef TclUnixWaitForFile_TCL_DECLARED
+#define TclUnixWaitForFile_TCL_DECLARED
+/* 38 */
+EXTERN int TclUnixWaitForFile(int fd, int mask, int timeout);
+#endif
#endif /* MACOSX */
typedef struct TclIntPlatStubs {
@@ -503,18 +573,18 @@ typedef struct TclIntPlatStubs {
#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
void (*tclWinConvertError) (unsigned int errCode); /* 0 */
void (*tclWinConvertWSAError) (unsigned int errCode); /* 1 */
- Tcl_Channel (*tclpCreateCommandChannel) (TclFile readFile, TclFile writeFile, TclFile errorFile, int numPids, Tcl_Pid *pidPtr); /* 2 */
- int (*tclpCreatePipe) (TclFile *readPipe, TclFile *writePipe); /* 3 */
+ struct servent * (*tclWinGetServByName) (CONST char *nm, CONST char *proto); /* 2 */
+ int (*tclWinGetSockOpt) (VOID *s, int level, int optname, char *optval, int *optlen); /* 3 */
VOID * (*tclWinGetTclInstance) (void); /* 4 */
VOID *reserved5;
unsigned short (*tclWinNToHS) (unsigned short ns); /* 6 */
int (*tclWinSetSockOpt) (VOID *s, int level, int optname, CONST char *optval, int optlen); /* 7 */
- int (*tclUnixWaitForFile) (int fd, int mask, int timeout); /* 8 */
+ int (*tclpGetPid) (Tcl_Pid pid); /* 8 */
int (*tclWinGetPlatformId) (void); /* 9 */
Tcl_DirEntry * (*tclpReaddir) (DIR *dir); /* 10 */
struct tm * (*tclpLocaltime_unix) (CONST time_t *clock); /* 11 */
struct tm * (*tclpGmtime_unix) (CONST time_t *clock); /* 12 */
- char * (*tclpInetNtoa) (struct in_addr addr); /* 13 */
+ void (*tclIntPlatReserved13) (void); /* 13 */
int (*tclUnixCopyFile) (CONST char *src, CONST char *dst, CONST Tcl_StatBuf *statBufPtr, int dontCopyAtts); /* 14 */
int (*tclMacOSXGetFileAttribute) (Tcl_Interp *interp, int objIndex, Tcl_Obj *fileName, Tcl_Obj **attributePtrPtr); /* 15 */
VOID *reserved16;
@@ -533,6 +603,13 @@ typedef struct TclIntPlatStubs {
int (*tclWinCPUID) (unsigned int index, unsigned int *regs); /* 29 */
void (*tclGetAndDetachPids) (Tcl_Interp *interp, Tcl_Channel chan); /* 30 */
int (*tclpCloseFile) (TclFile file); /* 31 */
+ Tcl_Channel (*tclpCreateCommandChannel) (TclFile readFile, TclFile writeFile, TclFile errorFile, int numPids, Tcl_Pid *pidPtr); /* 32 */
+ int (*tclpCreatePipe) (TclFile *readPipe, TclFile *writePipe); /* 33 */
+ int (*tclpCreateProcess) (Tcl_Interp *interp, int argc, CONST char **argv, TclFile inputFile, TclFile outputFile, TclFile errorFile, Tcl_Pid *pidPtr); /* 34 */
+ char * (*tclpInetNtoa) (struct in_addr addr); /* 35 */
+ TclFile (*tclpMakeFile) (Tcl_Channel channel, int direction); /* 36 */
+ TclFile (*tclpOpenFile) (CONST char *fname, int mode); /* 37 */
+ int (*tclUnixWaitForFile) (int fd, int mask, int timeout); /* 38 */
#endif /* UNIX */
#ifdef __WIN32__ /* WIN */
void (*tclWinConvertError) (DWORD errCode); /* 0 */
@@ -543,7 +620,7 @@ typedef struct TclIntPlatStubs {
VOID *reserved5;
u_short (*tclWinNToHS) (u_short ns); /* 6 */
int (*tclWinSetSockOpt) (SOCKET s, int level, int optname, CONST char *optval, int optlen); /* 7 */
- unsigned long (*tclpGetPid) (Tcl_Pid pid); /* 8 */
+ int (*tclpGetPid) (Tcl_Pid pid); /* 8 */
int (*tclWinGetPlatformId) (void); /* 9 */
VOID *reserved10;
void (*tclGetAndDetachPids) (Tcl_Interp *interp, Tcl_Channel chan); /* 11 */
@@ -569,18 +646,18 @@ typedef struct TclIntPlatStubs {
#ifdef MAC_OSX_TCL /* MACOSX */
void (*tclWinConvertError) (unsigned int errCode); /* 0 */
void (*tclWinConvertWSAError) (unsigned int errCode); /* 1 */
- Tcl_Channel (*tclpCreateCommandChannel) (TclFile readFile, TclFile writeFile, TclFile errorFile, int numPids, Tcl_Pid *pidPtr); /* 2 */
- int (*tclpCreatePipe) (TclFile *readPipe, TclFile *writePipe); /* 3 */
+ struct servent * (*tclWinGetServByName) (CONST char *nm, CONST char *proto); /* 2 */
+ int (*tclWinGetSockOpt) (VOID *s, int level, int optname, char *optval, int *optlen); /* 3 */
VOID * (*tclWinGetTclInstance) (void); /* 4 */
VOID *reserved5;
unsigned short (*tclWinNToHS) (unsigned short ns); /* 6 */
int (*tclWinSetSockOpt) (VOID *s, int level, int optname, CONST char *optval, int optlen); /* 7 */
- int (*tclUnixWaitForFile) (int fd, int mask, int timeout); /* 8 */
+ int (*tclpGetPid) (Tcl_Pid pid); /* 8 */
int (*tclWinGetPlatformId) (void); /* 9 */
Tcl_DirEntry * (*tclpReaddir) (DIR *dir); /* 10 */
struct tm * (*tclpLocaltime_unix) (CONST time_t *clock); /* 11 */
struct tm * (*tclpGmtime_unix) (CONST time_t *clock); /* 12 */
- char * (*tclpInetNtoa) (struct in_addr addr); /* 13 */
+ void (*tclIntPlatReserved13) (void); /* 13 */
int (*tclUnixCopyFile) (CONST char *src, CONST char *dst, CONST Tcl_StatBuf *statBufPtr, int dontCopyAtts); /* 14 */
int (*tclMacOSXGetFileAttribute) (Tcl_Interp *interp, int objIndex, Tcl_Obj *fileName, Tcl_Obj **attributePtrPtr); /* 15 */
int (*tclMacOSXSetFileAttribute) (Tcl_Interp *interp, int objIndex, Tcl_Obj *fileName, Tcl_Obj *attributePtr); /* 16 */
@@ -599,6 +676,13 @@ typedef struct TclIntPlatStubs {
int (*tclWinCPUID) (unsigned int index, unsigned int *regs); /* 29 */
void (*tclGetAndDetachPids) (Tcl_Interp *interp, Tcl_Channel chan); /* 30 */
int (*tclpCloseFile) (TclFile file); /* 31 */
+ Tcl_Channel (*tclpCreateCommandChannel) (TclFile readFile, TclFile writeFile, TclFile errorFile, int numPids, Tcl_Pid *pidPtr); /* 32 */
+ int (*tclpCreatePipe) (TclFile *readPipe, TclFile *writePipe); /* 33 */
+ int (*tclpCreateProcess) (Tcl_Interp *interp, int argc, CONST char **argv, TclFile inputFile, TclFile outputFile, TclFile errorFile, Tcl_Pid *pidPtr); /* 34 */
+ char * (*tclpInetNtoa) (struct in_addr addr); /* 35 */
+ TclFile (*tclpMakeFile) (Tcl_Channel channel, int direction); /* 36 */
+ TclFile (*tclpOpenFile) (CONST char *fname, int mode); /* 37 */
+ int (*tclUnixWaitForFile) (int fd, int mask, int timeout); /* 38 */
#endif /* MACOSX */
} TclIntPlatStubs;
@@ -625,13 +709,13 @@ extern TclIntPlatStubs *tclIntPlatStubsPtr;
#define TclWinConvertWSAError \
(tclIntPlatStubsPtr->tclWinConvertWSAError) /* 1 */
#endif
-#ifndef TclpCreateCommandChannel
-#define TclpCreateCommandChannel \
- (tclIntPlatStubsPtr->tclpCreateCommandChannel) /* 2 */
+#ifndef TclWinGetServByName
+#define TclWinGetServByName \
+ (tclIntPlatStubsPtr->tclWinGetServByName) /* 2 */
#endif
-#ifndef TclpCreatePipe
-#define TclpCreatePipe \
- (tclIntPlatStubsPtr->tclpCreatePipe) /* 3 */
+#ifndef TclWinGetSockOpt
+#define TclWinGetSockOpt \
+ (tclIntPlatStubsPtr->tclWinGetSockOpt) /* 3 */
#endif
#ifndef TclWinGetTclInstance
#define TclWinGetTclInstance \
@@ -646,9 +730,9 @@ extern TclIntPlatStubs *tclIntPlatStubsPtr;
#define TclWinSetSockOpt \
(tclIntPlatStubsPtr->tclWinSetSockOpt) /* 7 */
#endif
-#ifndef TclUnixWaitForFile
-#define TclUnixWaitForFile \
- (tclIntPlatStubsPtr->tclUnixWaitForFile) /* 8 */
+#ifndef TclpGetPid
+#define TclpGetPid \
+ (tclIntPlatStubsPtr->tclpGetPid) /* 8 */
#endif
#ifndef TclWinGetPlatformId
#define TclWinGetPlatformId \
@@ -666,9 +750,9 @@ extern TclIntPlatStubs *tclIntPlatStubsPtr;
#define TclpGmtime_unix \
(tclIntPlatStubsPtr->tclpGmtime_unix) /* 12 */
#endif
-#ifndef TclpInetNtoa
-#define TclpInetNtoa \
- (tclIntPlatStubsPtr->tclpInetNtoa) /* 13 */
+#ifndef TclIntPlatReserved13
+#define TclIntPlatReserved13 \
+ (tclIntPlatStubsPtr->tclIntPlatReserved13) /* 13 */
#endif
#ifndef TclUnixCopyFile
#define TclUnixCopyFile \
@@ -727,6 +811,34 @@ extern TclIntPlatStubs *tclIntPlatStubsPtr;
#define TclpCloseFile \
(tclIntPlatStubsPtr->tclpCloseFile) /* 31 */
#endif
+#ifndef TclpCreateCommandChannel
+#define TclpCreateCommandChannel \
+ (tclIntPlatStubsPtr->tclpCreateCommandChannel) /* 32 */
+#endif
+#ifndef TclpCreatePipe
+#define TclpCreatePipe \
+ (tclIntPlatStubsPtr->tclpCreatePipe) /* 33 */
+#endif
+#ifndef TclpCreateProcess
+#define TclpCreateProcess \
+ (tclIntPlatStubsPtr->tclpCreateProcess) /* 34 */
+#endif
+#ifndef TclpInetNtoa
+#define TclpInetNtoa \
+ (tclIntPlatStubsPtr->tclpInetNtoa) /* 35 */
+#endif
+#ifndef TclpMakeFile
+#define TclpMakeFile \
+ (tclIntPlatStubsPtr->tclpMakeFile) /* 36 */
+#endif
+#ifndef TclpOpenFile
+#define TclpOpenFile \
+ (tclIntPlatStubsPtr->tclpOpenFile) /* 37 */
+#endif
+#ifndef TclUnixWaitForFile
+#define TclUnixWaitForFile \
+ (tclIntPlatStubsPtr->tclUnixWaitForFile) /* 38 */
+#endif
#endif /* UNIX */
#ifdef __WIN32__ /* WIN */
#ifndef TclWinConvertError
@@ -841,13 +953,13 @@ extern TclIntPlatStubs *tclIntPlatStubsPtr;
#define TclWinConvertWSAError \
(tclIntPlatStubsPtr->tclWinConvertWSAError) /* 1 */
#endif
-#ifndef TclpCreateCommandChannel
-#define TclpCreateCommandChannel \
- (tclIntPlatStubsPtr->tclpCreateCommandChannel) /* 2 */
+#ifndef TclWinGetServByName
+#define TclWinGetServByName \
+ (tclIntPlatStubsPtr->tclWinGetServByName) /* 2 */
#endif
-#ifndef TclpCreatePipe
-#define TclpCreatePipe \
- (tclIntPlatStubsPtr->tclpCreatePipe) /* 3 */
+#ifndef TclWinGetSockOpt
+#define TclWinGetSockOpt \
+ (tclIntPlatStubsPtr->tclWinGetSockOpt) /* 3 */
#endif
#ifndef TclWinGetTclInstance
#define TclWinGetTclInstance \
@@ -862,9 +974,9 @@ extern TclIntPlatStubs *tclIntPlatStubsPtr;
#define TclWinSetSockOpt \
(tclIntPlatStubsPtr->tclWinSetSockOpt) /* 7 */
#endif
-#ifndef TclUnixWaitForFile
-#define TclUnixWaitForFile \
- (tclIntPlatStubsPtr->tclUnixWaitForFile) /* 8 */
+#ifndef TclpGetPid
+#define TclpGetPid \
+ (tclIntPlatStubsPtr->tclpGetPid) /* 8 */
#endif
#ifndef TclWinGetPlatformId
#define TclWinGetPlatformId \
@@ -882,9 +994,9 @@ extern TclIntPlatStubs *tclIntPlatStubsPtr;
#define TclpGmtime_unix \
(tclIntPlatStubsPtr->tclpGmtime_unix) /* 12 */
#endif
-#ifndef TclpInetNtoa
-#define TclpInetNtoa \
- (tclIntPlatStubsPtr->tclpInetNtoa) /* 13 */
+#ifndef TclIntPlatReserved13
+#define TclIntPlatReserved13 \
+ (tclIntPlatStubsPtr->tclIntPlatReserved13) /* 13 */
#endif
#ifndef TclUnixCopyFile
#define TclUnixCopyFile \
@@ -949,6 +1061,34 @@ extern TclIntPlatStubs *tclIntPlatStubsPtr;
#define TclpCloseFile \
(tclIntPlatStubsPtr->tclpCloseFile) /* 31 */
#endif
+#ifndef TclpCreateCommandChannel
+#define TclpCreateCommandChannel \
+ (tclIntPlatStubsPtr->tclpCreateCommandChannel) /* 32 */
+#endif
+#ifndef TclpCreatePipe
+#define TclpCreatePipe \
+ (tclIntPlatStubsPtr->tclpCreatePipe) /* 33 */
+#endif
+#ifndef TclpCreateProcess
+#define TclpCreateProcess \
+ (tclIntPlatStubsPtr->tclpCreateProcess) /* 34 */
+#endif
+#ifndef TclpInetNtoa
+#define TclpInetNtoa \
+ (tclIntPlatStubsPtr->tclpInetNtoa) /* 35 */
+#endif
+#ifndef TclpMakeFile
+#define TclpMakeFile \
+ (tclIntPlatStubsPtr->tclpMakeFile) /* 36 */
+#endif
+#ifndef TclpOpenFile
+#define TclpOpenFile \
+ (tclIntPlatStubsPtr->tclpOpenFile) /* 37 */
+#endif
+#ifndef TclUnixWaitForFile
+#define TclUnixWaitForFile \
+ (tclIntPlatStubsPtr->tclUnixWaitForFile) /* 38 */
+#endif
#endif /* MACOSX */
#endif /* defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS) */
@@ -959,8 +1099,17 @@ extern TclIntPlatStubs *tclIntPlatStubsPtr;
#define TCL_STORAGE_CLASS DLLIMPORT
#undef TclpLocaltime_unix
#undef TclpGmtime_unix
+#undef TclIntPlatReserved13
+
+#if !defined(__WIN32__)
+# undef TclpGetPid
+# define TclpGetPid(pid) ((unsigned long) (pid))
-#if !defined(__WIN32__) && defined(USE_TCL_STUBS)
+# if defined(USE_TCL_STUBS)
+# undef TclpCreateProcess
+# undef TclpMakeFile
+# undef TclpOpenFile
+# undef TclpCreateCommandChannel
# ifdef __CYGWIN__
# define TclpCreateProcess ((int (*) _ANSI_ARGS_((Tcl_Interp *, int, \
CONST char **, TclFile, TclFile, TclFile, Tcl_Pid *))) \
@@ -969,6 +1118,8 @@ extern TclIntPlatStubs *tclIntPlatStubsPtr;
int direction))) tclIntPlatStubsPtr->tclMacOSXMatchType)
# define TclpOpenFile ((TclFile (*) _ANSI_ARGS_((CONST char *, int))) \
tclIntPlatStubsPtr->tclMacOSXNotifierAddRunLoopMode)
+# define TclpCreateCommandChannel ((Tcl_Channel (*) _ANSI_ARGS_((TclFile, TclFile, \
+ TclFile, int, Tcl_Pid *))) tclIntPlatStubsPtr->tclIntPlatReserved13)
# else
# define TclpCreateProcess ((int (*) _ANSI_ARGS_((Tcl_Interp *, int, \
CONST char **, TclFile, TclFile, TclFile, Tcl_Pid *))) \
@@ -976,11 +1127,16 @@ extern TclIntPlatStubs *tclIntPlatStubsPtr;
# define TclpMakeFile ((TclFile (*) _ANSI_ARGS_((Tcl_Channel channel, \
int direction))) tclIntPlatStubsPtr->tclWinNToHS)
# define TclpOpenFile ((TclFile (*) _ANSI_ARGS_((CONST char *, int))) \
- tclIntPlatStubsPtr->tclWinNToHS)
+ tclIntPlatStubsPtr->tclWinSetSockOpt)
+# define TclpCreateCommandChannel ((Tcl_Channel (*) _ANSI_ARGS_((TclFile, TclFile, \
+ TclFile, int, Tcl_Pid *))) tclIntPlatStubsPtr->tclWinGetServByName)
# undef TclpCreateTempFile
# undef TclGetAndDetachPids
# undef TclpCloseFile
+# undef TclpCreatePipe
+# undef TclpInetNtoa
+# undef TclUnixWaitForFile
# define TclpCreateTempFile ((TclFile (*) _ANSI_ARGS_((CONST char *))) \
tclIntPlatStubsPtr->tclWinGetPlatformId)
@@ -988,7 +1144,14 @@ extern TclIntPlatStubs *tclIntPlatStubsPtr;
tclIntPlatStubsPtr->tclWinConvertError)
# define TclpCloseFile ((int (*) _ANSI_ARGS_((TclFile))) \
tclIntPlatStubsPtr->tclWinConvertWSAError)
-# endif
+# define TclpCreatePipe ((int (*)_ANSI_ARGS_((TclFile *, TclFile *))) \
+ tclIntPlatStubsPtr->tclWinGetSockOpt)
+# define TclpInetNtoa ((char *(*) _ANSI_ARGS_((struct in_addr addr))) \
+ tclIntPlatStubsPtr->tclIntPlatReserved13)
+# define TclUnixWaitForFile (int (*) _ANSI_ARGS_((int, int, int))) \
+ tclIntPlatStubsPtr->tclpGetPid)
+# endif
+# endif
#endif
#endif /* _TCLINTPLATDECLS */
diff --git a/generic/tclPipe.c b/generic/tclPipe.c
index dd70e5e..698f85d 100644
--- a/generic/tclPipe.c
+++ b/generic/tclPipe.c
@@ -280,7 +280,7 @@ TclCleanupChildren(
for (i = 0; i < numPids; i++) {
/*
* We need to get the resolved pid before we wait on it as the windows
- * implimentation of Tcl_WaitPid deletes the information such that any
+ * implementation of Tcl_WaitPid deletes the information such that any
* following calls to TclpGetPid fail.
*/
diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c
index e28a5c7..8a85919 100644
--- a/generic/tclStubInit.c
+++ b/generic/tclStubInit.c
@@ -31,6 +31,7 @@
#undef Tcl_ValidateAllMemory
#undef Tcl_FindHashEntry
#undef Tcl_CreateHashEntry
+#undef TclpGetPid
#undef TclSockMinimumBuffers
/*
@@ -87,11 +88,15 @@ int __stdcall GetModuleHandleExW(unsigned int, const char *, void *);
#define TclWinGetTclInstance winGetTclInstance
#define TclWinNToHS winNToHS
#define TclWinSetSockOpt winSetSockOpt
+#define TclWinGetSockOpt winGetSockOpt
+#define TclWinGetServByName winGetServByName
#define TclWinNoBackslash winNoBackslash
#define TclWinSetInterfaces (void (*) (int)) doNothing
#define TclWinAddProcess (void (*) (void *, unsigned int)) doNothing
+#define TclIntPlatReserved13 (void (*) ()) TclpCreateCommandChannel
#define TclWinFlushDirtyChannels doNothing
#define TclWinResetInterfaces doNothing
+#define TclpGetPid getPid
static Tcl_Encoding winTCharEncoding;
@@ -124,6 +129,19 @@ TclWinSetSockOpt(void *s, int level, int optname,
return setsockopt((int) s, level, optname, optval, optlen);
}
+static int
+TclWinGetSockOpt(void *s, int level, int optname,
+ char *optval, int *optlen)
+{
+ return getsockopt((int) s, level, optname, optval, optlen);
+}
+
+struct servent *
+TclWinGetServByName(const char *name, const char *proto)
+{
+ return getservbyname(name, proto);
+}
+
static char *
TclWinNoBackslash(char *path)
{
@@ -137,6 +155,12 @@ TclWinNoBackslash(char *path)
return path;
}
+static int
+TclpGetPid(Tcl_Pid pid)
+{
+ return (int) (size_t) pid;
+}
+
static void
doNothing(void)
{
@@ -188,11 +212,15 @@ Tcl_WinTCharToUtf(
# define TclWinGetTclInstance (void *(*)()) TclpCreateProcess
# define TclWinNToHS (unsigned short (*) _ANSI_ARGS_((unsigned short ns))) TclpMakeFile
# define TclWinSetSockOpt (int (*) _ANSI_ARGS_((void *, int, int, const char *, int))) TclpOpenFile
+# define TclWinGetSockOpt (int (*) _ANSI_ARGS_((void *, int, int, char *, int))) TclpCreatePipe
+# define TclWinGetServByName (struct servent *(*) _ANSI_ARGS_((const char *nm, const char *proto))) TclpCreateCommandChannel
+# define TclIntPlatReserved13 (void (*) ()) TclpInetNtoa
# define TclWinAddProcess 0
# define TclWinNoBackslash 0
# define TclWinSetInterfaces 0
# define TclWinFlushDirtyChannels 0
# define TclWinResetInterfaces 0
+# define TclpGetPid 0
# define TclMacOSXGetFileAttribute 0 /* Only implemented in Tcl >= 8.5 */
# define TclMacOSXMatchType 0 /* Only implemented in Tcl >= 8.5 */
# define TclMacOSXNotifierAddRunLoopMode 0 /* Only implemented in Tcl >= 8.5 */
@@ -481,18 +509,18 @@ TclIntPlatStubs tclIntPlatStubs = {
#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
TclWinConvertError, /* 0 */
TclWinConvertWSAError, /* 1 */
- TclpCreateCommandChannel, /* 2 */
- TclpCreatePipe, /* 3 */
+ TclWinGetServByName, /* 2 */
+ TclWinGetSockOpt, /* 3 */
TclWinGetTclInstance, /* 4 */
NULL, /* 5 */
TclWinNToHS, /* 6 */
TclWinSetSockOpt, /* 7 */
- TclUnixWaitForFile, /* 8 */
+ TclpGetPid, /* 8 */
TclWinGetPlatformId, /* 9 */
TclpReaddir, /* 10 */
TclpLocaltime_unix, /* 11 */
TclpGmtime_unix, /* 12 */
- TclpInetNtoa, /* 13 */
+ TclIntPlatReserved13, /* 13 */
TclUnixCopyFile, /* 14 */
TclMacOSXGetFileAttribute, /* 15 */
NULL, /* 16 */
@@ -511,6 +539,13 @@ TclIntPlatStubs tclIntPlatStubs = {
TclWinCPUID, /* 29 */
TclGetAndDetachPids, /* 30 */
TclpCloseFile, /* 31 */
+ TclpCreateCommandChannel, /* 32 */
+ TclpCreatePipe, /* 33 */
+ TclpCreateProcess, /* 34 */
+ TclpInetNtoa, /* 35 */
+ TclpMakeFile, /* 36 */
+ TclpOpenFile, /* 37 */
+ TclUnixWaitForFile, /* 38 */
#endif /* UNIX */
#ifdef __WIN32__ /* WIN */
TclWinConvertError, /* 0 */
@@ -547,18 +582,18 @@ TclIntPlatStubs tclIntPlatStubs = {
#ifdef MAC_OSX_TCL /* MACOSX */
TclWinConvertError, /* 0 */
TclWinConvertWSAError, /* 1 */
- TclpCreateCommandChannel, /* 2 */
- TclpCreatePipe, /* 3 */
+ TclWinGetServByName, /* 2 */
+ TclWinGetSockOpt, /* 3 */
TclWinGetTclInstance, /* 4 */
NULL, /* 5 */
TclWinNToHS, /* 6 */
TclWinSetSockOpt, /* 7 */
- TclUnixWaitForFile, /* 8 */
+ TclpGetPid, /* 8 */
TclWinGetPlatformId, /* 9 */
TclpReaddir, /* 10 */
TclpLocaltime_unix, /* 11 */
TclpGmtime_unix, /* 12 */
- TclpInetNtoa, /* 13 */
+ TclIntPlatReserved13, /* 13 */
TclUnixCopyFile, /* 14 */
TclMacOSXGetFileAttribute, /* 15 */
TclMacOSXSetFileAttribute, /* 16 */
@@ -577,6 +612,13 @@ TclIntPlatStubs tclIntPlatStubs = {
TclWinCPUID, /* 29 */
TclGetAndDetachPids, /* 30 */
TclpCloseFile, /* 31 */
+ TclpCreateCommandChannel, /* 32 */
+ TclpCreatePipe, /* 33 */
+ TclpCreateProcess, /* 34 */
+ TclpInetNtoa, /* 35 */
+ TclpMakeFile, /* 36 */
+ TclpOpenFile, /* 37 */
+ TclUnixWaitForFile, /* 38 */
#endif /* MACOSX */
};
diff --git a/library/dde/pkgIndex.tcl b/library/dde/pkgIndex.tcl
index 3125ada..ce31825 100644
--- a/library/dde/pkgIndex.tcl
+++ b/library/dde/pkgIndex.tcl
@@ -1,5 +1,5 @@
-if {![package vsatisfies [package provide Tcl] 8]} {return}
-if {[string compare $::tcl_platform(platform) windows]} {return}
+if {![package vsatisfies [package provide Tcl] 8]} return
+if {[string compare [info sharedlibextension] .dll]} return
if {[info exists ::tcl_platform(debug)]} {
package ifneeded dde 1.3.2 [list load [file join $dir tcldde13g.dll] dde]
} else {
diff --git a/library/reg/pkgIndex.tcl b/library/reg/pkgIndex.tcl
index d2ed72f..6fa8eda 100755
--- a/library/reg/pkgIndex.tcl
+++ b/library/reg/pkgIndex.tcl
@@ -1,5 +1,5 @@
-if {![package vsatisfies [package provide Tcl] 8]} {return}
-if {[string compare $::tcl_platform(platform) windows]} {return}
+if {![package vsatisfies [package provide Tcl] 8]} return
+if {[string compare [info sharedlibextension] .dll]} return
if {[info exists ::tcl_platform(debug)]} {
package ifneeded registry 1.2.1 \
[list load [file join $dir tclreg12g.dll] registry]
diff --git a/unix/Makefile.in b/unix/Makefile.in
index c88736c..883a379 100644
--- a/unix/Makefile.in
+++ b/unix/Makefile.in
@@ -47,6 +47,7 @@ BIN_INSTALL_DIR = $(INSTALL_ROOT)$(bindir)
# Directory in which to install libtcl.so or libtcl.a:
LIB_INSTALL_DIR = $(INSTALL_ROOT)$(libdir)
+DLL_INSTALL_DIR = @DLL_INSTALL_DIR@
# Path name to use when installing library scripts.
SCRIPT_INSTALL_DIR = $(INSTALL_ROOT)$(TCL_LIBRARY)
@@ -719,9 +720,9 @@ install-binaries: binaries
@if test ! -x $(SRC_DIR)/../unix/install-sh; then \
chmod +x $(SRC_DIR)/../unix/install-sh; \
fi
- @echo "Installing $(LIB_FILE) to $(LIB_INSTALL_DIR)/"
+ @echo "Installing $(LIB_FILE) to $(DLL_INSTALL_DIR)/"
@@INSTALL_LIB@
- @chmod 555 "$(LIB_INSTALL_DIR)"/$(LIB_FILE)
+ @chmod 555 "$(DLL_INSTALL_DIR)"/$(LIB_FILE)
@echo "Installing ${TCL_EXE} as $(BIN_INSTALL_DIR)/tclsh$(VERSION)@EXEEXT@"
@$(INSTALL_PROGRAM) ${TCL_EXE} "$(BIN_INSTALL_DIR)"/tclsh$(VERSION)@EXEEXT@
@echo "Installing tclConfig.sh to $(CONFIG_INSTALL_DIR)/"
diff --git a/unix/configure b/unix/configure
index 67ae68b..df67e5d 100755
--- a/unix/configure
+++ b/unix/configure
@@ -308,7 +308,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS MAN_FLAGS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP TCL_THREADS RANLIB ac_ct_RANLIB AR ac_ct_AR TCL_LIBS DL_LIBS DL_OBJS PLAT_OBJS PLAT_SRCS LDAIX_SRC CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING LDFLAGS_DEBUG LDFLAGS_OPTIMIZE CC_SEARCH_FLAGS LD_SEARCH_FLAGS STLIB_LD SHLIB_LD TCL_SHLIB_LD_EXTRAS TK_SHLIB_LD_EXTRAS SHLIB_LD_LIBS SHLIB_CFLAGS SHLIB_SUFFIX MAKE_LIB MAKE_STUB_LIB INSTALL_LIB INSTALL_STUB_LIB CFLAGS_DEFAULT LDFLAGS_DEFAULT LIBOBJS DTRACE TCL_VERSION TCL_MAJOR_VERSION TCL_MINOR_VERSION TCL_PATCH_LEVEL TCL_YEAR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_STUB_LIB_PATH TCL_INCLUDE_SPEC TCL_BUILD_STUB_LIB_SPEC TCL_BUILD_STUB_LIB_PATH TCL_SRC_DIR CFG_TCL_SHARED_LIB_SUFFIX CFG_TCL_UNSHARED_LIB_SUFFIX TCL_SHARED_BUILD LD_LIBRARY_PATH_VAR TCL_BUILD_LIB_SPEC TCL_LIB_VERSIONS_OK TCL_SHARED_LIB_SUFFIX TCL_UNSHARED_LIB_SUFFIX TCL_HAS_LONGLONG INSTALL_TZDATA DTRACE_SRC DTRACE_HDR DTRACE_OBJ MAKEFILE_SHELL BUILD_DLTEST TCL_PACKAGE_PATH TCL_MODULE_PATH TCL_LIBRARY PRIVATE_INCLUDE_DIR HTML_DIR EXTRA_CC_SWITCHES EXTRA_APP_CC_SWITCHES EXTRA_INSTALL EXTRA_INSTALL_BINARIES EXTRA_BUILD_HTML EXTRA_TCLSH_LIBS DLTEST_LD DLTEST_SUFFIX'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS MAN_FLAGS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP TCL_THREADS RANLIB ac_ct_RANLIB AR ac_ct_AR TCL_LIBS DL_LIBS DL_OBJS PLAT_OBJS PLAT_SRCS LDAIX_SRC CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING LDFLAGS_DEBUG LDFLAGS_OPTIMIZE CC_SEARCH_FLAGS LD_SEARCH_FLAGS STLIB_LD SHLIB_LD TCL_SHLIB_LD_EXTRAS TK_SHLIB_LD_EXTRAS SHLIB_LD_LIBS SHLIB_CFLAGS SHLIB_SUFFIX MAKE_LIB MAKE_STUB_LIB INSTALL_LIB DLL_INSTALL_DIR INSTALL_STUB_LIB CFLAGS_DEFAULT LDFLAGS_DEFAULT LIBOBJS DTRACE TCL_VERSION TCL_MAJOR_VERSION TCL_MINOR_VERSION TCL_PATCH_LEVEL TCL_YEAR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_STUB_LIB_PATH TCL_INCLUDE_SPEC TCL_BUILD_STUB_LIB_SPEC TCL_BUILD_STUB_LIB_PATH TCL_SRC_DIR CFG_TCL_SHARED_LIB_SUFFIX CFG_TCL_UNSHARED_LIB_SUFFIX TCL_SHARED_BUILD LD_LIBRARY_PATH_VAR TCL_BUILD_LIB_SPEC TCL_LIB_VERSIONS_OK TCL_SHARED_LIB_SUFFIX TCL_UNSHARED_LIB_SUFFIX TCL_HAS_LONGLONG INSTALL_TZDATA DTRACE_SRC DTRACE_HDR DTRACE_OBJ MAKEFILE_SHELL BUILD_DLTEST TCL_PACKAGE_PATH TCL_MODULE_PATH TCL_LIBRARY PRIVATE_INCLUDE_DIR HTML_DIR EXTRA_CC_SWITCHES EXTRA_APP_CC_SWITCHES EXTRA_INSTALL EXTRA_INSTALL_BINARIES EXTRA_BUILD_HTML EXTRA_TCLSH_LIBS DLTEST_LD DLTEST_SUFFIX'
ac_subst_files=''
# Initialize some variables set by options.
@@ -8961,12 +8961,23 @@ fi
UNSHARED_LIB_SUFFIX='${VERSION}.a'
fi
+ DLL_INSTALL_DIR="\$(LIB_INSTALL_DIR)"
if test "${SHARED_BUILD}" = 1 -a "${SHLIB_SUFFIX}" != ""; then
LIB_SUFFIX=${SHARED_LIB_SUFFIX}
MAKE_LIB='${SHLIB_LD} -o $@ ${OBJS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}'
- INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)"/$(LIB_FILE)'
+ if test "${SHLIB_SUFFIX}" = ".dll"; then
+
+ INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(BIN_INSTALL_DIR)/$(LIB_FILE)'
+ DLL_INSTALL_DIR="\$(BIN_INSTALL_DIR)"
+
+else
+
+ INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE)'
+
+fi
+
else
@@ -9122,6 +9133,7 @@ _ACEOF
+
echo "$as_me:$LINENO: checking for build with symbols" >&5
echo $ECHO_N "checking for build with symbols... $ECHO_C" >&6
# Check whether --enable-symbols or --disable-symbols was given.
@@ -18893,6 +18905,76 @@ _ACEOF
fi
#--------------------------------------------------------------------
+# The check below checks whether the cpuid instruction is usable.
+#--------------------------------------------------------------------
+
+echo "$as_me:$LINENO: checking whether the cpuid instruction is usable" >&5
+echo $ECHO_N "checking whether the cpuid instruction is usable... $ECHO_C" >&6
+if test "${tcl_cv_cpuid+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ int index,ax,bx,cx,dx;
+ __asm__ __volatile__ ("cpuid":\
+ "=a" (ax), "=b" (bx), "=c" (cx), "=d" (dx) : "a" (index));
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ tcl_cv_cpuid=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_cpuid=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $tcl_cv_cpuid" >&5
+echo "${ECHO_T}$tcl_cv_cpuid" >&6
+if test $tcl_cv_cpuid = yes; then
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_CPUID 1
+_ACEOF
+
+fi
+
+#--------------------------------------------------------------------
# The statements below define a collection of symbols related to
# building libtcl as a shared library instead of a static library.
#--------------------------------------------------------------------
@@ -19802,6 +19884,7 @@ s,@SHLIB_SUFFIX@,$SHLIB_SUFFIX,;t t
s,@MAKE_LIB@,$MAKE_LIB,;t t
s,@MAKE_STUB_LIB@,$MAKE_STUB_LIB,;t t
s,@INSTALL_LIB@,$INSTALL_LIB,;t t
+s,@DLL_INSTALL_DIR@,$DLL_INSTALL_DIR,;t t
s,@INSTALL_STUB_LIB@,$INSTALL_STUB_LIB,;t t
s,@CFLAGS_DEFAULT@,$CFLAGS_DEFAULT,;t t
s,@LDFLAGS_DEFAULT@,$LDFLAGS_DEFAULT,;t t
diff --git a/unix/configure.in b/unix/configure.in
index b3df242..b2cf87a 100644
--- a/unix/configure.in
+++ b/unix/configure.in
@@ -726,6 +726,20 @@ elif test $tcl_cv_stack_grows_up = yes; then
fi
#--------------------------------------------------------------------
+# The check below checks whether the cpuid instruction is usable.
+#--------------------------------------------------------------------
+
+AC_CACHE_CHECK([whether the cpuid instruction is usable], tcl_cv_cpuid, [
+ AC_TRY_LINK(, [
+ int index,ax,bx,cx,dx;
+ __asm__ __volatile__ ("cpuid":\
+ "=a" (ax), "=b" (bx), "=c" (cx), "=d" (dx) : "a" (index));
+ ], tcl_cv_cpuid=yes, tcl_cv_cpuid=no)])
+if test $tcl_cv_cpuid = yes; then
+ AC_DEFINE(HAVE_CPUID)
+fi
+
+#--------------------------------------------------------------------
# The statements below define a collection of symbols related to
# building libtcl as a shared library instead of a static library.
#--------------------------------------------------------------------
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index 4ccb37e..4e0ac62 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -2093,11 +2093,17 @@ dnl # preprocessing tests use only CPPFLAGS.
SHARED_LIB_SUFFIX='${VERSION}${SHLIB_SUFFIX}'])
AS_IF([test "$UNSHARED_LIB_SUFFIX" = ""], [
UNSHARED_LIB_SUFFIX='${VERSION}.a'])
+ DLL_INSTALL_DIR="\$(LIB_INSTALL_DIR)"
AS_IF([test "${SHARED_BUILD}" = 1 -a "${SHLIB_SUFFIX}" != ""], [
LIB_SUFFIX=${SHARED_LIB_SUFFIX}
MAKE_LIB='${SHLIB_LD} -o [$]@ ${OBJS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}'
- INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)"/$(LIB_FILE)'
+ AS_IF([test "${SHLIB_SUFFIX}" = ".dll"], [
+ INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(BIN_INSTALL_DIR)/$(LIB_FILE)'
+ DLL_INSTALL_DIR="\$(BIN_INSTALL_DIR)"
+ ], [
+ INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE)'
+ ])
], [
LIB_SUFFIX=${UNSHARED_LIB_SUFFIX}
@@ -2178,6 +2184,7 @@ dnl # preprocessing tests use only CPPFLAGS.
AC_SUBST(MAKE_LIB)
AC_SUBST(MAKE_STUB_LIB)
AC_SUBST(INSTALL_LIB)
+ AC_SUBST(DLL_INSTALL_DIR)
AC_SUBST(INSTALL_STUB_LIB)
AC_SUBST(RANLIB)
])
diff --git a/unix/tclUnixCompat.c b/unix/tclUnixCompat.c
index 782d70c..22573e4 100644
--- a/unix/tclUnixCompat.c
+++ b/unix/tclUnixCompat.c
@@ -820,7 +820,11 @@ TclWinCPUID(
{
int status = TCL_ERROR;
- /* There is no reason this couldn't be implemented on UNIX as well */
+#ifdef HAVE_CPUID
+ __asm__ __volatile__ ("cpuid":\
+ "=a" (regsPtr[0]), "=b" (regsPtr[1]), "=c" (regsPtr[2]), "=d" (regsPtr[3]) : "a" (index));
+ status = TCL_OK;
+#endif
return status;
}
diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c
index 7d82d1d..dc5af66 100644
--- a/unix/tclUnixFile.c
+++ b/unix/tclUnixFile.c
@@ -22,7 +22,8 @@ static int NativeMatchType(Tcl_Interp *interp, CONST char* nativeEntry,
* TclpFindExecutable --
*
* This function computes the absolute path name of the current
- * application, given its argv[0] value.
+ * application, given its argv[0] value. For Cygwin, argv[0] is
+ * ignored and the path is determined the same as under win32.
*
* Results:
* None.
@@ -38,13 +39,40 @@ TclpFindExecutable(
CONST char *argv0) /* The value of the application's argv[0]
* (native). */
{
+ int length;
+#ifdef __CYGWIN__
+ char buf[PATH_MAX * TCL_UTF_MAX + 1];
+ char name[PATH_MAX * TCL_UTF_MAX + 1];
+#else
CONST char *name, *p;
Tcl_StatBuf statBuf;
Tcl_DString buffer, nameString, cwd, utfName;
Tcl_Encoding encoding;
+#endif
+
+#ifdef __CYGWIN__
+ /* 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,
+ const char *, int, const char *, const char *);
+
+ GetModuleFileNameW(NULL, name, PATH_MAX);
+ WideCharToMultiByte(CP_UTF8, 0, name, -1, buf, PATH_MAX, NULL, NULL);
+ cygwin_conv_to_full_posix_path(buf, name);
+ length = strlen(name);
+ if ((length > 4) && !strcasecmp(name + length - 4, ".exe")) {
+ /* Strip '.exe' part. */
+ length -= 4;
+ }
+ tclNativeExecutableName = (char *) ckalloc(length + 1);
+ memcpy(tclNativeExecutableName, name, length);
+ buf[length] = '\0';
+#else
if (argv0 == NULL) {
- return;
+ return NULL;
}
Tcl_DStringInit(&buffer);
@@ -174,6 +202,7 @@ TclpFindExecutable(
done:
Tcl_DStringFree(&buffer);
+#endif
}
/*
diff --git a/unix/tclUnixPort.h b/unix/tclUnixPort.h
index 82fc8bb..0b767d6 100644
--- a/unix/tclUnixPort.h
+++ b/unix/tclUnixPort.h
@@ -584,7 +584,6 @@ typedef int socklen_t;
* address platform-specific issues.
*/
-#define TclpGetPid(pid) ((unsigned long) (pid))
#define TclpReleaseFile(file) /* Nothing. */
/*
@@ -605,7 +604,6 @@ typedef int socklen_t;
#ifdef TCL_THREADS
EXTERN struct tm * TclpLocaltime(CONST time_t *);
EXTERN struct tm * TclpGmtime(CONST time_t *);
-EXTERN char * TclpInetNtoa(struct in_addr);
/* #define localtime(x) TclpLocaltime(x)
* #define gmtime(x) TclpGmtime(x) */
# undef inet_ntoa
diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c
index 842228a..b1affe3 100644
--- a/win/tclWinPipe.c
+++ b/win/tclWinPipe.c
@@ -869,7 +869,7 @@ TclpCloseFile(
*--------------------------------------------------------------------------
*/
-unsigned long
+int
TclpGetPid(
Tcl_Pid pid) /* The HANDLE of the child process. */
{