Check-in [633a01c5d6]
Overview
Comment:Added support for a ClientData type
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 633a01c5d6e01f115a0e267f9557ac4075658a01
User & Date: rkeene on 2016-01-25 18:18:24
Other Links: manifest | tags
Context
2016-01-25
18:31
Added support for a ClientData type check-in: 91b1a5ba3d user: rkeene tags: trunk
18:18
Added support for a ClientData type check-in: 633a01c5d6 user: rkeene tags: trunk
18:09
Updated to respect --prefix check-in: 4395e6083a user: rkeene tags: trunk
Changes

Modified test.tcl from [8b959926b0] to [da5a97590a].

   103    103   # Produce a loadable object
   104    104   ## Currently doesn't work on Darwin
   105    105   if {[info exists ::env(TCC4TCL_TEST_RUN_NATIVE)] && $::tcl_platform(os) != "Darwin"} {
   106    106   	set tmpfile "/tmp/DELETEME_tcc4tcl_test_exec[expr rand()].so"
   107    107   	file delete $tmpfile
   108    108   	set handle [tcc4tcl::new $tmpfile "myPkg 0.1"]
   109    109   	$handle cproc ext_add {int a int b} long { return(a+b); }
          110  +	$handle add_include_path [::tcl::pkgconfig get includedir,runtime]
   110    111   	$handle add_library_path [::tcl::pkgconfig get libdir,runtime]
   111    112   	$handle add_library_path /usr/lib/x86_64-linux-gnu
   112    113   	$handle add_library_path /usr/lib64
   113    114   	$handle add_library_path /usr/lib
   114    115   	$handle add_library_path /usr/lib32
   115    116   	$handle add_library tclstub${::tcl_version}
   116    117   	$handle go
................................................................................
   178    179   }
   179    180   $handle cproc callToTclBinaryWrapper {} void {
   180    181   	callToTclBinary("test\x00test", 9);
   181    182   }
   182    183   puts [$handle code]
   183    184   $handle go
   184    185   callToTclBinaryWrapper
          186  +
          187  +set handle [tcc4tcl::new]
          188  +$handle cproc testClientData {int y} {int} [concat "int x = 3;" {
          189  +	return(x + y);
          190  +}]
          191  +$handle go
          192  +set testVal [testClientData 1]
          193  +if {$testVal != "4"} {
          194  +	error "\[ClientData\] Invalid value: $testVal, should have been 4"
          195  +}
          196  +
          197  +set handle [tcc4tcl::new]
          198  +$handle cproc testClientData {ClientData _x=3 int y} {int} {
          199  +	int x
          200  +
          201  +	Tcl_GetIntFromObj(NULL, _x, &x);
          202  +
          203  +	return(x + y);
          204  +}
          205  +set testVal [testClientData 1]
          206  +if {$testVal != "4"} {
          207  +	error "\[ClientData\] Invalid value: $testVal, should have been 4"
          208  +}
          209  +
          210  +exit 0