summaryrefslogtreecommitdiff
path: root/ext/fiddle/lib
diff options
context:
space:
mode:
Diffstat (limited to 'ext/fiddle/lib')
-rw-r--r--ext/fiddle/lib/fiddle.rb16
-rw-r--r--ext/fiddle/lib/fiddle/function.rb7
2 files changed, 5 insertions, 18 deletions
diff --git a/ext/fiddle/lib/fiddle.rb b/ext/fiddle/lib/fiddle.rb
index 1c68b7b..7d55a1f 100644
--- a/ext/fiddle/lib/fiddle.rb
+++ b/ext/fiddle/lib/fiddle.rb
@@ -1,8 +1,13 @@
require 'fiddle.so'
require 'fiddle/function'
require 'fiddle/closure'
+require 'dl' unless Object.const_defined?(:DL)
module Fiddle
+
+ # A reference to DL::CPtr
+ Pointer = DL::CPtr
+
if WINDOWS
# Returns the last win32 +Error+ of the current executing +Thread+ or nil
# if none
@@ -26,15 +31,4 @@ module Fiddle
Thread.current[:__DL2_LAST_ERROR__] = error
Thread.current[:__FIDDLE_LAST_ERROR__] = error
end
-
- def dlopen library
- Fiddle::Handle.new library
- end
- module_function :dlopen
-
- # Add constants for backwards compat
-
- RTLD_GLOBAL = Handle::RTLD_GLOBAL # :nodoc:
- RTLD_LAZY = Handle::RTLD_LAZY # :nodoc:
- RTLD_NOW = Handle::RTLD_NOW # :nodoc:
end
diff --git a/ext/fiddle/lib/fiddle/function.rb b/ext/fiddle/lib/fiddle/function.rb
index f4d41e6..1657682 100644
--- a/ext/fiddle/lib/fiddle/function.rb
+++ b/ext/fiddle/lib/fiddle/function.rb
@@ -2,12 +2,5 @@ module Fiddle
class Function
# The ABI of the Function.
attr_reader :abi
-
- # The address of this function
- attr_reader :ptr
-
- def to_i
- ptr.to_i
- end
end
end