Skip to content

Instantly share code, notes, and snippets.

@cygx

cygx/test.p6 Secret

Created May 7, 2015 11:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cygx/2f4aecee744fccefcab9 to your computer and use it in GitHub Desktop.
Save cygx/2f4aecee744fccefcab9 to your computer and use it in GitHub Desktop.
use NativeCall;
sub cb(Pointer $, Str $) { say 42 }
sub tcc_new(--> Pointer) is native('libtcc') {*}
sub tcc_set_error_func(Pointer, Pointer, &cb (Pointer, Str))
is native('libtcc') {*}
sub tcc_compile_string(Pointer, Str --> int32) is native('libtcc') {*}
my $tcc = tcc_new;
tcc_set_error_func($tcc, Nil, &cb);
tcc_compile_string($tcc, 'xxx');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment