alien.libraries: dlopen should handle resource:-paths

db4
Björn Lindqvist 2013-11-29 11:35:44 +01:00 committed by John Benediktsson
parent d05363e1e8
commit ab7494eef9
2 changed files with 15 additions and 2 deletions

View File

@ -1,4 +1,10 @@
USING: alien alien.libraries alien.syntax tools.test kernel ;
USING:
alien alien.libraries alien.syntax
formatting
io.pathnames
kernel
system
tools.test ;
IN: alien.libraries.tests
[ f ] [ DLL" fadfasdfsada" dll-valid? ] unit-test
@ -26,3 +32,10 @@ IN: alien.libraries.tests
"test-library" "blah" cdecl add-library?
"blah" remove-library
] unit-test
! dlopen resolves resource:-paths
os windows? [
[ t ] [
vm file-stem "resource:/%s.exe" sprintf dlopen dll-valid?
] unit-test
] when

View File

@ -5,7 +5,7 @@ kernel namespaces destructors sequences strings
system io.pathnames fry combinators vocabs ;
IN: alien.libraries
: dlopen ( path -- dll ) native-string>alien (dlopen) ;
: dlopen ( path -- dll ) absolute-path native-string>alien (dlopen) ;
: dlsym ( name dll -- alien ) [ string>symbol ] dip (dlsym) ;