summaryrefslogtreecommitdiff
path: root/ext/dl/lib/dl.rb
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-06 06:59:24 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-06 06:59:24 +0000
commit4bada8b864e445b6eebe1a341e30cad94dbcaf84 (patch)
treebb7e4ed991aa16eda953d536265c6f9e5dc03a5d /ext/dl/lib/dl.rb
parentca3c007f058f17b2f0bf3c5ccc6701f3f6d49ca5 (diff)
* ext/fiddle/*: Adding fiddle library to wrap libffi
* test/fiddle/*: testing fiddle extension * ext/dl/lib/dl.rb: Requiring fiddle if it is available * ext/dl/lib/dl/callback.rb: using Fiddle if it is available * ext/dl/lib/dl/func.rb: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/dl/lib/dl.rb')
-rw-r--r--ext/dl/lib/dl.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/ext/dl/lib/dl.rb b/ext/dl/lib/dl.rb
new file mode 100644
index 00000000000..168a18a55ee
--- /dev/null
+++ b/ext/dl/lib/dl.rb
@@ -0,0 +1,12 @@
+require 'dl.so'
+
+begin
+ require 'fiddle'
+rescue LoadError
+end
+
+module DL
+ def self.fiddle?
+ Object.const_defined?(:Fiddle)
+ end
+end