Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@niner
Created April 17, 2017 10:59
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 niner/7bcd6145c3209d91c211c2f2e453f5db to your computer and use it in GitHub Desktop.
Save niner/7bcd6145c3209d91c211c2f2e453f5db to your computer and use it in GitHub Desktop.
diff --git a/lib/NativeCall.pm6 b/lib/NativeCall.pm6
index 8a5a17331..b094b0164 100644
--- a/lib/NativeCall.pm6
+++ b/lib/NativeCall.pm6
@@ -214,6 +214,9 @@ sub guess_library_name($lib) is export(:TEST) {
$libname = $lib[0];
$apiversion = $lib[1];
}
+ when IO::Path {
+ $libname = $lib.Str;
+ }
when Str {
$libname = $lib;
}
@@ -284,7 +287,7 @@ my Lock $setup-lock .= new;
# This role is mixed in to any routine that is marked as being a
# native call.
-my role Native[Routine $r, $libname where Str|Callable|List] {
+my role Native[Routine $r, $libname where Str|Callable|List|IO::Path] {
has int $!setup;
has native_callsite $!call is box_target;
has Mu $!rettype;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment