summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2014-06-10 14:56:06 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2014-06-10 14:56:06 -0700
commit2a46101c848e2a75afc72b1440f9d1ee3036c112 (patch)
tree28a0abb2fa14d287a64510bee27f0a59501c5788 /lib
parentbd5be5b55ebde24eaa9a3d5543fc7dcb2bc4cf15 (diff)
downloadffi-yajl-2a46101c848e2a75afc72b1440f9d1ee3036c112.tar.gz
make sure fiddle supports dlopen before using it
Diffstat (limited to 'lib')
-rw-r--r--lib/ffi_yajl/ext.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ffi_yajl/ext.rb b/lib/ffi_yajl/ext.rb
index 01ff176..3a25174 100644
--- a/lib/ffi_yajl/ext.rb
+++ b/lib/ffi_yajl/ext.rb
@@ -16,7 +16,7 @@ module FFI_Yajl
libname = ::FFI.map_library_name("yajl")
libpath = File.expand_path(File.join(Libyajl2.opt_path, libname))
libpath.gsub!(/dylib/, 'bundle')
- if defined?(Fiddle)
+ if defined?(Fiddle) && Fiddle.respond_to?(:dlopen)
::Fiddle.dlopen(libpath)
else
::DL.dlopen(libpath)
@@ -30,7 +30,7 @@ module FFI_Yajl
libname = ::FFI.map_library_name("yajl")
libpath = File.expand_path(File.join(Libyajl2.opt_path, libname))
libpath.gsub!(/dylib/, 'bundle')
- if defined?(Fiddle)
+ if defined?(Fiddle) && Fiddle.respond_to?(:dlopen)
::Fiddle.dlopen(libpath)
else
::DL.dlopen(libpath)