From eac7d6560603161bdf15eff58f8e556341cd9a50 Mon Sep 17 00:00:00 2001 From: nijtmans Date: Mon, 11 Oct 2010 21:50:46 +0000 Subject: [FRQ 491789]: "setargv() doesn't support a unicode cmdline" implemented for Tk on MSVC++ --- ChangeLog | 9 +++++++++ doc/Tk_Main.3 | 5 +++-- generic/tkDecls.h | 14 +++++++++----- win/Makefile.in | 6 +++++- win/makefile.vc | 6 +++++- win/rules.vc | 6 ++++-- win/winMain.c | 12 ++++++------ 7 files changed, 41 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index fbcc6d9..cf42607 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2010-10-11 Jan Nijtmans + + * generic/tkDecls.h: [FRQ 491789]: "setargv() doesn't support a unicode + * doc/Tk_Main.3: cmdline" implemented for Tk on MSVC++ + * win/Makefile.in: + * win/makefile.vc: + * win/winMain.c: + * win/rules.vc: Update for VS10 + 2010-10-11 Joe English * generic/ttk/ttkTreeview.c: Fix crash in 'tag add' / 'tag remove' diff --git a/doc/Tk_Main.3 b/doc/Tk_Main.3 index b0a3689..c853d84 100644 --- a/doc/Tk_Main.3 +++ b/doc/Tk_Main.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: Tk_Main.3,v 1.9 2010/01/13 13:27:50 dkf Exp $ +'\" RCS: @(#) $Id: Tk_Main.3,v 1.10 2010/10/11 21:50:46 nijtmans Exp $ '\" .so man.macros .TH Tk_Main 3 4.0 Tk "Tk Library Procedures" @@ -22,7 +22,8 @@ Tk_Main \- main program for Tk-based applications .AP int argc in Number of elements in \fIargv\fR. .AP char *argv[] in -Array of strings containing command-line arguments. +Array of strings containing command-line arguments. On Windows, when +using -DUNICODE, the parameter type changes to wchar_t *. .AP Tcl_AppInitProc *appInitProc in Address of an application-specific initialization procedure. The value for this argument is usually \fBTcl_AppInit\fR. diff --git a/generic/tkDecls.h b/generic/tkDecls.h index 280c0c9..53a9458 100644 --- a/generic/tkDecls.h +++ b/generic/tkDecls.h @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkDecls.h,v 1.50 2010/08/21 16:35:34 nijtmans Exp $ + * RCS: @(#) $Id: tkDecls.h,v 1.51 2010/10/11 21:50:46 nijtmans Exp $ */ #ifndef _TKDECLS @@ -1729,14 +1729,18 @@ extern const TkStubs *tkStubsPtr; /* !END!: Do not edit above this line. */ -#undef TCL_STORAGE_CLASS -#define TCL_STORAGE_CLASS DLLIMPORT - /* Functions that don't belong in the stub table */ #undef Tk_MainEx #undef Tk_Init #undef Tk_SafeInit #undef Tk_CreateConsoleWindow -#endif /* _TKDECLS */ +#if defined(_WIN32) && defined(UNICODE) +EXTERN void Tk_MainExW(int, TCHAR **, Tcl_AppInitProc *, Tcl_Interp *); +# define Tk_MainEx Tk_MainExW +#endif +#undef TCL_STORAGE_CLASS +#define TCL_STORAGE_CLASS DLLIMPORT + +#endif /* _TKDECLS */ diff --git a/win/Makefile.in b/win/Makefile.in index a64c47b..d38bbc5 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -4,7 +4,7 @@ # "autoconf" program (constructs like "@foo@" will get replaced in the # actual Makefile. # -# RCS: @(#) $Id: Makefile.in,v 1.95 2010/10/06 14:34:38 nijtmans Exp $ +# RCS: @(#) $Id: Makefile.in,v 1.96 2010/10/11 21:50:46 nijtmans Exp $ TCLVERSION = @TCL_VERSION@ TCLPATCHL = @TCL_PATCH_LEVEL@ @@ -315,6 +315,7 @@ TK_OBJS = \ tkListbox.$(OBJEXT) \ tkMacWinMenu.$(OBJEXT) \ tkMain.$(OBJEXT) \ + tkMain2.$(OBJEXT) \ tkMenu.$(OBJEXT) \ tkMenubutton.$(OBJEXT) \ tkMenuDraw.$(OBJEXT) \ @@ -655,6 +656,9 @@ tkWinTest.$(OBJEXT): tkWinTest.c tkSquare.$(OBJEXT): tkSquare.c $(CC) -c $(CC_SWITCHES) @DEPARG@ $(CC_OBJNAME) +tkMain2.$(OBJEXT): tkMain.c + $(CC) -c $(CC_SWITCHES) -DBUILD_tk -DTK_ASCII_MAIN @DEPARG@ $(CC_OBJNAME) + # Extra dependency info tkConsole.$(OBJEXT): configure Makefile tkMain.$(OBJEXT): configure Makefile diff --git a/win/makefile.vc b/win/makefile.vc index 7cc2423..11ed0f3 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -13,7 +13,7 @@ # Copyright (c) 2003-2008 Pat Thoyts. # #------------------------------------------------------------------------------ -# RCS: @(#) $Id: makefile.vc,v 1.132 2010/10/11 12:27:32 nijtmans Exp $ +# RCS: @(#) $Id: makefile.vc,v 1.133 2010/10/11 21:50:46 nijtmans Exp $ #------------------------------------------------------------------------------ # Check to see we are configured to build with MSVC (MSDEVDIR or MSVCDIR) @@ -331,6 +331,7 @@ TKOBJS = \ $(TMP_DIR)\tkListbox.obj \ $(TMP_DIR)\tkMacWinMenu.obj \ $(TMP_DIR)\tkMain.obj \ + $(TMP_DIR)\tkMain2.obj \ $(TMP_DIR)\tkMenu.obj \ $(TMP_DIR)\tkMenubutton.obj \ $(TMP_DIR)\tkMenuDraw.obj \ @@ -798,6 +799,9 @@ $(TMP_DIR)\winMain.obj: $(WINDIR)\winMain.c -DTCL_USE_STATIC_PACKAGES=$(TCL_USE_STATIC_PACKAGES) \ -Fo$@ $? +$(TMP_DIR)\tkMain2.obj: $(GENERICDIR)\tkMain.c + $(cc32) -DBUILD_tk $(TK_CFLAGS) -DTK_ASCII_MAIN -Fo$@ $? + # The following objects are part of the stub library and should not # be built as DLL objects but none of the symbols should be exported # and no reference made to a C runtime. diff --git a/win/rules.vc b/win/rules.vc index f9aefe9..5e781ee 100644 --- a/win/rules.vc +++ b/win/rules.vc @@ -11,7 +11,7 @@ # Copyright (c) 2003-2007 Patrick Thoyts # #------------------------------------------------------------------------------ -# RCS: @(#) $Id: rules.vc,v 1.28 2010/09/14 08:50:20 nijtmans Exp $ +# RCS: @(#) $Id: rules.vc,v 1.29 2010/10/11 21:50:46 nijtmans Exp $ #------------------------------------------------------------------------------ !ifndef _RULES_VC @@ -189,7 +189,9 @@ VCVER=0 !if ![echo VCVERSION=_MSC_VER > vercl.x] \ && ![cl -nologo -TC -P vercl.x $(ERRNULL)] !include vercl.i -!if $(VCVERSION) >= 1500 +!if $(VCVERSION) >= 1600 +VCVER=10 +!elseif $(VCVERSION) >= 1500 VCVER=9 !elseif $(VCVERSION) >= 1400 VCVER=8 diff --git a/win/winMain.c b/win/winMain.c index 5abaeb3..8e98168 100644 --- a/win/winMain.c +++ b/win/winMain.c @@ -11,14 +11,14 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: winMain.c,v 1.33 2010/09/23 21:45:14 nijtmans Exp $ + * RCS: @(#) $Id: winMain.c,v 1.34 2010/10/11 21:50:46 nijtmans Exp $ */ -/* TODO: This file does not compile in UNICODE mode. - * See [Freq 2965056]: Windows build with -DUNICODE - */ -#undef UNICODE -#undef _UNICODE +#ifndef _MSC_VER +/* On mingw and cygwin this doesn't work yet */ +# undef UNICODE +# undef _UNICODE +#endif #include "tk.h" #define WIN32_LEAN_AND_MEAN -- cgit v0.12