Diff

Differences From Artifact [27bd9c9018]:

To Artifact [0ace8ff7f3]:


1
2
3
4
5
6
7
8
9
10
11
#! /usr/bin/env tclsh

lappend auto_path [lindex $argv 0]
package require tcc4tcl

tcc4tcl::cproc test {int i} int { return(i+42); }
tcc4tcl::cproc test1 {int i} int { return(i+42); }
tcc4tcl::cproc ::bob::test1 {int i} int { return(i+42); }

# This will fail
catch {



|







1
2
3
4
5
6
7
8
9
10
11
#! /usr/bin/env tclsh

lappend auto_path [lindex $argv 0]
package require -exact tcc4tcl 0.0

tcc4tcl::cproc test {int i} int { return(i+42); }
tcc4tcl::cproc test1 {int i} int { return(i+42); }
tcc4tcl::cproc ::bob::test1 {int i} int { return(i+42); }

# This will fail
catch {
233
234
235
236
237
238
239
240























241
#define test 1234
}

critcl::cproc test14 {int x} int {
	return(x + test);
}
puts "Test14: [test14 3]"
























exit 0








>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
#define test 1234
}

critcl::cproc test14 {int x} int {
	return(x + test);
}
puts "Test14: [test14 3]"

# Executable
close [file tempfile exe]
file delete -force -- $exe
set handle [tcc4tcl::new $exe]
$handle ccode {
	#include <stdio.h>
	int main(int argc, char **argv) {
		printf("hi\n");
		return(0);
	}
}
$handle process_command_line -r
$handle go
set execCode [catch {
	puts [exec ls -l $exe]
	exec ld -o $exe.e $exe
	puts [exec $exe.e]
} err]
file delete $exe
if {$execCode} {
	error $err
}

exit 0