diff options
author | jan.nijtmans <jan.nijtmans@noemail.net> | 2013-02-17 21:03:56 (GMT) |
---|---|---|
committer | jan.nijtmans <jan.nijtmans@noemail.net> | 2013-02-17 21:03:56 (GMT) |
commit | f031dd571c8144833a6822dc4c1d01a33c0c91ec (patch) | |
tree | d52e8324f407af23496031cb1f295802ec61200f | |
parent | 6868cfef431ffd2e43b7b4ebef30b2bebcb01314 (diff) | |
download | tcl-f031dd571c8144833a6822dc4c1d01a33c0c91ec.zip tcl-f031dd571c8144833a6822dc4c1d01a33c0c91ec.tar.gz tcl-f031dd571c8144833a6822dc4c1d01a33c0c91ec.tar.bz2 |
Use (preferred) Tcl_ObjSetVar2 in stead of Tcl_SetVar in tclAppInit.c, both UNIX and Win.
FossilOrigin-Name: c5362b1bbd102f293a52829b9dd4f59b5dd0da28
-rw-r--r-- | generic/tclDecls.h | 3 | ||||
-rw-r--r-- | unix/tclAppInit.c | 8 | ||||
-rw-r--r-- | win/tclAppInit.c | 10 |
3 files changed, 15 insertions, 6 deletions
diff --git a/generic/tclDecls.h b/generic/tclDecls.h index fe9ba2b..d931873 100644 --- a/generic/tclDecls.h +++ b/generic/tclDecls.h @@ -3783,6 +3783,7 @@ extern const TclStubs *tclStubsPtr; # undef Tcl_Init # undef Tcl_SetPanicProc # undef Tcl_SetVar +# undef Tcl_ObjSetVar2 # undef Tcl_StaticPackage # undef TclFSGetNativePath # define Tcl_CreateInterp() (tclStubsPtr->tcl_CreateInterp()) @@ -3791,6 +3792,8 @@ extern const TclStubs *tclStubsPtr; # define Tcl_SetPanicProc(proc) (tclStubsPtr->tcl_SetPanicProc(proc)) # define Tcl_SetVar(interp, varName, newValue, flags) \ (tclStubsPtr->tcl_SetVar(interp, varName, newValue, flags)) +# define Tcl_ObjSetVar2(interp, part1, part2, newValue, flags) \ + (tclStubsPtr->tcl_ObjSetVar2(interp, part1, part2, newValue, flags)) #endif #if defined(_WIN32) && defined(UNICODE) diff --git a/unix/tclAppInit.c b/unix/tclAppInit.c index 159bbd8..f3edcff 100644 --- a/unix/tclAppInit.c +++ b/unix/tclAppInit.c @@ -48,7 +48,7 @@ MODULE_SCOPE int main(int, char **); */ #ifdef TCL_LOCAL_MAIN_HOOK -extern int TCL_LOCAL_MAIN_HOOK(int *argc, char ***argv); +MODULE_SCOPE int TCL_LOCAL_MAIN_HOOK(int *argc, char ***argv); #endif /* @@ -150,9 +150,11 @@ Tcl_AppInit( */ #ifdef DJGPP - (Tcl_SetVar)(interp, "tcl_rcFileName", "~/tclsh.rc", TCL_GLOBAL_ONLY); + (Tcl_ObjSetVar2)(interp, Tcl_NewStringObj("tcl_rcFileName", -1), NULL, + Tcl_NewStringObj("~/tclsh.rc", -1), TCL_GLOBAL_ONLY); #else - (Tcl_SetVar)(interp, "tcl_rcFileName", "~/.tclshrc", TCL_GLOBAL_ONLY); + (Tcl_ObjSetVar2)(interp, Tcl_NewStringObj("tcl_rcFileName", -1), NULL, + Tcl_NewStringObj("~/.tclshrc", -1), TCL_GLOBAL_ONLY); #endif return TCL_OK; diff --git a/win/tclAppInit.c b/win/tclAppInit.c index 56f45a0..753eaff 100644 --- a/win/tclAppInit.c +++ b/win/tclAppInit.c @@ -45,7 +45,10 @@ static void setargv(int *argcPtr, TCHAR ***argvPtr); #ifndef TCL_LOCAL_APPINIT #define TCL_LOCAL_APPINIT Tcl_AppInit #endif -extern int TCL_LOCAL_APPINIT(Tcl_Interp *interp); +#ifndef MODULE_SCOPE +# define MODULE_SCOPE extern +#endif +MODULE_SCOPE int TCL_LOCAL_APPINIT(Tcl_Interp *); /* * The following #if block allows you to change how Tcl finds the startup @@ -54,7 +57,7 @@ extern int TCL_LOCAL_APPINIT(Tcl_Interp *interp); */ #ifdef TCL_LOCAL_MAIN_HOOK -extern int TCL_LOCAL_MAIN_HOOK(int *argc, TCHAR ***argv); +MODULE_SCOPE int TCL_LOCAL_MAIN_HOOK(int *argc, TCHAR ***argv); #endif /* @@ -193,7 +196,8 @@ Tcl_AppInit( * specific startup file will be run under any conditions. */ - (Tcl_SetVar)(interp, "tcl_rcFileName", "~/tclshrc.tcl", TCL_GLOBAL_ONLY); + (Tcl_ObjSetVar2)(interp, Tcl_NewStringObj("tcl_rcFileName", -1), NULL, + Tcl_NewStringObj("~/tclshrc.tcl", -1), TCL_GLOBAL_ONLY); return TCL_OK; } |