Tcl Source Code

Artifact [a739fbe9d9]
Login

Artifact a739fbe9d95592a31c3f06e30f428c730c8f5e4f:

Attachment "3059922.patch" to ticket [3059922fff] added by dgp 2010-09-08 21:24:48.
Index: win/tclWin32Dll.c
===================================================================
RCS file: /cvsroot/tcl/tcl/win/tclWin32Dll.c,v
retrieving revision 1.54.2.2
diff -u -r1.54.2.2 tclWin32Dll.c
--- win/tclWin32Dll.c	4 Aug 2010 19:17:29 -0000	1.54.2.2
+++ win/tclWin32Dll.c	8 Sep 2010 14:23:37 -0000
@@ -319,7 +319,7 @@
 	 * an exception handler and the state of the stack might be unstable.
 	 */
 
-#ifdef HAVE_NO_SEH
+#if defined(HAVE_NO_SEH) && !defined(_WIN64)
 	__asm__ __volatile__ (
 
 	    /*
@@ -389,13 +389,17 @@
 	    "%eax", "%ebx", "%ecx", "%edx", "%esi", "%edi", "memory"
 	    );
 
-#else /* HAVE_NO_SEH */
+#else
+#ifndef HAVE_NO_SEH
 	__try {
+#endif
 	    Tcl_Finalize();
+#ifndef HAVE_NO_SEH
 	} __except (EXCEPTION_EXECUTE_HANDLER) {
 	    /* empty handler body. */
 	}
 #endif
+#endif
 
 	break;
     }
Index: win/tclWinChan.c
===================================================================
RCS file: /cvsroot/tcl/tcl/win/tclWinChan.c,v
retrieving revision 1.49.4.2
diff -u -r1.49.4.2 tclWinChan.c
--- win/tclWinChan.c	21 May 2010 12:18:17 -0000	1.49.4.2
+++ win/tclWinChan.c	8 Sep 2010 14:23:37 -0000
@@ -1094,12 +1094,7 @@
 	 */
 
 	result = 0;
-#ifndef HAVE_NO_SEH
-	__try {
-	    CloseHandle(dupedHandle);
-	    result = 1;
-	} __except (EXCEPTION_EXECUTE_HANDLER) {}
-#else
+#if defined(HAVE_NO_SEH) && !defined(_WIN64)
 	/*
 	 * Don't have SEH available, do things the hard way. Note that this
 	 * needs to be one block of asm, to avoid stack imbalance; also, it is
@@ -1179,7 +1174,15 @@
 	    "%eax", "%ebx", "%ecx", "%edx", "%esi", "%edi", "memory"
 	    );
 	result = registration.status;
-
+#else
+#ifndef HAVE_NO_SEH
+	__try {
+#endif
+	    CloseHandle(dupedHandle);
+	    result = 1;
+#ifndef HAVE_NO_SEH
+	} __except (EXCEPTION_EXECUTE_HANDLER) {}
+#endif
 #endif
 	if (result == FALSE) {
 	    return NULL;
Index: win/tclWinFCmd.c
===================================================================
RCS file: /cvsroot/tcl/tcl/win/tclWinFCmd.c,v
retrieving revision 1.52
diff -u -r1.52 tclWinFCmd.c
--- win/tclWinFCmd.c	29 Aug 2006 00:36:57 -0000	1.52
+++ win/tclWinFCmd.c	8 Sep 2010 14:23:37 -0000
@@ -199,14 +199,7 @@
      * arguments is a char block device.
      */
 
-#ifndef HAVE_NO_SEH
-    __try {
-	if ((*tclWinProcs->moveFileProc)(nativeSrc, nativeDst) != FALSE) {
-	    retval = TCL_OK;
-	}
-    } __except (EXCEPTION_EXECUTE_HANDLER) {}
-#else
-
+#if defined(HAVE_NO_SEH) && !defined(_WIN64)
     /*
      * Don't have SEH available, do things the hard way. Note that this needs
      * to be one block of asm, to avoid stack imbalance; also, it is illegal
@@ -291,6 +284,16 @@
     if (registration.status != FALSE) {
 	retval = TCL_OK;
     }
+#else
+#ifndef HAVE_NO_SEH
+    __try {
+#endif
+	if ((*tclWinProcs->moveFileProc)(nativeSrc, nativeDst) != FALSE) {
+	    retval = TCL_OK;
+	}
+#ifndef HAVE_NO_SEH
+    } __except (EXCEPTION_EXECUTE_HANDLER) {}
+#endif
 #endif
 
     if (retval != -1) {
@@ -587,14 +590,7 @@
      * arguments is a char block device.
      */
 
-#ifndef HAVE_NO_SEH
-    __try {
-	if ((*tclWinProcs->copyFileProc)(nativeSrc, nativeDst, 0) != FALSE) {
-	    retval = TCL_OK;
-	}
-    } __except (EXCEPTION_EXECUTE_HANDLER) {}
-#else
-
+#if defined(HAVE_NO_SEH) && !defined(_WIN64)
     /*
      * Don't have SEH available, do things the hard way. Note that this needs
      * to be one block of asm, to avoid stack imbalance; also, it is illegal
@@ -681,6 +677,16 @@
     if (registration.status != FALSE) {
 	retval = TCL_OK;
     }
+#else
+#ifndef HAVE_NO_SEH
+    __try {
+#endif
+	if ((*tclWinProcs->copyFileProc)(nativeSrc, nativeDst, 0) != FALSE) {
+	    retval = TCL_OK;
+	}
+#ifndef HAVE_NO_SEH
+    } __except (EXCEPTION_EXECUTE_HANDLER) {}
+#endif
 #endif
 
     if (retval != -1) {