summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-05-03 11:42:31 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-05-03 11:42:31 (GMT)
commitf2d051b8afa1a1d9acf943607988e4c911ed2d3c (patch)
tree0fe7c3557422b4961634ae6cb04385ba56531d6e
parent712d308e92f67f88efc00a5e35e270f8821490a4 (diff)
downloadtcl-f2d051b8afa1a1d9acf943607988e4c911ed2d3c.zip
tcl-f2d051b8afa1a1d9acf943607988e4c911ed2d3c.tar.gz
tcl-f2d051b8afa1a1d9acf943607988e4c911ed2d3c.tar.bz2
Move cpuid testcase from win-specific to generic tests
Simplify stub tables for functions which work on both UNIX and windows
-rw-r--r--ChangeLog6
-rw-r--r--generic/tcl.decls8
-rw-r--r--generic/tclCkalloc.c9
-rw-r--r--generic/tclDecls.h73
-rw-r--r--generic/tclInt.decls11
-rw-r--r--generic/tclIntDecls.h95
-rw-r--r--generic/tclIntPlatDecls.h10
-rw-r--r--generic/tclStubInit.c81
-rw-r--r--generic/tclTest.c70
-rw-r--r--tests/platform.test10
-rwxr-xr-xunix/configure2
-rw-r--r--unix/configure.in2
-rw-r--r--unix/tclUnixCompat.c2
-rw-r--r--unix/tclUnixFile.c8
-rw-r--r--unix/tclUnixPort.h18
-rw-r--r--win/tclWinTest.c62
16 files changed, 137 insertions, 330 deletions
diff --git a/ChangeLog b/ChangeLog
index 22793e9..263d2c9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,12 @@
* generic/configure.in: Better detection and implementation for cpuid
* generic/configure: instruction on Intel-derived processors, both
* generic/tclUnixCompat.c: 32-bit and 64-bit.
+ * generic/tclTest.c: Move cpuid testcase from win-specific to generic
+ * win/tclWinTest.c: tests, as it should work on all Intel-related
+ * tests/platform.test: platforms now
+ * generic/tcl.decls: Simplify stub tables for functions which work on
+ * generic/tclInt.decls: both UNIX and windows, as in Tcl 8.5 and 8.6
+ * generic/tcl*Decls.h:
2012-04-27 Donal K. Fellows <dkf@users.sf.net>
diff --git a/generic/tcl.decls b/generic/tcl.decls
index a061c76..41e3d1d 100644
--- a/generic/tcl.decls
+++ b/generic/tcl.decls
@@ -49,7 +49,7 @@ declare 6 {
char *Tcl_DbCkalloc(unsigned int size, const char *file, int line)
}
declare 7 {
- int Tcl_DbCkfree(char *ptr, const char *file, int line)
+ void Tcl_DbCkfree(char *ptr, const char *file, int line)
}
declare 8 {
char *Tcl_DbCkrealloc(char *ptr, unsigned int size,
@@ -408,7 +408,7 @@ declare 109 {
declare 110 {
void Tcl_DeleteInterp(Tcl_Interp *interp)
}
-declare 111 {unix win} {
+declare 111 {
void Tcl_DetachPids(int numPids, Tcl_Pid *pidPtr)
}
declare 112 {
@@ -699,7 +699,7 @@ declare 196 {
Tcl_Obj *Tcl_ObjSetVar2(Tcl_Interp *interp, Tcl_Obj *part1Ptr,
Tcl_Obj *part2Ptr, Tcl_Obj *newValuePtr, int flags)
}
-declare 197 {unix win} {
+declare 197 {
Tcl_Channel Tcl_OpenCommandChannel(Tcl_Interp *interp, int argc,
CONST84 char **argv, int flags)
}
@@ -735,7 +735,7 @@ declare 205 {
declare 206 {
int Tcl_Read(Tcl_Channel chan, char *bufPtr, int toRead)
}
-declare 207 {unix win} {
+declare 207 {
void Tcl_ReapDetachedProcs(void)
}
declare 208 {
diff --git a/generic/tclCkalloc.c b/generic/tclCkalloc.c
index e81eaea..a9d98ec 100644
--- a/generic/tclCkalloc.c
+++ b/generic/tclCkalloc.c
@@ -557,7 +557,7 @@ Tcl_AttemptDbCkalloc(size, file, line)
*----------------------------------------------------------------------
*/
-int
+void
Tcl_DbCkfree(ptr, file, line)
char *ptr;
CONST char *file;
@@ -566,7 +566,7 @@ Tcl_DbCkfree(ptr, file, line)
struct mem_header *memp;
if (ptr == NULL) {
- return 0;
+ return;
}
/*
@@ -616,8 +616,6 @@ Tcl_DbCkfree(ptr, file, line)
allocHead = memp->flink;
TclpFree((char *) memp);
Tcl_MutexUnlock(ckallocMutexPtr);
-
- return 0;
}
/*
@@ -1167,14 +1165,13 @@ Tcl_Free (ptr)
TclpFree(ptr);
}
-int
+void
Tcl_DbCkfree(ptr, file, line)
char *ptr;
CONST char *file;
int line;
{
TclpFree(ptr);
- return 0;
}
/*
diff --git a/generic/tclDecls.h b/generic/tclDecls.h
index c3b2d55..9261a1a 100644
--- a/generic/tclDecls.h
+++ b/generic/tclDecls.h
@@ -46,7 +46,7 @@ EXTERN char * Tcl_Realloc _ANSI_ARGS_((char *ptr,
EXTERN char * Tcl_DbCkalloc _ANSI_ARGS_((unsigned int size,
CONST char *file, int line));
/* 7 */
-EXTERN int Tcl_DbCkfree _ANSI_ARGS_((char *ptr,
+EXTERN void Tcl_DbCkfree _ANSI_ARGS_((char *ptr,
CONST char *file, int line));
/* 8 */
EXTERN char * Tcl_DbCkrealloc _ANSI_ARGS_((char *ptr,
@@ -371,16 +371,9 @@ EXTERN void Tcl_DeleteHashTable _ANSI_ARGS_((
Tcl_HashTable *tablePtr));
/* 110 */
EXTERN void Tcl_DeleteInterp _ANSI_ARGS_((Tcl_Interp *interp));
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
/* 111 */
EXTERN void Tcl_DetachPids _ANSI_ARGS_((int numPids,
Tcl_Pid *pidPtr));
-#endif /* UNIX */
-#ifdef __WIN32__
-/* 111 */
-EXTERN void Tcl_DetachPids _ANSI_ARGS_((int numPids,
- Tcl_Pid *pidPtr));
-#endif /* __WIN32__ */
/* 112 */
EXTERN void Tcl_DeleteTimerHandler _ANSI_ARGS_((
Tcl_TimerToken token));
@@ -628,18 +621,10 @@ EXTERN Tcl_Obj * Tcl_ObjGetVar2 _ANSI_ARGS_((Tcl_Interp *interp,
EXTERN Tcl_Obj * Tcl_ObjSetVar2 _ANSI_ARGS_((Tcl_Interp *interp,
Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr,
Tcl_Obj *newValuePtr, int flags));
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
/* 197 */
EXTERN Tcl_Channel Tcl_OpenCommandChannel _ANSI_ARGS_((
Tcl_Interp *interp, int argc,
CONST84 char **argv, int flags));
-#endif /* UNIX */
-#ifdef __WIN32__
-/* 197 */
-EXTERN Tcl_Channel Tcl_OpenCommandChannel _ANSI_ARGS_((
- Tcl_Interp *interp, int argc,
- CONST84 char **argv, int flags));
-#endif /* __WIN32__ */
/* 198 */
EXTERN Tcl_Channel Tcl_OpenFileChannel _ANSI_ARGS_((Tcl_Interp *interp,
CONST char *fileName, CONST char *modeString,
@@ -668,14 +653,8 @@ EXTERN void Tcl_QueueEvent _ANSI_ARGS_((Tcl_Event *evPtr,
/* 206 */
EXTERN int Tcl_Read _ANSI_ARGS_((Tcl_Channel chan, char *bufPtr,
int toRead));
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
/* 207 */
EXTERN void Tcl_ReapDetachedProcs _ANSI_ARGS_((void));
-#endif /* UNIX */
-#ifdef __WIN32__
-/* 207 */
-EXTERN void Tcl_ReapDetachedProcs _ANSI_ARGS_((void));
-#endif /* __WIN32__ */
/* 208 */
EXTERN int Tcl_RecordAndEval _ANSI_ARGS_((Tcl_Interp *interp,
CONST char *cmd, int flags));
@@ -1653,7 +1632,7 @@ typedef struct TclStubs {
void (*tcl_Free) _ANSI_ARGS_((char *ptr)); /* 4 */
char * (*tcl_Realloc) _ANSI_ARGS_((char *ptr, unsigned int size)); /* 5 */
char * (*tcl_DbCkalloc) _ANSI_ARGS_((unsigned int size, CONST char *file, int line)); /* 6 */
- int (*tcl_DbCkfree) _ANSI_ARGS_((char *ptr, CONST char *file, int line)); /* 7 */
+ void (*tcl_DbCkfree) _ANSI_ARGS_((char *ptr, CONST char *file, int line)); /* 7 */
char * (*tcl_DbCkrealloc) _ANSI_ARGS_((char *ptr, unsigned int size, CONST char *file, int line)); /* 8 */
#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
void (*tcl_CreateFileHandler) _ANSI_ARGS_((int fd, int mask, Tcl_FileProc *proc, ClientData clientData)); /* 9 */
@@ -1773,15 +1752,7 @@ typedef struct TclStubs {
void (*tcl_DeleteHashEntry) _ANSI_ARGS_((Tcl_HashEntry *entryPtr)); /* 108 */
void (*tcl_DeleteHashTable) _ANSI_ARGS_((Tcl_HashTable *tablePtr)); /* 109 */
void (*tcl_DeleteInterp) _ANSI_ARGS_((Tcl_Interp *interp)); /* 110 */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- void (*tcl_DetachPids) _ANSI_ARGS_((int numPids, Tcl_Pid *pidPtr)); /* 111 */
-#endif /* UNIX */
-#ifdef __WIN32__
void (*tcl_DetachPids) _ANSI_ARGS_((int numPids, Tcl_Pid *pidPtr)); /* 111 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- VOID *reserved111;
-#endif /* MAC_TCL */
void (*tcl_DeleteTimerHandler) _ANSI_ARGS_((Tcl_TimerToken token)); /* 112 */
void (*tcl_DeleteTrace) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Trace trace)); /* 113 */
void (*tcl_DontCallWhenDeleted) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_InterpDeleteProc *proc, ClientData clientData)); /* 114 */
@@ -1875,15 +1846,7 @@ typedef struct TclStubs {
void (*tcl_NotifyChannel) _ANSI_ARGS_((Tcl_Channel channel, int mask)); /* 194 */
Tcl_Obj * (*tcl_ObjGetVar2) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr, int flags)); /* 195 */
Tcl_Obj * (*tcl_ObjSetVar2) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr, Tcl_Obj *newValuePtr, int flags)); /* 196 */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
Tcl_Channel (*tcl_OpenCommandChannel) _ANSI_ARGS_((Tcl_Interp *interp, int argc, CONST84 char **argv, int flags)); /* 197 */
-#endif /* UNIX */
-#ifdef __WIN32__
- Tcl_Channel (*tcl_OpenCommandChannel) _ANSI_ARGS_((Tcl_Interp *interp, int argc, CONST84 char **argv, int flags)); /* 197 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- VOID *reserved197;
-#endif /* MAC_TCL */
Tcl_Channel (*tcl_OpenFileChannel) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *fileName, CONST char *modeString, int permissions)); /* 198 */
Tcl_Channel (*tcl_OpenTcpClient) _ANSI_ARGS_((Tcl_Interp *interp, int port, CONST char *address, CONST char *myaddr, int myport, int async)); /* 199 */
Tcl_Channel (*tcl_OpenTcpServer) _ANSI_ARGS_((Tcl_Interp *interp, int port, CONST char *host, Tcl_TcpAcceptProc *acceptProc, ClientData callbackData)); /* 200 */
@@ -1893,15 +1856,7 @@ typedef struct TclStubs {
CONST84_RETURN char * (*tcl_PosixError) _ANSI_ARGS_((Tcl_Interp *interp)); /* 204 */
void (*tcl_QueueEvent) _ANSI_ARGS_((Tcl_Event *evPtr, Tcl_QueuePosition position)); /* 205 */
int (*tcl_Read) _ANSI_ARGS_((Tcl_Channel chan, char *bufPtr, int toRead)); /* 206 */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
void (*tcl_ReapDetachedProcs) _ANSI_ARGS_((void)); /* 207 */
-#endif /* UNIX */
-#ifdef __WIN32__
- void (*tcl_ReapDetachedProcs) _ANSI_ARGS_((void)); /* 207 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- VOID *reserved207;
-#endif /* MAC_TCL */
int (*tcl_RecordAndEval) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *cmd, int flags)); /* 208 */
int (*tcl_RecordAndEvalObj) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *cmdPtr, int flags)); /* 209 */
void (*tcl_RegisterChannel) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Channel chan)); /* 210 */
@@ -2732,18 +2687,10 @@ extern TclStubs *tclStubsPtr;
#define Tcl_DeleteInterp \
(tclStubsPtr->tcl_DeleteInterp) /* 110 */
#endif
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
-#ifndef Tcl_DetachPids
-#define Tcl_DetachPids \
- (tclStubsPtr->tcl_DetachPids) /* 111 */
-#endif
-#endif /* UNIX */
-#ifdef __WIN32__
#ifndef Tcl_DetachPids
#define Tcl_DetachPids \
(tclStubsPtr->tcl_DetachPids) /* 111 */
#endif
-#endif /* __WIN32__ */
#ifndef Tcl_DeleteTimerHandler
#define Tcl_DeleteTimerHandler \
(tclStubsPtr->tcl_DeleteTimerHandler) /* 112 */
@@ -3083,18 +3030,10 @@ extern TclStubs *tclStubsPtr;
#define Tcl_ObjSetVar2 \
(tclStubsPtr->tcl_ObjSetVar2) /* 196 */
#endif
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
-#ifndef Tcl_OpenCommandChannel
-#define Tcl_OpenCommandChannel \
- (tclStubsPtr->tcl_OpenCommandChannel) /* 197 */
-#endif
-#endif /* UNIX */
-#ifdef __WIN32__
#ifndef Tcl_OpenCommandChannel
#define Tcl_OpenCommandChannel \
(tclStubsPtr->tcl_OpenCommandChannel) /* 197 */
#endif
-#endif /* __WIN32__ */
#ifndef Tcl_OpenFileChannel
#define Tcl_OpenFileChannel \
(tclStubsPtr->tcl_OpenFileChannel) /* 198 */
@@ -3131,18 +3070,10 @@ extern TclStubs *tclStubsPtr;
#define Tcl_Read \
(tclStubsPtr->tcl_Read) /* 206 */
#endif
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
-#ifndef Tcl_ReapDetachedProcs
-#define Tcl_ReapDetachedProcs \
- (tclStubsPtr->tcl_ReapDetachedProcs) /* 207 */
-#endif
-#endif /* UNIX */
-#ifdef __WIN32__
#ifndef Tcl_ReapDetachedProcs
#define Tcl_ReapDetachedProcs \
(tclStubsPtr->tcl_ReapDetachedProcs) /* 207 */
#endif
-#endif /* __WIN32__ */
#ifndef Tcl_RecordAndEval
#define Tcl_RecordAndEval \
(tclStubsPtr->tcl_RecordAndEval) /* 208 */
diff --git a/generic/tclInt.decls b/generic/tclInt.decls
index ef2f6df..9944ab6 100644
--- a/generic/tclInt.decls
+++ b/generic/tclInt.decls
@@ -40,7 +40,7 @@ declare 3 {
# declare 4 {
# int TclChdir(Tcl_Interp *interp, char *dirName)
# }
-declare 5 {unix win} {
+declare 5 {
int TclCleanupChildren(Tcl_Interp *interp, int numPids, Tcl_Pid *pidPtr,
Tcl_Channel errorChan)
}
@@ -57,7 +57,7 @@ declare 8 {
# TclCreatePipeline unofficially exported for use by BLT.
-declare 9 {unix win} {
+declare 9 {
int TclCreatePipeline(Tcl_Interp *interp, int argc, const char **argv,
Tcl_Pid **pidArrayPtr, TclFile *inPipePtr, TclFile *outPipePtr,
TclFile *errFilePtr)
@@ -407,10 +407,10 @@ declare 103 {
int TclSockGetPort(Tcl_Interp *interp, char *str, char *proto,
int *portPtr)
}
-declare 104 {unix win} {
+declare 104 {
int TclSockMinimumBuffersOld(int sock, int size)
}
-declare 110 {unix win} {
+declare 110 {
int TclSockMinimumBuffers(void *sock, int size)
}
# Replaced by Tcl_FSStat in 8.4:
@@ -1036,6 +1036,9 @@ declare 22 unix {
declare 24 unix {
char *TclWinNoBackslash(char *path)
}
+declare 25 unix {
+ TclPlatformType *TclWinGetPlatform(void)
+}
declare 26 unix {
void TclWinSetInterfaces(int wide)
}
diff --git a/generic/tclIntDecls.h b/generic/tclIntDecls.h
index 94860aa..91db149 100644
--- a/generic/tclIntDecls.h
+++ b/generic/tclIntDecls.h
@@ -37,18 +37,10 @@ EXTERN int TclAccessInsertProc _ANSI_ARGS_((
/* 3 */
EXTERN void TclAllocateFreeObjects _ANSI_ARGS_((void));
/* Slot 4 is reserved */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
/* 5 */
EXTERN int TclCleanupChildren _ANSI_ARGS_((Tcl_Interp *interp,
int numPids, Tcl_Pid *pidPtr,
Tcl_Channel errorChan));
-#endif /* UNIX */
-#ifdef __WIN32__
-/* 5 */
-EXTERN int TclCleanupChildren _ANSI_ARGS_((Tcl_Interp *interp,
- int numPids, Tcl_Pid *pidPtr,
- Tcl_Channel errorChan));
-#endif /* __WIN32__ */
/* 6 */
EXTERN void TclCleanupCommand _ANSI_ARGS_((Command *cmdPtr));
/* 7 */
@@ -58,20 +50,11 @@ EXTERN int TclCopyAndCollapse _ANSI_ARGS_((int count,
EXTERN int TclCopyChannel _ANSI_ARGS_((Tcl_Interp *interp,
Tcl_Channel inChan, Tcl_Channel outChan,
int toRead, Tcl_Obj *cmdPtr));
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
-/* 9 */
-EXTERN int TclCreatePipeline _ANSI_ARGS_((Tcl_Interp *interp,
- int argc, CONST char **argv,
- Tcl_Pid **pidArrayPtr, TclFile *inPipePtr,
- TclFile *outPipePtr, TclFile *errFilePtr));
-#endif /* UNIX */
-#ifdef __WIN32__
/* 9 */
EXTERN int TclCreatePipeline _ANSI_ARGS_((Tcl_Interp *interp,
int argc, CONST char **argv,
Tcl_Pid **pidArrayPtr, TclFile *inPipePtr,
TclFile *outPipePtr, TclFile *errFilePtr));
-#endif /* __WIN32__ */
/* 10 */
EXTERN int TclCreateProc _ANSI_ARGS_((Tcl_Interp *interp,
Namespace *nsPtr, CONST char *procName,
@@ -289,16 +272,9 @@ EXTERN void TclSetupEnv _ANSI_ARGS_((Tcl_Interp *interp));
/* 103 */
EXTERN int TclSockGetPort _ANSI_ARGS_((Tcl_Interp *interp,
char *str, char *proto, int *portPtr));
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
/* 104 */
EXTERN int TclSockMinimumBuffersOld _ANSI_ARGS_((int sock,
int size));
-#endif /* UNIX */
-#ifdef __WIN32__
-/* 104 */
-EXTERN int TclSockMinimumBuffersOld _ANSI_ARGS_((int sock,
- int size));
-#endif /* __WIN32__ */
/* Slot 105 is reserved */
/* 106 */
EXTERN int TclStatDeleteProc _ANSI_ARGS_((TclStatProc_ *proc));
@@ -308,16 +284,9 @@ EXTERN int TclStatInsertProc _ANSI_ARGS_((TclStatProc_ *proc));
EXTERN void TclTeardownNamespace _ANSI_ARGS_((Namespace *nsPtr));
/* 109 */
EXTERN int TclUpdateReturnInfo _ANSI_ARGS_((Interp *iPtr));
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
/* 110 */
EXTERN int TclSockMinimumBuffers _ANSI_ARGS_((VOID *sock,
int size));
-#endif /* UNIX */
-#ifdef __WIN32__
-/* 110 */
-EXTERN int TclSockMinimumBuffers _ANSI_ARGS_((VOID *sock,
- int size));
-#endif /* __WIN32__ */
/* 111 */
EXTERN void Tcl_AddInterpResolvers _ANSI_ARGS_((
Tcl_Interp *interp, CONST char *name,
@@ -546,27 +515,11 @@ typedef struct TclIntStubs {
int (*tclAccessInsertProc) _ANSI_ARGS_((TclAccessProc_ *proc)); /* 2 */
void (*tclAllocateFreeObjects) _ANSI_ARGS_((void)); /* 3 */
VOID *reserved4;
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- int (*tclCleanupChildren) _ANSI_ARGS_((Tcl_Interp *interp, int numPids, Tcl_Pid *pidPtr, Tcl_Channel errorChan)); /* 5 */
-#endif /* UNIX */
-#ifdef __WIN32__
int (*tclCleanupChildren) _ANSI_ARGS_((Tcl_Interp *interp, int numPids, Tcl_Pid *pidPtr, Tcl_Channel errorChan)); /* 5 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- VOID *reserved5;
-#endif /* MAC_TCL */
void (*tclCleanupCommand) _ANSI_ARGS_((Command *cmdPtr)); /* 6 */
int (*tclCopyAndCollapse) _ANSI_ARGS_((int count, CONST char *src, char *dst)); /* 7 */
int (*tclCopyChannel) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Channel inChan, Tcl_Channel outChan, int toRead, Tcl_Obj *cmdPtr)); /* 8 */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
int (*tclCreatePipeline) _ANSI_ARGS_((Tcl_Interp *interp, int argc, CONST char **argv, Tcl_Pid **pidArrayPtr, TclFile *inPipePtr, TclFile *outPipePtr, TclFile *errFilePtr)); /* 9 */
-#endif /* UNIX */
-#ifdef __WIN32__
- int (*tclCreatePipeline) _ANSI_ARGS_((Tcl_Interp *interp, int argc, CONST char **argv, Tcl_Pid **pidArrayPtr, TclFile *inPipePtr, TclFile *outPipePtr, TclFile *errFilePtr)); /* 9 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- VOID *reserved9;
-#endif /* MAC_TCL */
int (*tclCreateProc) _ANSI_ARGS_((Tcl_Interp *interp, Namespace *nsPtr, CONST char *procName, Tcl_Obj *argsPtr, Tcl_Obj *bodyPtr, Proc **procPtrPtr)); /* 10 */
void (*tclDeleteCompiledLocalVars) _ANSI_ARGS_((Interp *iPtr, CallFrame *framePtr)); /* 11 */
void (*tclDeleteVars) _ANSI_ARGS_((Interp *iPtr, Tcl_HashTable *tablePtr)); /* 12 */
@@ -661,29 +614,13 @@ typedef struct TclIntStubs {
char * (*tclSetPreInitScript) _ANSI_ARGS_((char *string)); /* 101 */
void (*tclSetupEnv) _ANSI_ARGS_((Tcl_Interp *interp)); /* 102 */
int (*tclSockGetPort) _ANSI_ARGS_((Tcl_Interp *interp, char *str, char *proto, int *portPtr)); /* 103 */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- int (*tclSockMinimumBuffersOld) _ANSI_ARGS_((int sock, int size)); /* 104 */
-#endif /* UNIX */
-#ifdef __WIN32__
int (*tclSockMinimumBuffersOld) _ANSI_ARGS_((int sock, int size)); /* 104 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- VOID *reserved104;
-#endif /* MAC_TCL */
VOID *reserved105;
int (*tclStatDeleteProc) _ANSI_ARGS_((TclStatProc_ *proc)); /* 106 */
int (*tclStatInsertProc) _ANSI_ARGS_((TclStatProc_ *proc)); /* 107 */
void (*tclTeardownNamespace) _ANSI_ARGS_((Namespace *nsPtr)); /* 108 */
int (*tclUpdateReturnInfo) _ANSI_ARGS_((Interp *iPtr)); /* 109 */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
int (*tclSockMinimumBuffers) _ANSI_ARGS_((VOID *sock, int size)); /* 110 */
-#endif /* UNIX */
-#ifdef __WIN32__
- int (*tclSockMinimumBuffers) _ANSI_ARGS_((VOID *sock, int size)); /* 110 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- VOID *reserved110;
-#endif /* MAC_TCL */
void (*tcl_AddInterpResolvers) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *name, Tcl_ResolveCmdProc *cmdProc, Tcl_ResolveVarProc *varProc, Tcl_ResolveCompiledVarProc *compiledVarProc)); /* 111 */
int (*tcl_AppendExportList) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Namespace *nsPtr, Tcl_Obj *objPtr)); /* 112 */
Tcl_Namespace * (*tcl_CreateNamespace) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *name, ClientData clientData, Tcl_NamespaceDeleteProc *deleteProc)); /* 113 */
@@ -803,18 +740,10 @@ extern TclIntStubs *tclIntStubsPtr;
(tclIntStubsPtr->tclAllocateFreeObjects) /* 3 */
#endif
/* Slot 4 is reserved */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
-#ifndef TclCleanupChildren
-#define TclCleanupChildren \
- (tclIntStubsPtr->tclCleanupChildren) /* 5 */
-#endif
-#endif /* UNIX */
-#ifdef __WIN32__
#ifndef TclCleanupChildren
#define TclCleanupChildren \
(tclIntStubsPtr->tclCleanupChildren) /* 5 */
#endif
-#endif /* __WIN32__ */
#ifndef TclCleanupCommand
#define TclCleanupCommand \
(tclIntStubsPtr->tclCleanupCommand) /* 6 */
@@ -827,18 +756,10 @@ extern TclIntStubs *tclIntStubsPtr;
#define TclCopyChannel \
(tclIntStubsPtr->tclCopyChannel) /* 8 */
#endif
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
-#ifndef TclCreatePipeline
-#define TclCreatePipeline \
- (tclIntStubsPtr->tclCreatePipeline) /* 9 */
-#endif
-#endif /* UNIX */
-#ifdef __WIN32__
#ifndef TclCreatePipeline
#define TclCreatePipeline \
(tclIntStubsPtr->tclCreatePipeline) /* 9 */
#endif
-#endif /* __WIN32__ */
#ifndef TclCreateProc
#define TclCreateProc \
(tclIntStubsPtr->tclCreateProc) /* 10 */
@@ -1119,18 +1040,10 @@ extern TclIntStubs *tclIntStubsPtr;
#define TclSockGetPort \
(tclIntStubsPtr->tclSockGetPort) /* 103 */
#endif
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
#ifndef TclSockMinimumBuffersOld
#define TclSockMinimumBuffersOld \
(tclIntStubsPtr->tclSockMinimumBuffersOld) /* 104 */
#endif
-#endif /* UNIX */
-#ifdef __WIN32__
-#ifndef TclSockMinimumBuffersOld
-#define TclSockMinimumBuffersOld \
- (tclIntStubsPtr->tclSockMinimumBuffersOld) /* 104 */
-#endif
-#endif /* __WIN32__ */
/* Slot 105 is reserved */
#ifndef TclStatDeleteProc
#define TclStatDeleteProc \
@@ -1148,18 +1061,10 @@ extern TclIntStubs *tclIntStubsPtr;
#define TclUpdateReturnInfo \
(tclIntStubsPtr->tclUpdateReturnInfo) /* 109 */
#endif
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
-#ifndef TclSockMinimumBuffers
-#define TclSockMinimumBuffers \
- (tclIntStubsPtr->tclSockMinimumBuffers) /* 110 */
-#endif
-#endif /* UNIX */
-#ifdef __WIN32__
#ifndef TclSockMinimumBuffers
#define TclSockMinimumBuffers \
(tclIntStubsPtr->tclSockMinimumBuffers) /* 110 */
#endif
-#endif /* __WIN32__ */
#ifndef Tcl_AddInterpResolvers
#define Tcl_AddInterpResolvers \
(tclIntStubsPtr->tcl_AddInterpResolvers) /* 111 */
diff --git a/generic/tclIntPlatDecls.h b/generic/tclIntPlatDecls.h
index 63f9fe6..d109506 100644
--- a/generic/tclIntPlatDecls.h
+++ b/generic/tclIntPlatDecls.h
@@ -82,7 +82,8 @@ EXTERN TclFile TclpCreateTempFile _ANSI_ARGS_((CONST char *contents));
/* Slot 23 is reserved */
/* 24 */
EXTERN char * TclWinNoBackslash _ANSI_ARGS_((char *path));
-/* Slot 25 is reserved */
+/* 25 */
+EXTERN TclPlatformType * TclWinGetPlatform _ANSI_ARGS_((void));
/* 26 */
EXTERN void TclWinSetInterfaces _ANSI_ARGS_((int wide));
/* 27 */
@@ -295,7 +296,7 @@ typedef struct TclIntPlatStubs {
TclFile (*tclpCreateTempFile) _ANSI_ARGS_((CONST char *contents)); /* 22 */
VOID *reserved23;
char * (*tclWinNoBackslash) _ANSI_ARGS_((char *path)); /* 24 */
- VOID *reserved25;
+ TclPlatformType * (*tclWinGetPlatform) _ANSI_ARGS_((void)); /* 25 */
void (*tclWinSetInterfaces) _ANSI_ARGS_((int wide)); /* 26 */
void (*tclWinFlushDirtyChannels) _ANSI_ARGS_((void)); /* 27 */
void (*tclWinResetInterfaces) _ANSI_ARGS_((void)); /* 28 */
@@ -470,7 +471,10 @@ extern TclIntPlatStubs *tclIntPlatStubsPtr;
#define TclWinNoBackslash \
(tclIntPlatStubsPtr->tclWinNoBackslash) /* 24 */
#endif
-/* Slot 25 is reserved */
+#ifndef TclWinGetPlatform
+#define TclWinGetPlatform \
+ (tclIntPlatStubsPtr->tclWinGetPlatform) /* 25 */
+#endif
#ifndef TclWinSetInterfaces
#define TclWinSetInterfaces \
(tclIntPlatStubsPtr->tclWinSetInterfaces) /* 26 */
diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c
index 3b39416..1ed349c 100644
--- a/generic/tclStubInit.c
+++ b/generic/tclStubInit.c
@@ -70,12 +70,6 @@ int TclSockMinimumBuffersOld(sock, size)
#endif
#ifdef __CYGWIN__
-
-/* Trick, so we don't have to include <windows.h> here, which
- * - b.t.w. - lacks this function anyway */
-#define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS 0x00000004
-int __stdcall GetModuleHandleExW(unsigned int, const char *, void *);
-
#define TclWinGetPlatformId winGetPlatformId
#define Tcl_WinUtfToTChar winUtfToTChar
#define Tcl_WinTCharToUtf winTCharToUtf
@@ -102,6 +96,12 @@ TclWinGetPlatformId()
return 2; /* VER_PLATFORM_WIN32_NT */;
}
+EXTERN TclPlatformType *
+TclWinGetPlatform()
+{
+ return &tclPlatform;
+}
+
static void *TclWinGetTclInstance()
{
void *hInstance = NULL;
@@ -202,6 +202,7 @@ Tcl_WinTCharToUtf(
#elif !defined(__WIN32__) /* UNIX and MAC */
# define TclWinConvertError (void (*) _ANSI_ARGS_((unsigned int))) TclGetAndDetachPids
# define TclWinConvertWSAError (void (*) _ANSI_ARGS_((unsigned int))) TclpCloseFile
+# define TclWinGetPlatform 0
# define TclWinGetPlatformId (int (*)()) TclpCreateTempFile
# define TclWinGetTclInstance (void *(*)()) TclpCreateProcess
# define TclWinNToHS (unsigned short (*) _ANSI_ARGS_((unsigned short ns))) TclpMakeFile
@@ -226,6 +227,16 @@ Tcl_WinTCharToUtf(
# define TclpGmtime_unix TclpGmtime
#endif
+#ifdef MAC_TCL
+#define Tcl_DetachPids 0
+#define Tcl_OpenCommandChannel 0
+#define Tcl_ReapDetachedProcs 0
+#define TclCleanupChildren 0
+#define TclCreatePipeline 0
+#define TclSockMinimumBuffersOld 0
+#define TclSockMinimumBuffers 0
+#endif
+
/*
* WARNING: The contents of this file is automatically generated by the
* tools/genStubs.tcl script. Any modifications to the function declarations
@@ -242,27 +253,11 @@ TclIntStubs tclIntStubs = {
TclAccessInsertProc, /* 2 */
TclAllocateFreeObjects, /* 3 */
NULL, /* 4 */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- TclCleanupChildren, /* 5 */
-#endif /* UNIX */
-#ifdef __WIN32__
TclCleanupChildren, /* 5 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- NULL, /* 5 */
-#endif /* MAC_TCL */
TclCleanupCommand, /* 6 */
TclCopyAndCollapse, /* 7 */
TclCopyChannel, /* 8 */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- TclCreatePipeline, /* 9 */
-#endif /* UNIX */
-#ifdef __WIN32__
TclCreatePipeline, /* 9 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- NULL, /* 9 */
-#endif /* MAC_TCL */
TclCreateProc, /* 10 */
TclDeleteCompiledLocalVars, /* 11 */
TclDeleteVars, /* 12 */
@@ -357,29 +352,13 @@ TclIntStubs tclIntStubs = {
TclSetPreInitScript, /* 101 */
TclSetupEnv, /* 102 */
TclSockGetPort, /* 103 */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- TclSockMinimumBuffersOld, /* 104 */
-#endif /* UNIX */
-#ifdef __WIN32__
TclSockMinimumBuffersOld, /* 104 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- NULL, /* 104 */
-#endif /* MAC_TCL */
NULL, /* 105 */
TclStatDeleteProc, /* 106 */
TclStatInsertProc, /* 107 */
TclTeardownNamespace, /* 108 */
TclUpdateReturnInfo, /* 109 */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- TclSockMinimumBuffers, /* 110 */
-#endif /* UNIX */
-#ifdef __WIN32__
TclSockMinimumBuffers, /* 110 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- NULL, /* 110 */
-#endif /* MAC_TCL */
Tcl_AddInterpResolvers, /* 111 */
Tcl_AppendExportList, /* 112 */
Tcl_CreateNamespace, /* 113 */
@@ -500,7 +479,7 @@ TclIntPlatStubs tclIntPlatStubs = {
TclpCreateTempFile, /* 22 */
NULL, /* 23 */
TclWinNoBackslash, /* 24 */
- NULL, /* 25 */
+ TclWinGetPlatform, /* 25 */
TclWinSetInterfaces, /* 26 */
TclWinFlushDirtyChannels, /* 27 */
TclWinResetInterfaces, /* 28 */
@@ -738,15 +717,7 @@ TclStubs tclStubs = {
Tcl_DeleteHashEntry, /* 108 */
Tcl_DeleteHashTable, /* 109 */
Tcl_DeleteInterp, /* 110 */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- Tcl_DetachPids, /* 111 */
-#endif /* UNIX */
-#ifdef __WIN32__
Tcl_DetachPids, /* 111 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- NULL, /* 111 */
-#endif /* MAC_TCL */
Tcl_DeleteTimerHandler, /* 112 */
Tcl_DeleteTrace, /* 113 */
Tcl_DontCallWhenDeleted, /* 114 */
@@ -840,15 +811,7 @@ TclStubs tclStubs = {
Tcl_NotifyChannel, /* 194 */
Tcl_ObjGetVar2, /* 195 */
Tcl_ObjSetVar2, /* 196 */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- Tcl_OpenCommandChannel, /* 197 */
-#endif /* UNIX */
-#ifdef __WIN32__
Tcl_OpenCommandChannel, /* 197 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- NULL, /* 197 */
-#endif /* MAC_TCL */
Tcl_OpenFileChannel, /* 198 */
Tcl_OpenTcpClient, /* 199 */
Tcl_OpenTcpServer, /* 200 */
@@ -858,15 +821,7 @@ TclStubs tclStubs = {
Tcl_PosixError, /* 204 */
Tcl_QueueEvent, /* 205 */
Tcl_Read, /* 206 */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- Tcl_ReapDetachedProcs, /* 207 */
-#endif /* UNIX */
-#ifdef __WIN32__
Tcl_ReapDetachedProcs, /* 207 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- NULL, /* 207 */
-#endif /* MAC_TCL */
Tcl_RecordAndEval, /* 208 */
Tcl_RecordAndEvalObj, /* 209 */
Tcl_RegisterChannel, /* 210 */
diff --git a/generic/tclTest.c b/generic/tclTest.c
index b61213d..936d8b3 100644
--- a/generic/tclTest.c
+++ b/generic/tclTest.c
@@ -430,6 +430,10 @@ static Tcl_Obj* SimpleCopy _ANSI_ARGS_ ((Tcl_Obj *pathPtr));
static int TestNumUtfCharsCmd _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *CONST objv[]));
+static int TestcpuidCmd _ANSI_ARGS_(( ClientData dummy,
+ Tcl_Interp* interp,
+ int objc,
+ Tcl_Obj *CONST objv[] ));
static Tcl_Filesystem testReportingFilesystem = {
"reporting",
@@ -695,6 +699,8 @@ Tcltest_Init(interp)
(ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
Tcl_CreateCommand(interp, "testexitmainloop", TestexitmainloopCmd,
(ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
+ Tcl_CreateObjCommand(interp, "testcpuid", TestcpuidCmd,
+ (ClientData) 0, (Tcl_CmdDeleteProc*) NULL );
t3ArgTypes[0] = TCL_EITHER;
t3ArgTypes[1] = TCL_EITHER;
Tcl_CreateMathFunc(interp, "T3", 2, t3ArgTypes, TestMathFunc2,
@@ -2474,7 +2480,7 @@ TestgetplatformCmd(clientData, interp, argc, argv)
static CONST char *platformStrings[] = { "unix", "mac", "windows" };
TclPlatformType *platform;
-#ifdef __WIN32__
+#if defined(__WIN32__) || defined(__CYGWIN__)
platform = TclWinGetPlatform();
#else
platform = &tclPlatform;
@@ -3708,7 +3714,7 @@ TestsetplatformCmd(clientData, interp, argc, argv)
size_t length;
TclPlatformType *platform;
-#ifdef __WIN32__
+#if defined(__WIN32__) || defined(__CYGWIN__)
platform = TclWinGetPlatform();
#else
platform = &tclPlatform;
@@ -6545,3 +6551,63 @@ TestNumUtfCharsCmd(clientData, interp, objc, objv)
}
return TCL_OK;
}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TestcpuidCmd --
+ *
+ * Retrieves CPU ID information.
+ *
+ * Usage:
+ * testcpuid <eax>
+ *
+ * Parameters:
+ * eax - The value to pass in the EAX register to a CPUID instruction.
+ *
+ * Results:
+ * Returns a four-element list containing the values from the
+ * EAX, EBX, ECX and EDX registers returned from the CPUID instruction.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+TestcpuidCmd( ClientData dummy,
+ Tcl_Interp* interp, /* Tcl interpreter */
+ int objc, /* Parameter count */
+ Tcl_Obj *CONST * objv ) /* Parameter vector */
+{
+ int status;
+ int index;
+ unsigned int regs[4];
+ Tcl_Obj * regsObjs[4];
+ int i;
+
+ if ( objc != 2 ) {
+ Tcl_WrongNumArgs( interp, 1, objv, "eax" );
+ return TCL_ERROR;
+ }
+ if ( Tcl_GetIntFromObj( interp, objv[1], &index ) != TCL_OK ) {
+ return TCL_ERROR;
+ }
+#ifdef MAC_TCL
+ status = TCL_ERROR;
+#else
+ status = TclWinCPUID( (unsigned int) index, regs );
+#endif
+ if ( status != TCL_OK ) {
+ Tcl_SetObjResult( interp, Tcl_NewStringObj( "operation not available",
+ -1 ) );
+ return status;
+ }
+ for ( i = 0; i < 4; ++i ) {
+ regsObjs[i] = Tcl_NewIntObj( (int) regs[i] );
+ }
+ Tcl_SetObjResult( interp, Tcl_NewListObj( 4, regsObjs ) );
+ return TCL_OK;
+
+}
diff --git a/tests/platform.test b/tests/platform.test
index d4816d2..223c8db 100644
--- a/tests/platform.test
+++ b/tests/platform.test
@@ -14,7 +14,7 @@ if {[lsearch [namespace children] ::tcltest] == -1} {
namespace import -force ::tcltest::*
}
-testConstraint testWinCPUID [llength [info commands testwincpuid]]
+testConstraint testCPUID [llength [info commands testcpuid]]
test platform-1.1 {TclpSetVariables: tcl_platform} {
interp create i
@@ -38,12 +38,12 @@ test platform-2.1 {tcl_platform(wordSize) indicates size of native word} {
list [expr {$result < 0}] [expr {$result ^ ($result - 1)}]
} {1 -1}
-# On Windows, test that the CPU ID works
+# On Windows/UNIX, test that the CPU ID works
-test platform-3.1 {CPU ID on Windows } \
- -constraints testWinCPUID \
+test platform-3.1 {CPU ID on Windows/UNIX} \
+ -constraints testCPUID \
-body {
- set cpudata [testwincpuid 0]
+ set cpudata [testcpuid 0]
binary format iii \
[lindex $cpudata 1] \
[lindex $cpudata 3] \
diff --git a/unix/configure b/unix/configure
index 4898cfb..5b8621f 100755
--- a/unix/configure
+++ b/unix/configure
@@ -9345,7 +9345,7 @@ int main() {
"mov %%ebx, %%esi \n\t"
"mov %%edi, %%ebx \n\t"
: "=a"(regsPtr[0]), "=S"(regsPtr[1]), "=c"(regsPtr[2]), "=d"(regsPtr[3])
- : "a"(index));
+ : "a"(index) : "edi");
; return 0; }
EOF
diff --git a/unix/configure.in b/unix/configure.in
index 869fbaa..63d7170 100644
--- a/unix/configure.in
+++ b/unix/configure.in
@@ -577,7 +577,7 @@ AC_CACHE_CHECK([whether the cpuid instruction is usable], tcl_cv_cpuid, [
"mov %%ebx, %%esi \n\t"
"mov %%edi, %%ebx \n\t"
: "=a"(regsPtr[0]), "=S"(regsPtr[1]), "=c"(regsPtr[2]), "=d"(regsPtr[3])
- : "a"(index));
+ : "a"(index) : "edi");
], tcl_cv_cpuid=yes, tcl_cv_cpuid=no)])
if test $tcl_cv_cpuid = yes; then
AC_DEFINE(HAVE_CPUID, 1, [Is the cpuid instruction usable?])
diff --git a/unix/tclUnixCompat.c b/unix/tclUnixCompat.c
index 6e2666b..71bd846 100644
--- a/unix/tclUnixCompat.c
+++ b/unix/tclUnixCompat.c
@@ -698,7 +698,7 @@ TclWinCPUID(
"mov %%ebx, %%esi \n\t" /* save what cpuid just put in %ebx */
"mov %%edi, %%ebx \n\t" /* restore the old %ebx */
: "=a"(regsPtr[0]), "=S"(regsPtr[1]), "=c"(regsPtr[2]), "=d"(regsPtr[3])
- : "a"(index));
+ : "a"(index) : "edi");
status = TCL_OK;
#endif
return status;
diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c
index 4ba2e47..56acf6c 100644
--- a/unix/tclUnixFile.c
+++ b/unix/tclUnixFile.c
@@ -61,14 +61,6 @@ TclpFindExecutable(argv0)
}
#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);
diff --git a/unix/tclUnixPort.h b/unix/tclUnixPort.h
index b3133fb..85f2b13 100644
--- a/unix/tclUnixPort.h
+++ b/unix/tclUnixPort.h
@@ -74,12 +74,22 @@ typedef off_t Tcl_SeekOffset;
#endif
#ifdef __CYGWIN__
-# define WSAEWOULDBLOCK 10035
-# define HINSTANCE void *
-# define HANDLE void *
+
+ /* Make some symbols available without including <windows.h> */
# define DWORD unsigned int
+# define CP_UTF8 65001
+# define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS 0x00000004
+# define HANDLE void *
+# define HINSTANCE void *
# define SOCKET unsigned int
-# typedef char TCHAR;
+# define WSAEWOULDBLOCK 10035
+ typedef char TCHAR;
+ DLLIMPORT extern __stdcall int GetModuleHandleExW(unsigned int, const char *, void *);
+ 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 *);
+
+ DLLIMPORT extern int cygwin_conv_to_full_posix_path(const char *, char *);
EXTERN int TclOSstat(const char *name, Tcl_StatBuf *statBuf);
EXTERN int TclOSlstat(const char *name, Tcl_StatBuf *statBuf);
# define NO_FSTATFS
diff --git a/win/tclWinTest.c b/win/tclWinTest.c
index dadd067..c59730d 100644
--- a/win/tclWinTest.c
+++ b/win/tclWinTest.c
@@ -44,10 +44,6 @@ static int TestwinsleepCmd _ANSI_ARGS_(( ClientData dummy,
int objc,
Tcl_Obj *CONST objv[] ));
static Tcl_ObjCmdProc TestExceptionCmd;
-static int TestwincpuidCmd _ANSI_ARGS_(( ClientData dummy,
- Tcl_Interp* interp,
- int objc,
- Tcl_Obj *CONST objv[] ));
static int TestplatformChmod _ANSI_ARGS_((CONST char *nativePath,
int pmode));
static int TestchmodCmd _ANSI_ARGS_((ClientData dummy,
@@ -87,8 +83,6 @@ TclplatformtestInit(interp)
(ClientData) 0, (Tcl_CmdDeleteProc *) NULL);
Tcl_CreateObjCommand(interp, "testwinclock", TestwinclockCmd,
(ClientData) 0, (Tcl_CmdDeleteProc *) NULL);
- Tcl_CreateObjCommand(interp, "testwincpuid", TestwincpuidCmd,
- (ClientData) 0, (Tcl_CmdDeleteProc*) NULL );
Tcl_CreateObjCommand(interp, "testwinsleep", TestwinsleepCmd,
(ClientData) 0, (Tcl_CmdDeleteProc *) NULL );
Tcl_CreateObjCommand(interp, "testexcept", TestExceptionCmd,
@@ -312,62 +306,6 @@ TestwinclockCmd( ClientData dummy,
/*
*----------------------------------------------------------------------
*
- * TestwincpuidCmd --
- *
- * Retrieves CPU ID information.
- *
- * Usage:
- * testwincpuid <eax>
- *
- * Parameters:
- * eax - The value to pass in the EAX register to a CPUID instruction.
- *
- * Results:
- * Returns a four-element list containing the values from the
- * EAX, EBX, ECX and EDX registers returned from the CPUID instruction.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-
-static int
-TestwincpuidCmd( ClientData dummy,
- Tcl_Interp* interp, /* Tcl interpreter */
- int objc, /* Parameter count */
- Tcl_Obj *CONST * objv ) /* Parameter vector */
-{
- int status;
- int index;
- unsigned int regs[4];
- Tcl_Obj * regsObjs[4];
- int i;
-
- if ( objc != 2 ) {
- Tcl_WrongNumArgs( interp, 1, objv, "eax" );
- return TCL_ERROR;
- }
- if ( Tcl_GetIntFromObj( interp, objv[1], &index ) != TCL_OK ) {
- return TCL_ERROR;
- }
- status = TclWinCPUID( (unsigned int) index, regs );
- if ( status != TCL_OK ) {
- Tcl_SetObjResult( interp, Tcl_NewStringObj( "operation not available",
- -1 ) );
- return status;
- }
- for ( i = 0; i < 4; ++i ) {
- regsObjs[i] = Tcl_NewIntObj( (int) regs[i] );
- }
- Tcl_SetObjResult( interp, Tcl_NewListObj( 4, regsObjs ) );
- return TCL_OK;
-
-}
-
-/*
- *----------------------------------------------------------------------
- *
* TestwinsleepCmd --
*
* Causes this process to wait for the given number of milliseconds