summaryrefslogtreecommitdiffstats
path: root/win/tkWin32Dll.c
diff options
context:
space:
mode:
Diffstat (limited to 'win/tkWin32Dll.c')
-rw-r--r--win/tkWin32Dll.c90
1 files changed, 48 insertions, 42 deletions
diff --git a/win/tkWin32Dll.c b/win/tkWin32Dll.c
index ed869fc..3978f1c 100644
--- a/win/tkWin32Dll.c
+++ b/win/tkWin32Dll.c
@@ -1,20 +1,21 @@
-/*
+/*
* tkWin32Dll.c --
*
* This file contains a stub dll entry point.
*
* Copyright (c) 1995 Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWin32Dll.c,v 1.11 2005/08/23 18:31:11 mdejong Exp $
+ * RCS: @(#) $Id: tkWin32Dll.c,v 1.12 2005/12/02 00:19:04 dkf Exp $
*/
#include "tkWinInt.h"
#ifndef STATIC_BUILD
#ifdef HAVE_NO_SEH
+
/*
* Unlike Borland and Microsoft, we don't register exception handlers by
* pushing registration records onto the runtime stack. Instead, we register
@@ -30,23 +31,23 @@ typedef struct EXCEPTION_REGISTRATION {
int status;
} EXCEPTION_REGISTRATION;
-/* Need to add noinline flag to DllMain declaration so that gcc -O3
- * does not inline asm code into DllEntryPoint and cause a
- * compile time error because of redefined local labels.
+/*
+ * Need to add noinline flag to DllMain declaration so that gcc -O3 does not
+ * inline asm code into DllEntryPoint and cause a compile time error because
+ * of redefined local labels.
*/
-BOOL APIENTRY DllMain(HINSTANCE hInst, DWORD reason,
- LPVOID reserved)
- __attribute__ ((noinline));
+BOOL APIENTRY DllMain(HINSTANCE hInst, DWORD reason,
+ LPVOID reserved) __attribute__ ((noinline));
-#else
+#else /* !HAVE_NO_SEH */
/*
* The following declaration is for the VC++ DLL entry point.
*/
-BOOL APIENTRY DllMain _ANSI_ARGS_((HINSTANCE hInst,
- DWORD reason, LPVOID reserved));
+BOOL APIENTRY DllMain(HINSTANCE hInst, DWORD reason,
+ LPVOID reserved);
#endif /* HAVE_NO_SEH */
/*
@@ -54,9 +55,8 @@ BOOL APIENTRY DllMain _ANSI_ARGS_((HINSTANCE hInst,
*
* DllEntryPoint --
*
- * This wrapper function is used by Borland to invoke the
- * initialization code for Tk. It simply calls the DllMain
- * routine.
+ * This wrapper function is used by Borland to invoke the initialization
+ * code for Tk. It simply calls the DllMain routine.
*
* Results:
* See DllMain.
@@ -68,10 +68,10 @@ BOOL APIENTRY DllMain _ANSI_ARGS_((HINSTANCE hInst,
*/
BOOL APIENTRY
-DllEntryPoint(hInst, reason, reserved)
- HINSTANCE hInst; /* Library instance handle. */
- DWORD reason; /* Reason this function is being called. */
- LPVOID reserved; /* Not used. */
+DllEntryPoint(
+ HINSTANCE hInst, /* Library instance handle. */
+ DWORD reason, /* Reason this function is being called. */
+ LPVOID reserved) /* Not used. */
{
return DllMain(hInst, reason, reserved);
}
@@ -81,35 +81,35 @@ DllEntryPoint(hInst, reason, reserved)
*
* DllMain --
*
- * DLL entry point. It is only necessary to specify our dll here so
- * that resources are found correctly. Otherwise Tk will initialize
- * and clean up after itself through other methods, in order to be
- * consistent whether the build is static or dynamic.
+ * DLL entry point. It is only necessary to specify our dll here so that
+ * resources are found correctly. Otherwise Tk will initialize and clean
+ * up after itself through other methods, in order to be consistent
+ * whether the build is static or dynamic.
*
* Results:
* Always TRUE.
*
* Side effects:
- * This might call some sycronization functions, but MSDN
- * documentation states: "Waiting on synchronization objects in
- * DllMain can cause a deadlock."
+ * This might call some sycronization functions, but MSDN documentation
+ * states: "Waiting on synchronization objects in DllMain can cause a
+ * deadlock."
*
*----------------------------------------------------------------------
*/
BOOL APIENTRY
-DllMain(hInstance, reason, reserved)
- HINSTANCE hInstance;
- DWORD reason;
- LPVOID reserved;
+DllMain(
+ HINSTANCE hInstance,
+ DWORD reason,
+ LPVOID reserved)
{
#ifdef HAVE_NO_SEH
EXCEPTION_REGISTRATION registration;
#endif
/*
- * If we are attaching to the DLL from a new process, tell Tk about
- * the hInstance to use.
+ * If we are attaching to the DLL from a new process, tell Tk about the
+ * hInstance to use.
*/
switch (reason) {
@@ -120,9 +120,8 @@ DllMain(hInstance, reason, reserved)
case DLL_PROCESS_DETACH:
/*
- * Protect the call to TkFinalize in an SEH block. We can't
- * be guarenteed Tk is always being unloaded from a stable
- * condition.
+ * Protect the call to TkFinalize in an SEH block. We can't be
+ * guarenteed Tk is always being unloaded from a stable condition.
*/
#ifdef HAVE_NO_SEH
@@ -175,7 +174,7 @@ DllMain(hInstance, reason, reserved)
"movl 0x8(%%edx), %%edx" "\n"
- /*
+ /*
* Come here however we exited. Restore context from the
* EXCEPTION_REGISTRATION in case the stack is unbalanced.
*/
@@ -199,10 +198,10 @@ DllMain(hInstance, reason, reserved)
#else /* HAVE_NO_SEH */
__try {
/*
- * Run and remove our exit handlers, if they haven't already
- * been run. Just in case we are being unloaded prior to
- * Tcl (it can happen), we won't leave any dangling pointers
- * hanging around for when Tcl gets unloaded later.
+ * Run and remove our exit handlers, if they haven't already been
+ * run. Just in case we are being unloaded prior to Tcl (it can
+ * happen), we won't leave any dangling pointers hanging around
+ * for when Tcl gets unloaded later.
*/
TkFinalize(NULL);
@@ -217,4 +216,11 @@ DllMain(hInstance, reason, reserved)
}
#endif /* !STATIC_BUILD */
-
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */