Check-in [fc293f04c4]
Overview
Comment:Updated to process string through expr(wide()) to format them correctly
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: fc293f04c406c78189012acfbb5a8cad3bcc0797
User & Date: rkeene on 2014-06-22 18:05:15
Other Links: manifest | tags
Context
2014-06-22
22:55
Added the ability to search other paths for libraries and headers check-in: 07d1d92554 user: rkeene tags: trunk
18:05
Updated to process string through expr(wide()) to format them correctly check-in: fc293f04c4 user: rkeene tags: trunk
17:31
Updated to get pointers from Tcl using Tcl_GetWideIntFromObj() check-in: 6deb0e2500 user: rkeene tags: trunk
Changes

Modified tcc4tcl.c from [fc9696732b] to [93d31f9b0f].

    46     46   	}
    47     47   
    48     48   	ckfree((void *) ts);
    49     49   }
    50     50   
    51     51   static int Tcc4tclHandleCmd ( ClientData cdata, Tcl_Interp *interp, int objc, Tcl_Obj * CONST objv[]){
    52     52   	Tcl_WideInt val;
           53  +	Tcl_Obj *val_o;
    53     54   	void *val_p;
    54     55   	int index;
    55     56   	int res;
    56     57   	struct TclTCCState *ts;
    57     58   	TCCState *s;
    58     59   	Tcl_Obj *sym_addr;
    59     60   	static CONST char *options[] = {
................................................................................
    64     65   	};
    65     66   	enum options {
    66     67   		TCC4TCL_ADD_INCLUDE, TCC4TCL_ADD_FILE, TCC4TCL_ADD_LIBRARY, 
    67     68   		TCC4TCL_ADD_LIBRARY_PATH, TCC4TCL_ADD_SYMBOL, TCC4TCL_COMMAND, TCC4TCL_COMPILE,
    68     69   		TCC4TCL_DEFINE, TCC4TCL_GET_SYMBOL, TCC4TCL_OUTPUT_FILE, TCC4TCL_UNDEFINE
    69     70   	};
    70     71   	char *str;
           72  +	int rv;
    71     73   
    72     74   	ts = (struct TclTCCState *) cdata;
    73     75   	s = ts->s;
    74     76   
    75     77       if (objc < 2) {
    76     78           Tcl_WrongNumArgs(interp, 1, objv, "subcommand arg ?arg ...?");
    77     79           return TCL_ERROR;
................................................................................
   119    121               }
   120    122           case TCC4TCL_ADD_SYMBOL:
   121    123               if (objc != 4) {
   122    124                   Tcl_WrongNumArgs(interp, 2, objv, "symbol value");
   123    125                   return TCL_ERROR;
   124    126               }
   125    127   
   126         -            if (Tcl_GetWideIntFromObj(interp, objv[3], &val) != TCL_OK) {
          128  +            rv = Tcl_ExprObj(interp, Tcl_ObjPrintf("wide(%s)", Tcl_GetString(objv[3])), &val_o);
          129  +            if (rv != TCL_OK) {
          130  +                return TCL_ERROR;
          131  +            }
          132  +
          133  +            rv = Tcl_GetWideIntFromObj(interp, val_o, &val);
          134  +            if (rv != TCL_OK) {
   127    135                   return TCL_ERROR;
   128    136               }
   129    137   
   130    138               val_p = (void *) val;
   131    139   
   132    140               tcc_add_symbol(s,Tcl_GetString(objv[2]), val_p); 
   133    141               return TCL_OK;