From 8dfa6906c30e2cc2c430e05e5463932458c19ee8 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 6 Apr 2012 23:33:46 +0000 Subject: tclpGetPid signature change (stub entry only, not for macro), for win64 compatibility with future cygwin64 correctly use win32 as default when cross-compiling under cygwin FossilOrigin-Name: 7fd5826902e165985ea782a2f70f5b1d58c01aab --- ChangeLog | 0 generic/tcl.decls | 0 generic/tcl.h | 0 generic/tclCmdAH.c | 0 generic/tclEnv.c | 0 generic/tclFCmd.c | 0 generic/tclFileName.c | 0 generic/tclIOSock.c | 0 generic/tclInt.decls | 4 ++-- generic/tclIntPlatDecls.h | 8 ++++---- generic/tclPipe.c | 2 +- generic/tclStubInit.c | 4 ++-- mac/tclMacPort.h | 0 tools/genStubs.tcl | 0 unix/Makefile.in | 0 unix/configure.in | 0 unix/tcl.m4 | 0 unix/tclUnixFile.c | 0 unix/tclUnixPort.h | 0 win/configure | 14 +++++++------- win/configure.in | 0 win/tcl.m4 | 23 ++++++++++++----------- win/tclWinError.c | 0 win/tclWinFile.c | 0 win/tclWinPipe.c | 2 +- win/tclWinPort.h | 0 win/tclWinSock.c | 0 27 files changed, 29 insertions(+), 28 deletions(-) mode change 100644 => 100755 ChangeLog mode change 100644 => 100755 generic/tcl.decls mode change 100644 => 100755 generic/tcl.h mode change 100644 => 100755 generic/tclCmdAH.c mode change 100644 => 100755 generic/tclEnv.c mode change 100644 => 100755 generic/tclFCmd.c mode change 100644 => 100755 generic/tclFileName.c mode change 100644 => 100755 generic/tclIOSock.c mode change 100644 => 100755 generic/tclInt.decls mode change 100644 => 100755 generic/tclPipe.c mode change 100644 => 100755 mac/tclMacPort.h mode change 100644 => 100755 tools/genStubs.tcl mode change 100644 => 100755 unix/Makefile.in mode change 100644 => 100755 unix/configure.in mode change 100644 => 100755 unix/tcl.m4 mode change 100644 => 100755 unix/tclUnixFile.c mode change 100644 => 100755 unix/tclUnixPort.h mode change 100644 => 100755 win/configure.in mode change 100644 => 100755 win/tcl.m4 mode change 100644 => 100755 win/tclWinError.c mode change 100644 => 100755 win/tclWinFile.c mode change 100644 => 100755 win/tclWinPipe.c mode change 100644 => 100755 win/tclWinPort.h mode change 100644 => 100755 win/tclWinSock.c diff --git a/ChangeLog b/ChangeLog old mode 100644 new mode 100755 diff --git a/generic/tcl.decls b/generic/tcl.decls old mode 100644 new mode 100755 diff --git a/generic/tcl.h b/generic/tcl.h old mode 100644 new mode 100755 diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c old mode 100644 new mode 100755 diff --git a/generic/tclEnv.c b/generic/tclEnv.c old mode 100644 new mode 100755 diff --git a/generic/tclFCmd.c b/generic/tclFCmd.c old mode 100644 new mode 100755 diff --git a/generic/tclFileName.c b/generic/tclFileName.c old mode 100644 new mode 100755 diff --git a/generic/tclIOSock.c b/generic/tclIOSock.c old mode 100644 new mode 100755 diff --git a/generic/tclInt.decls b/generic/tclInt.decls old mode 100644 new mode 100755 index b7c7ee4..e438588 --- a/generic/tclInt.decls +++ b/generic/tclInt.decls @@ -856,7 +856,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) @@ -980,7 +980,7 @@ declare 7 unix { } # On non-cygwin, this is actually a reference to TclUnixWaitForFile declare 8 unix { - unsigned long TclpGetPid(Tcl_Pid pid) + int TclpGetPid(Tcl_Pid pid) } # Added in 8.1: diff --git a/generic/tclIntPlatDecls.h b/generic/tclIntPlatDecls.h index 50c546c..6d3ed94 100644 --- a/generic/tclIntPlatDecls.h +++ b/generic/tclIntPlatDecls.h @@ -48,7 +48,7 @@ EXTERN unsigned short TclWinNToHS _ANSI_ARGS_((unsigned short ns)); EXTERN int TclWinSetSockOpt _ANSI_ARGS_((VOID *s, int level, int optname, CONST char *optval, int optlen)); /* 8 */ -EXTERN unsigned long TclpGetPid _ANSI_ARGS_((Tcl_Pid pid)); +EXTERN int TclpGetPid _ANSI_ARGS_((Tcl_Pid pid)); /* 9 */ EXTERN int TclWinGetPlatformId _ANSI_ARGS_((void)); /* 10 */ @@ -137,7 +137,7 @@ EXTERN u_short TclWinNToHS _ANSI_ARGS_((u_short ns)); EXTERN int TclWinSetSockOpt _ANSI_ARGS_((SOCKET s, int level, int optname, CONST char *optval, int optlen)); /* 8 */ -EXTERN unsigned long TclpGetPid _ANSI_ARGS_((Tcl_Pid pid)); +EXTERN int TclpGetPid _ANSI_ARGS_((Tcl_Pid pid)); /* 9 */ EXTERN int TclWinGetPlatformId _ANSI_ARGS_((void)); /* Slot 10 is reserved */ @@ -273,7 +273,7 @@ typedef struct TclIntPlatStubs { VOID *reserved5; unsigned short (*tclWinNToHS) _ANSI_ARGS_((unsigned short ns)); /* 6 */ int (*tclWinSetSockOpt) _ANSI_ARGS_((VOID *s, int level, int optname, CONST char *optval, int optlen)); /* 7 */ - unsigned long (*tclpGetPid) _ANSI_ARGS_((Tcl_Pid pid)); /* 8 */ + int (*tclpGetPid) _ANSI_ARGS_((Tcl_Pid pid)); /* 8 */ int (*tclWinGetPlatformId) _ANSI_ARGS_((void)); /* 9 */ Tcl_DirEntry * (*tclpReaddir) _ANSI_ARGS_((DIR *dir)); /* 10 */ struct tm * (*tclpLocaltime_unix) _ANSI_ARGS_((TclpTime_t_CONST clock)); /* 11 */ @@ -314,7 +314,7 @@ typedef struct TclIntPlatStubs { VOID *reserved5; u_short (*tclWinNToHS) _ANSI_ARGS_((u_short ns)); /* 6 */ int (*tclWinSetSockOpt) _ANSI_ARGS_((SOCKET s, int level, int optname, CONST char *optval, int optlen)); /* 7 */ - unsigned long (*tclpGetPid) _ANSI_ARGS_((Tcl_Pid pid)); /* 8 */ + int (*tclpGetPid) _ANSI_ARGS_((Tcl_Pid pid)); /* 8 */ int (*tclWinGetPlatformId) _ANSI_ARGS_((void)); /* 9 */ VOID *reserved10; void (*tclGetAndDetachPids) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Channel chan)); /* 11 */ diff --git a/generic/tclPipe.c b/generic/tclPipe.c old mode 100644 new mode 100755 index 1042e09..6e7029e --- a/generic/tclPipe.c +++ b/generic/tclPipe.c @@ -283,7 +283,7 @@ TclCleanupChildren(interp, numPids, pidPtr, errorChan) 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 + * the windows 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 71c6ab4..7d24d69 100644 --- a/generic/tclStubInit.c +++ b/generic/tclStubInit.c @@ -133,10 +133,10 @@ TclWinNoBackslash(char *path) return path; } -static unsigned long +static int TclpGetPid(Tcl_Pid pid) { - return (unsigned long) (size_t) pid; + return (int) (size_t) pid; } static void diff --git a/mac/tclMacPort.h b/mac/tclMacPort.h old mode 100644 new mode 100755 diff --git a/tools/genStubs.tcl b/tools/genStubs.tcl old mode 100644 new mode 100755 diff --git a/unix/Makefile.in b/unix/Makefile.in old mode 100644 new mode 100755 diff --git a/unix/configure.in b/unix/configure.in old mode 100644 new mode 100755 diff --git a/unix/tcl.m4 b/unix/tcl.m4 old mode 100644 new mode 100755 diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c old mode 100644 new mode 100755 diff --git a/unix/tclUnixPort.h b/unix/tclUnixPort.h old mode 100644 new mode 100755 diff --git a/win/configure b/win/configure index ae7ad50..29b1245 100755 --- a/win/configure +++ b/win/configure @@ -1232,7 +1232,7 @@ else #line 1233 "configure" #include "confdefs.h" - #ifdef __WIN32__ + #ifndef __WIN32__ #error cross-compiler #endif @@ -1242,12 +1242,12 @@ int main() { EOF if { (eval echo configure:1244: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - ac_cv_cross=yes + ac_cv_cross=no else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - ac_cv_cross=no + ac_cv_cross=yes fi rm -f conftest* @@ -1449,8 +1449,8 @@ echo "configure:1351: checking compiler flags" >&5 #line 1450 "configure" #include "confdefs.h" - #ifdef _WIN64 - #error 64-bit + #ifndef _WIN64 + #error 32-bit #endif int main() { @@ -1459,12 +1459,12 @@ int main() { EOF if { (eval echo configure:1461: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - tcl_win_64bit=no + tcl_win_64bit=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - tcl_win_64bit=yes + tcl_win_64bit=no fi rm -f conftest* diff --git a/win/configure.in b/win/configure.in old mode 100644 new mode 100755 diff --git a/win/tcl.m4 b/win/tcl.m4 old mode 100644 new mode 100755 index ff39c38..ab47afc --- a/win/tcl.m4 +++ b/win/tcl.m4 @@ -27,9 +27,6 @@ AC_DEFUN([SC_PATH_TCLCONFIG], [ else TCL_BIN_DIR_DEFAULT=../../tcl/win fi - if test ! -f $TCL_BIN_DIR_DEFAULT/tclConfig.sh; then - TCL_BIN_DIR_DEFAULT="${TCL_BIN_DIR_DEFAULT}/../unix" - fi AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 8.4 binaries from DIR], TCL_BIN_DIR=$withval, TCL_BIN_DIR=`cd $TCL_BIN_DIR_DEFAULT; pwd`) @@ -37,7 +34,11 @@ AC_DEFUN([SC_PATH_TCLCONFIG], [ AC_MSG_ERROR(Tcl directory $TCL_BIN_DIR does not exist) fi if test ! -f $TCL_BIN_DIR/tclConfig.sh; then - AC_MSG_ERROR(There is no tclConfig.sh in $TCL_BIN_DIR: perhaps you did not specify the Tcl *build* directory (not the toplevel Tcl directory) or you forgot to configure Tcl?) + if test ! -f $TCL_BIN_DIR/../unix/tclConfig.sh; then + AC_MSG_ERROR(There is no tclConfig.sh in $TCL_BIN_DIR: perhaps you did not specify the Tcl *build* directory (not the toplevel Tcl directory) or you forgot to configure Tcl?) + fi + TCL_BIN_DIR=`cd ${TCL_BIN_DIR}/../unix; pwd` + CFLAGS="$CFLAGS -mwin32" fi AC_MSG_RESULT($TCL_BIN_DIR/tclConfig.sh) ]) @@ -416,12 +417,12 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ AC_CACHE_CHECK(for cross-compile version of gcc, ac_cv_cross, AC_TRY_COMPILE([ - #ifdef __WIN32__ + #ifndef __WIN32__ #error cross-compiler #endif ], [], - ac_cv_cross=yes, - ac_cv_cross=no) + ac_cv_cross=no, + ac_cv_cross=yes) ) if test "$ac_cv_cross" = "yes"; then @@ -592,12 +593,12 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ ;; *) AC_TRY_COMPILE([ - #ifdef _WIN64 - #error 64-bit + #ifndef _WIN64 + #error 32-bit #endif ], [], - tcl_win_64bit=no, - tcl_win_64bit=yes + tcl_win_64bit=yes, + tcl_win_64bit=no ) if test "$tcl_win_64bit" = "yes" ; then do64bit=amd64 diff --git a/win/tclWinError.c b/win/tclWinError.c old mode 100644 new mode 100755 diff --git a/win/tclWinFile.c b/win/tclWinFile.c old mode 100644 new mode 100755 diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c old mode 100644 new mode 100755 index f15daa5..a661343 --- a/win/tclWinPipe.c +++ b/win/tclWinPipe.c @@ -871,7 +871,7 @@ TclpCloseFile( *-------------------------------------------------------------------------- */ -unsigned long +int TclpGetPid( Tcl_Pid pid) /* The HANDLE of the child process. */ { diff --git a/win/tclWinPort.h b/win/tclWinPort.h old mode 100644 new mode 100755 diff --git a/win/tclWinSock.c b/win/tclWinSock.c old mode 100644 new mode 100755 -- cgit v0.12