ffi 1.9.12-x64-mingw32 → 1.9.13-x64-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/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: e2b17f5b40e60f2fd8c48d4456ed03ae5bb185d0
|
4
|
+
data.tar.gz: 4279ca220d55a076c1140ac9e0e76b9b9062d06b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e22f412c90c089fa06706c8a996e277d75a3bf61f84f57beeca81793ffc253ec1bb3bed5206f310118e26944093202b86415f788ec957b0b6ab3f106442f5dd
|
7
|
+
data.tar.gz: 2aa3cb5131810bd29cc8786d87aa37120eea39d07adda31576b4f85bd60af5ac22f41c40ac7fe8409800cb9107cdf64bfeb7363129903675456f5dbc7aa18657
|
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|
|