Diff

Differences From Artifact [09314c428a]:

To Artifact [49b187426d]:


80
81
82
83
84
85
86

87
88
89
90
91
92
93

# External functions
if {[info exists ::env(TCC4TCL_TEST_RUN_NATIVE)]} {
	set handle [tcc4tcl::new]
	$handle cwrap curl_version {} vstring
	$handle add_library_path /usr/lib64
	$handle add_library_path /usr/lib

	$handle add_library curl
	$handle go
	puts [curl_version]
}

# wide values
set handle [tcc4tcl::new]







>







80
81
82
83
84
85
86
87
88
89
90
91
92
93
94

# External functions
if {[info exists ::env(TCC4TCL_TEST_RUN_NATIVE)]} {
	set handle [tcc4tcl::new]
	$handle cwrap curl_version {} vstring
	$handle add_library_path /usr/lib64
	$handle add_library_path /usr/lib
	$handle add_library_path /usr/lib32
	$handle add_library curl
	$handle go
	puts [curl_version]
}

# wide values
set handle [tcc4tcl::new]
102
103
104
105
106
107
108

109
110
111
112
113
114


























if {[info exists ::env(TCC4TCL_TEST_RUN_NATIVE)] && $::tcl_platform(os) != "Darwin"} {
	set tmpfile "/tmp/DELETEME_tcc4tcl_test_exec[expr rand()].so"
	file delete $tmpfile
	set handle [tcc4tcl::new $tmpfile "myPkg 0.1"]
	$handle cproc ext_add {int a int b} long { return(a+b); }
	$handle add_library_path /usr/lib64
	$handle add_library_path /usr/lib

	$handle add_library tclstub8.5
	$handle go
	load $tmpfile myPkg
	puts [ext_add 1 42]
	file delete $tmpfile
}

































>






>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
if {[info exists ::env(TCC4TCL_TEST_RUN_NATIVE)] && $::tcl_platform(os) != "Darwin"} {
	set tmpfile "/tmp/DELETEME_tcc4tcl_test_exec[expr rand()].so"
	file delete $tmpfile
	set handle [tcc4tcl::new $tmpfile "myPkg 0.1"]
	$handle cproc ext_add {int a int b} long { return(a+b); }
	$handle add_library_path /usr/lib64
	$handle add_library_path /usr/lib
	$handle add_library_path /usr/lib32
	$handle add_library tclstub8.5
	$handle go
	load $tmpfile myPkg
	puts [ext_add 1 42]
	file delete $tmpfile
}

# More involved test
set handle [tcc4tcl::new]
$handle ccode {#include <curl/curl.h>}
$handle cwrap curl_version {} vstring
$handle cproc curl_fetch {char* url} ok {
	void *handle;

	handle = curl_easy_init();
	if (!handle) {
		return(TCL_ERROR);
	}

	curl_easy_setopt(handle, CURLOPT_URL, url);
	curl_easy_perform(handle);

	return(TCL_OK);
}
$handle add_include_path /usr/include
$handle add_library_path /usr/lib64
$handle add_library_path /usr/lib
$handle add_library_path /usr/lib32
$handle add_library curl
$handle go
    
curl_fetch http://rkeene.org/