ffi 1.9.12-x86-mingw32 → 1.9.13-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of ffi might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/lib/1.8/ffi_c.so +0 -0
- data/lib/1.9/ffi_c.so +0 -0
- data/lib/2.0/ffi_c.so +0 -0
- data/lib/2.1/ffi_c.so +0 -0
- data/lib/2.2/ffi_c.so +0 -0
- data/lib/ffi/library.rb +12 -11
- data/lib/ffi/version.rb +1 -1
- data/spec/ffi/library_spec.rb +10 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a99f7cc0ee695104250f882d7cdbda9f0a96a99
|
4
|
+
data.tar.gz: 31bd2d4062179eecfbb2d0fe5cc8caa4f0a1ecd4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21a921e2ddf9360182541d2a450443bb5e5ead2ac6ffe1f13f034f2f8ae0c1e4ca088b1eb14a9e59bb8525fc1302d2245c303b62064e95a9d4a148c59fe1e364
|
7
|
+
data.tar.gz: a5289e8ec9928212214cbd7e29eb33229e555ad8ada55169539940e70cd6cfc7d99b4fefa8843ae2a3eea85ec02815692f45dd25ca518860bb71eac3db33e94b
|
data/lib/1.8/ffi_c.so
CHANGED
Binary file
|
data/lib/1.9/ffi_c.so
CHANGED
Binary file
|
data/lib/2.0/ffi_c.so
CHANGED
Binary file
|
data/lib/2.1/ffi_c.so
CHANGED
Binary file
|
data/lib/2.2/ffi_c.so
CHANGED
Binary file
|
data/lib/ffi/library.rb
CHANGED
@@ -122,20 +122,21 @@ module FFI
|
|
122
122
|
end
|
123
123
|
end
|
124
124
|
|
125
|
-
# TODO better library lookup logic
|
126
|
-
unless libname.to_s.start_with?("/")
|
127
|
-
path = ['/usr/lib/','/usr/local/lib/'].find do |pth|
|
128
|
-
File.exist?(pth + libname)
|
129
|
-
end
|
130
|
-
if path
|
131
|
-
libname = path + libname
|
132
|
-
retry
|
133
|
-
end
|
134
|
-
end
|
135
|
-
|
136
125
|
if ldscript
|
137
126
|
retry
|
138
127
|
else
|
128
|
+
# TODO better library lookup logic
|
129
|
+
libname = libname.to_s
|
130
|
+
unless libname.start_with?("/")
|
131
|
+
path = ['/usr/lib/','/usr/local/lib/'].find do |pth|
|
132
|
+
File.exist?(pth + libname)
|
133
|
+
end
|
134
|
+
if path
|
135
|
+
libname = path + libname
|
136
|
+
retry
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
139
140
|
libr = (orig == libname ? orig : "#{orig} #{libname}")
|
140
141
|
errors[libr] = ex
|
141
142
|
end
|
data/lib/ffi/version.rb
CHANGED
data/spec/ffi/library_spec.rb
CHANGED
@@ -96,6 +96,16 @@ describe "Library" do
|
|
96
96
|
}.not_to raise_error
|
97
97
|
end
|
98
98
|
|
99
|
+
it "loads library using symbol" do
|
100
|
+
expect {
|
101
|
+
expect(Module.new do |m|
|
102
|
+
m.extend FFI::Library
|
103
|
+
ffi_lib :c
|
104
|
+
attach_function :getpid, [ ], :uint
|
105
|
+
end.getpid).to eq(Process.pid)
|
106
|
+
}.not_to raise_error
|
107
|
+
end
|
108
|
+
|
99
109
|
it "attach_function :getpid from [ 'c', 'libc.so.6'] " do
|
100
110
|
expect {
|
101
111
|
expect(Module.new do |m|
|