2323# windows:
2424# The ABI number must be included, but with a hyphen. ffi does not add a
2525# "lib" prefix or a ".dll" suffix.
26- def library_name ( name , abi_number )
27- if FFI ::Platform . windows?
28- "lib#{ name } -#{ abi_number } .dll"
29- elsif FFI ::Platform . mac?
30- "#{ name } .#{ abi_number } "
31- else
32- "#{ name } .so.#{ abi_number } "
26+ module FFI
27+ def self . library_name ( name , abi_number )
28+ if Platform . windows?
29+ "lib#{ name } -#{ abi_number } .dll"
30+ elsif Platform . mac?
31+ "#{ name } .#{ abi_number } "
32+ else
33+ "#{ name } .so.#{ abi_number } "
34+ end
3335 end
3436end
3537
@@ -43,7 +45,7 @@ def library_name(name, abi_number)
4345module Vips
4446 extend FFI ::Library
4547
46- ffi_lib library_name ( "vips" , 42 )
48+ ffi_lib FFI . library_name ( "vips" , 42 )
4749
4850 begin
4951 attach_function :g_malloc , [ :size_t ] , :pointer
@@ -67,9 +69,9 @@ class << self
6769 extend FFI ::Library
6870
6971 if Vips . unified?
70- ffi_lib library_name ( "vips" , 42 )
72+ ffi_lib FFI . library_name ( "vips" , 42 )
7173 else
72- ffi_lib library_name ( "glib-2.0" , 0 )
74+ ffi_lib FFI . library_name ( "glib-2.0" , 0 )
7375 end
7476
7577 attach_function :g_malloc , [ :size_t ] , :pointer
@@ -163,9 +165,9 @@ module GObject
163165 extend FFI ::Library
164166
165167 if Vips . unified?
166- ffi_lib library_name ( "vips" , 42 )
168+ ffi_lib FFI . library_name ( "vips" , 42 )
167169 else
168- ffi_lib library_name ( "gobject-2.0" , 0 )
170+ ffi_lib FFI . library_name ( "gobject-2.0" , 0 )
169171 end
170172
171173 # we can't just use ulong, windows has different int sizing rules
0 commit comments