From 0be279d05406008feb6cef4e6de1a3c890078d44 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 1 Jul 2012 19:39:03 +0000 Subject: add TclUnixCopyFile to stub table for Cygwin --- generic/tclInt.decls | 5 +++++ generic/tclIntPlatDecls.h | 15 ++++++++++++--- generic/tclStubInit.c | 3 ++- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/generic/tclInt.decls b/generic/tclInt.decls index 0459e8c..102d04b 100644 --- a/generic/tclInt.decls +++ b/generic/tclInt.decls @@ -1034,6 +1034,11 @@ declare 16 win { # declare 17 win { # char *TclpGetTZName(void) # } +# new for 8.5.12+ Cygwin only +declare 17 win { + int TclUnixCopyFile(const char *src, const char *dst, + const Tcl_StatBuf *statBufPtr, int dontCopyAtts) +} declare 18 win { TclFile TclpMakeFile(Tcl_Channel channel, int direction) } diff --git a/generic/tclIntPlatDecls.h b/generic/tclIntPlatDecls.h index 5c610fa..34a23a4 100644 --- a/generic/tclIntPlatDecls.h +++ b/generic/tclIntPlatDecls.h @@ -236,7 +236,13 @@ EXTERN int TclpCreateProcess(Tcl_Interp *interp, int argc, /* 16 */ EXTERN int TclpIsAtty(int fd); #endif -/* Slot 17 is reserved */ +#ifndef TclUnixCopyFile_TCL_DECLARED +#define TclUnixCopyFile_TCL_DECLARED +/* 17 */ +EXTERN int TclUnixCopyFile(CONST char *src, CONST char *dst, + CONST Tcl_StatBuf *statBufPtr, + int dontCopyAtts); +#endif #ifndef TclpMakeFile_TCL_DECLARED #define TclpMakeFile_TCL_DECLARED /* 18 */ @@ -479,7 +485,7 @@ typedef struct TclIntPlatStubs { int (*tclpCreatePipe) (TclFile *readPipe, TclFile *writePipe); /* 14 */ int (*tclpCreateProcess) (Tcl_Interp *interp, int argc, CONST char **argv, TclFile inputFile, TclFile outputFile, TclFile errorFile, Tcl_Pid *pidPtr); /* 15 */ int (*tclpIsAtty) (int fd); /* 16 */ - VOID *reserved17; + int (*tclUnixCopyFile) (CONST char *src, CONST char *dst, CONST Tcl_StatBuf *statBufPtr, int dontCopyAtts); /* 17 */ TclFile (*tclpMakeFile) (Tcl_Channel channel, int direction); /* 18 */ TclFile (*tclpOpenFile) (CONST char *fname, int mode); /* 19 */ void (*tclWinAddProcess) (HANDLE hProcess, DWORD id); /* 20 */ @@ -687,7 +693,10 @@ extern TclIntPlatStubs *tclIntPlatStubsPtr; #define TclpIsAtty \ (tclIntPlatStubsPtr->tclpIsAtty) /* 16 */ #endif -/* Slot 17 is reserved */ +#ifndef TclUnixCopyFile +#define TclUnixCopyFile \ + (tclIntPlatStubsPtr->tclUnixCopyFile) /* 17 */ +#endif #ifndef TclpMakeFile #define TclpMakeFile \ (tclIntPlatStubsPtr->tclpMakeFile) /* 18 */ diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c index ca21efb..7b73ee3 100644 --- a/generic/tclStubInit.c +++ b/generic/tclStubInit.c @@ -77,6 +77,7 @@ MODULE_SCOPE TclTomMathStubs tclTomMathStubs; #ifdef __WIN32__ # define TclUnixWaitForFile 0 +# define TclUnixCopyFile 0 # define TclpReaddir 0 # define TclpIsAtty 0 #elif defined(__CYGWIN__) @@ -509,7 +510,7 @@ TclIntPlatStubs tclIntPlatStubs = { TclpCreatePipe, /* 14 */ TclpCreateProcess, /* 15 */ TclpIsAtty, /* 16 */ - NULL, /* 17 */ + TclUnixCopyFile, /* 17 */ TclpMakeFile, /* 18 */ TclpOpenFile, /* 19 */ TclWinAddProcess, /* 20 */ -- cgit v0.12