This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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