summaryrefslogtreecommitdiffstats
path: root/generic/tclMain.c
diff options
context:
space:
mode:
authornijtmans <nijtmans>2010-11-04 21:48:23 (GMT)
committernijtmans <nijtmans>2010-11-04 21:48:23 (GMT)
commit259ada8fb281493b125e0b1560f2747fa91209bf (patch)
treeeca4cf58389348cf58a44d588d60ff77e45cbcba /generic/tclMain.c
parentebb0221fdd2b89c2af2d5ee05d235debb5f0bb72 (diff)
downloadtcl-259ada8fb281493b125e0b1560f2747fa91209bf.zip
tcl-259ada8fb281493b125e0b1560f2747fa91209bf.tar.gz
tcl-259ada8fb281493b125e0b1560f2747fa91209bf.tar.bz2
[FRQ 491789]: "setargv() doesn't support a unicode cmdline" implemented for Tcl on MSVC++
Diffstat (limited to 'generic/tclMain.c')
-rw-r--r--generic/tclMain.c36
1 files changed, 26 insertions, 10 deletions
diff --git a/generic/tclMain.c b/generic/tclMain.c
index 6fb67ac..93db15b 100644
--- a/generic/tclMain.c
+++ b/generic/tclMain.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclMain.c,v 1.52 2010/09/29 20:04:09 nijtmans Exp $
+ * RCS: @(#) $Id: tclMain.c,v 1.53 2010/11/04 21:48:23 nijtmans Exp $
*/
/**
@@ -19,8 +19,13 @@
* can be implemented, sharing the same source code.
*/
#ifndef TCL_ASCII_MAIN
-# undef UNICODE
-# undef _UNICODE
+# ifdef UNICODE
+# undef UNICODE
+# undef _UNICODE
+# else
+# define UNICODE
+# define _UNICODE
+# endif
#endif
#include "tclInt.h"
@@ -265,7 +270,7 @@ Tcl_SourceRCFile(
/*----------------------------------------------------------------------
*
- * Tcl_Main --
+ * Tcl_Main, Tcl_MainEx --
*
* Main program for tclsh and most other Tcl-based applications.
*
@@ -282,13 +287,14 @@ Tcl_SourceRCFile(
*/
void
-Tcl_Main(
+Tcl_MainEx(
int argc, /* Number of arguments. */
TCHAR **argv, /* Array of argument strings. */
- Tcl_AppInitProc *appInitProc)
+ Tcl_AppInitProc *appInitProc,
/* Application-specific initialization
* function to call after most initialization
* but before starting to execute commands. */
+ Tcl_Interp *interp)
{
Tcl_Obj *path, *resultPtr, *argvPtr, *commandPtr = NULL;
const char *encodingName = NULL;
@@ -296,12 +302,8 @@ Tcl_Main(
int code, length, tty, exitCode = 0;
Tcl_MainLoopProc *mainLoopProc;
Tcl_Channel inChannel, outChannel, errChannel;
- Tcl_Interp *interp;
Tcl_DString appName;
- Tcl_FindExecutable(argv[0]);
-
- interp = Tcl_CreateInterp();
Tcl_InitMemory(interp);
/*
@@ -652,6 +654,20 @@ Tcl_Main(
}
#ifndef TCL_ASCII_MAIN
+#undef Tcl_Main
+void
+Tcl_Main(
+ int argc, /* Number of arguments. */
+ TCHAR **argv, /* Array of argument strings. */
+ Tcl_AppInitProc *appInitProc)
+ /* Application-specific initialization
+ * function to call after most initialization
+ * but before starting to execute commands. */
+{
+ Tcl_FindExecutable(argv[0]);
+ Tcl_MainEx(argc, argv, appInitProc, Tcl_CreateInterp());
+}
+
/*
*---------------------------------------------------------------
*