Created
April 23, 2018 00:45
-
-
Save Kaiepi/a6ce74584ef78e5e90d3bad5aa3debd6 to your computer and use it in GitHub Desktop.
NativeCall function pointer method wrapping
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
method first(::?CLASS:D: --> int32) { | |
my &cb := nativecast(:(Pointer, Event --> int32), $!h_first<>); | |
&cb does sub (Pointer, Event --> int32) is native(LIB) { * } | |
my Event $e .= new; | |
cb($!h_ref, $e); | |
$e; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment