summaryrefslogtreecommitdiffstats
path: root/win/tclWinChan.c
diff options
context:
space:
mode:
authormdejong <mdejong>2004-06-21 22:05:44 (GMT)
committermdejong <mdejong>2004-06-21 22:05:44 (GMT)
commita7d93e405d7c52890ac2b6451680ed32574c2f18 (patch)
treea4a87ef27020e7670b6fb436fad9cffa4f64cf81 /win/tclWinChan.c
parentdd75f95a7e0f760d88b9059d13eca9ffd8e235cc (diff)
downloadtcl-a7d93e405d7c52890ac2b6451680ed32574c2f18.zip
tcl-a7d93e405d7c52890ac2b6451680ed32574c2f18.tar.gz
tcl-a7d93e405d7c52890ac2b6451680ed32574c2f18.tar.bz2
* win/tclWin32Dll.c (DllMain, _except_dllmain_detach_handler,
TclpCheckStackSpace, _except_checkstackspace_handler, TclWinCPUID, _except_TclWinCPUID_detach_handler): * win/tclWinChan.c (Tcl_MakeFileChannel, _except_makefilechannel_handler): * win/tclWinFCmd.c (DoRenameFile, _except_dorenamefile_handler, DoCopyFile, _except_docopyfile_handler): Rework pushing of exception handler function pointer so that compiling with gcc -O3 works. Remove empty function call to avoid compiler warning. Mark the DllMain function as noinline to avoid compiler error from duplicated asm labels in generated code.
Diffstat (limited to 'win/tclWinChan.c')
-rw-r--r--win/tclWinChan.c42
1 files changed, 35 insertions, 7 deletions
diff --git a/win/tclWinChan.c b/win/tclWinChan.c
index 077d1d9..c6609aa 100644
--- a/win/tclWinChan.c
+++ b/win/tclWinChan.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWinChan.c,v 1.34 2004/04/23 08:57:20 davygrvy Exp $
+ * RCS: @(#) $Id: tclWinChan.c,v 1.35 2004/06/21 22:05:55 mdejong Exp $
*/
#include "tclWinInt.h"
@@ -131,6 +131,17 @@ static void *INITIAL_ESP,
*RESTORED_HANDLER;
#endif /* HAVE_NO_SEH && TCL_MEM_DEBUG */
+#ifdef HAVE_NO_SEH
+static
+__attribute__ ((cdecl))
+EXCEPTION_DISPOSITION
+_except_makefilechannel_handler(
+ struct _EXCEPTION_RECORD *ExceptionRecord,
+ void *EstablisherFrame,
+ struct _CONTEXT *ContextRecord,
+ void *DispatcherContext);
+#endif
+
/*
*----------------------------------------------------------------------
@@ -1057,10 +1068,13 @@ Tcl_MakeFileChannel(rawHandle, mode)
# endif /* TCL_MEM_DEBUG */
__asm__ __volatile__ (
- "pushl %ebp" "\n\t"
- "pushl $__except_makefilechannel_handler" "\n\t"
- "pushl %fs:0" "\n\t"
- "movl %esp, %fs:0");
+ "pushl %%ebp" "\n\t"
+ "pushl %0" "\n\t"
+ "pushl %%fs:0" "\n\t"
+ "movl %%esp, %%fs:0"
+ :
+ : "r" (_except_makefilechannel_handler)
+ );
#else
__try {
#endif /* HAVE_NO_SEH */
@@ -1132,6 +1146,22 @@ Tcl_MakeFileChannel(rawHandle, mode)
return channel;
}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * _except_makefilechannel_handler --
+ *
+ * SEH exception handler for Tcl_MakeFileChannel.
+ *
+ * Results:
+ * See Tcl_MakeFileChannel.
+ *
+ * Side effects:
+ * See Tcl_MakeFileChannel.
+ *
+ *----------------------------------------------------------------------
+ */
#ifdef HAVE_NO_SEH
static
__attribute__ ((cdecl))
@@ -1144,8 +1174,6 @@ _except_makefilechannel_handler(
{
__asm__ __volatile__ (
"jmp makefilechannel_reentry");
- /* Nuke compiler warning about unused static function */
- _except_makefilechannel_handler(NULL, NULL, NULL, NULL);
return 0; /* Function does not return */
}
#endif