Tcl Source Code

Artifact [296af81957]
Login

Artifact 296af819576c6ecc749250f60f3e3b7be8c4c78c:

Attachment "1711975.patch" to ticket [1711975fff] added by nijtmans 2010-11-07 15:25:18.
Index: generic/tclDecls.h
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclDecls.h,v
retrieving revision 1.188
diff -u -r1.188 tclDecls.h
--- generic/tclDecls.h	4 Nov 2010 21:48:23 -0000	1.188
+++ generic/tclDecls.h	7 Nov 2010 08:24:10 -0000
@@ -3788,14 +3788,16 @@
 	    (tclStubsPtr->tcl_SetVar(interp, varName, newValue, flags))
 #endif
 
+EXTERN void Tcl_MainEx(int argc, char **argv,
+	Tcl_AppInitProc *appInitProc, Tcl_Interp *interp);
 #if defined(_WIN32) && defined(UNICODE)
 #   define Tcl_FindExecutable(arg) ((Tcl_FindExecutable)((const char *)(arg)))
 #   define Tcl_MainEx Tcl_MainExW
     EXTERN void Tcl_MainExW(int argc, wchar_t **argv,
 	    Tcl_AppInitProc *appInitProc, Tcl_Interp *interp);
-#   define Tcl_Main(argc, argv, proc) Tcl_MainExW(argc, argv, proc, \
-	    (Tcl_FindExecutable(argv[0]), (Tcl_CreateInterp)()))
 #endif
+#define Tcl_Main(argc, argv, proc) Tcl_MainEx(argc, argv, proc, \
+	(Tcl_FindExecutable(argv[0]), (Tcl_CreateInterp)()))
 
 #undef TCL_STORAGE_CLASS
 #define TCL_STORAGE_CLASS DLLIMPORT
Index: generic/tclMain.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclMain.c,v
retrieving revision 1.55
diff -u -r1.55 tclMain.c
--- generic/tclMain.c	5 Nov 2010 08:16:46 -0000	1.55
+++ generic/tclMain.c	7 Nov 2010 08:24:10 -0000
@@ -15,7 +15,7 @@
 
 /**
  * On Windows, this file needs to be compiled twice, once with
- * TCL_ASCII_MAIN defined. This way both Tcl_Main and Tcl_MainExW
+ * TCL_ASCII_MAIN defined. This way both Tcl_MainEx and Tcl_MainExW
  * can be implemented, sharing the same source code.
  */
 #if defined(TCL_ASCII_MAIN)
@@ -212,7 +212,7 @@
  *
  * Tcl_SourceRCFile --
  *
- *	This function is typically invoked by Tcl_Main of Tk_Main function to
+ *	This function is typically invoked by Tcl_Main or Tk_Main functions to
  *	source an application specific rc file into the interpreter at startup
  *	time.
  *
@@ -654,6 +654,7 @@
 }
 
 #ifndef UNICODE
+#undef Tcl_Main
 void
 Tcl_Main(
     int argc,			/* Number of arguments. */