From ef7845ad248cb704b8af45d9534e67f6b8e44980 Mon Sep 17 00:00:00 2001 From: usa Date: Wed, 29 Oct 2003 11:03:54 +0000 Subject: * ext/tcltklib/tcltklib.c (CONST84): define CONST84 when it is not defined and TCL_MAJOR_VERSION >= 8. * ext/tcltklib/tcltklib.c (VwaitVarProc, WaitVariableProc, rb_threadVwaitProc): use CONST84 instead of CONST. * ext/tcltklib/tcltklib.c (ip_rbTkWaitCommand, ip_rb_threadTkWaitCommand): use CONST84 always. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/tcltklib/tcltklib.c | 76 +++++++++++++++++-------------------------------- 1 file changed, 26 insertions(+), 50 deletions(-) (limited to 'ext') diff --git a/ext/tcltklib/tcltklib.c b/ext/tcltklib/tcltklib.c index 801507d1cd..2102e56274 100644 --- a/ext/tcltklib/tcltklib.c +++ b/ext/tcltklib/tcltklib.c @@ -24,6 +24,20 @@ # include #endif +#if TCL_MAJOR_VERSION >= 8 +# ifndef CONST84 +# if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION <= 4 /* Tcl8.0.x -- 8.4b1 */ +# define CONST84 +# else /* unknown (maybe TCL_VERSION >= 8.5) */ +# ifdef CONST +# define CONST84 CONST +# else +# define CONST84 +# endif +# endif +# endif +#endif + /* for ruby_debug */ #define DUMP1(ARG1) if (ruby_debug) { fprintf(stderr, "tcltklib: %s\n", ARG1);} @@ -862,14 +876,14 @@ ip_ruby(clientData, interp, argc, argv) /**************************/ /* based on tclEvent.c */ /**************************/ -static char *VwaitVarProc _((ClientData, Tcl_Interp *, CONST char *, - CONST char *, int)); +static char *VwaitVarProc _((ClientData, Tcl_Interp *, CONST84 char *, + CONST84 char *, int)); static char * VwaitVarProc(clientData, interp, name1, name2, flags) ClientData clientData; /* Pointer to integer to set to 1. */ Tcl_Interp *interp; /* Interpreter containing variable. */ - CONST char *name1; /* Name of variable. */ - CONST char *name2; /* Second part of variable name. */ + CONST84 char *name1; /* Name of variable. */ + CONST84 char *name2; /* Second part of variable name. */ int flags; /* Information about what happened. */ { int *donePtr = (int *) clientData; @@ -953,14 +967,14 @@ ip_rbVwaitCommand(clientData, interp, objc, objv) /**************************/ /* based on tkCmd.c */ /**************************/ -static char *WaitVariableProc _((ClientData, Tcl_Interp *, CONST char *, - CONST char *, int)); +static char *WaitVariableProc _((ClientData, Tcl_Interp *, CONST84 char *, + CONST84 char *, int)); static char * WaitVariableProc(clientData, interp, name1, name2, flags) ClientData clientData; /* Pointer to integer to set to 1. */ Tcl_Interp *interp; /* Interpreter containing variable. */ - CONST char *name1; /* Name of variable. */ - CONST char *name2; /* Second part of variable name. */ + CONST84 char *name1; /* Name of variable. */ + CONST84 char *name2; /* Second part of variable name. */ int flags; /* Information about what happened. */ { int *donePtr = (int *) clientData; @@ -1047,19 +1061,7 @@ ip_rbTkWaitCommand(clientData, interp, objc, objv) #if TCL_MAJOR_VERSION >= 8 if (Tcl_GetIndexFromObj(interp, objv[1], -# ifdef CONST84 /* Tcl8.4.x -- ?.?.? (current latest version is 8.4.4) */ (CONST84 char **)optionStrings, -# else -# if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION <= 4 /* Tcl8.0.x -- 8.4b1 */ - (char **)optionStrings, -# else /* unknown (maybe TCL_VERSION >= 8.5) */ -# ifdef CONST - (CONST char **)optionStrings, -# else - optionStrings, -# endif -# endif -# endif "option", 0, &index) != TCL_OK) { return TCL_ERROR; } @@ -1173,14 +1175,14 @@ struct th_vwait_param { int done; }; -static char *rb_threadVwaitProc _((ClientData, Tcl_Interp *, CONST char *, - CONST char *, int)); +static char *rb_threadVwaitProc _((ClientData, Tcl_Interp *, CONST84 char *, + CONST84 char *, int)); static char * rb_threadVwaitProc(clientData, interp, name1, name2, flags) ClientData clientData; /* Pointer to integer to set to 1. */ Tcl_Interp *interp; /* Interpreter containing variable. */ - CONST char *name1; /* Name of variable. */ - CONST char *name2; /* Second part of variable name. */ + CONST84 char *name1; /* Name of variable. */ + CONST84 char *name2; /* Second part of variable name. */ int flags; /* Information about what happened. */ { struct th_vwait_param *param = (struct th_vwait_param *) clientData; @@ -1362,19 +1364,7 @@ ip_rb_threadTkWaitCommand(clientData, interp, objc, objv) #if TCL_MAJOR_VERSION >= 8 if (Tcl_GetIndexFromObj(interp, objv[1], -# ifdef CONST84 /* Tcl8.4.x -- ?.?.? (current latest version is 8.4.4) */ (CONST84 char **)optionStrings, -# else -# if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION <= 4 /* Tcl8.0.x -- 8.4b1 */ - (char **)optionStrings, -# else /* unknown (maybe TCL_VERSION >= 8.5) */ -# ifdef CONST - (CONST char **)optionStrings, -# else - optionStrings, -# endif -# endif -# endif "option", 0, &index) != TCL_OK) { return TCL_ERROR; } @@ -1978,22 +1968,8 @@ ip_invoke_real(argc, argv, obj) { TRAP_BEG; #if TCL_MAJOR_VERSION >= 8 -# ifdef CONST84 /* Tcl8.4.x -- ?.?.? (current latest version is 8.4.4) */ ptr->return_value = (*info.proc)(info.clientData, ptr->ip, argc, (CONST84 char **)av); -# else -# if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION <= 4 /* Tcl8.0.x -- 8.4b1 */ - ptr->return_value = (*info.proc)(info.clientData, ptr->ip, argc, av); - -# else /* unknown (maybe TCL_VERSION >= 8.5) */ -# ifdef CONST - ptr->return_value = (*info.proc)(info.clientData, ptr->ip, - argc, (CONST char **)av); -# else - ptr->return_value = (*info.proc)(info.clientData, ptr->ip, argc, av); -# endif -# endif -# endif #else /* TCL_MAJOR_VERSION < 8 */ ptr->return_value = (*info.proc)(info.clientData, ptr->ip, argc, av); #endif -- cgit v1.2.3