summaryrefslogtreecommitdiff
path: root/vendor/bundle/ruby/3.4.0/gems/ffi-1.17.4-arm64-darwin/lib/ffi.rb
diff options
context:
space:
mode:
authorBen Sanders <ben@sanders.life>2026-08-02 09:49:25 -0400
committerBen Sanders <ben@sanders.life>2026-08-02 09:49:25 -0400
commitb41479c91e6685511c1f8ba8586106b322073b62 (patch)
treec9f1345999d754ae0a533849966427e792d9e68d /vendor/bundle/ruby/3.4.0/gems/ffi-1.17.4-arm64-darwin/lib/ffi.rb
parentcfaceeb9a6d1295f5754be211858155cd309acc2 (diff)
added statscounter code
Diffstat (limited to 'vendor/bundle/ruby/3.4.0/gems/ffi-1.17.4-arm64-darwin/lib/ffi.rb')
-rw-r--r--vendor/bundle/ruby/3.4.0/gems/ffi-1.17.4-arm64-darwin/lib/ffi.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/vendor/bundle/ruby/3.4.0/gems/ffi-1.17.4-arm64-darwin/lib/ffi.rb b/vendor/bundle/ruby/3.4.0/gems/ffi-1.17.4-arm64-darwin/lib/ffi.rb
new file mode 100644
index 0000000..3fb20a8
--- /dev/null
+++ b/vendor/bundle/ruby/3.4.0/gems/ffi-1.17.4-arm64-darwin/lib/ffi.rb
@@ -0,0 +1,27 @@
+if RUBY_ENGINE == 'ruby'
+ begin
+ require RUBY_VERSION.split('.')[0, 2].join('.') + '/ffi_c'
+ rescue Exception
+ require 'ffi_c'
+ end
+
+ require 'ffi/ffi'
+
+elsif RUBY_ENGINE == 'jruby' && (RUBY_ENGINE_VERSION.split('.').map(&:to_i) <=> [9, 2, 20]) >= 0
+ JRuby::Util.load_ext("org.jruby.ext.ffi.FFIService")
+ require 'ffi/ffi'
+
+elsif RUBY_ENGINE == 'truffleruby' && (RUBY_ENGINE_VERSION.split('.').map(&:to_i) <=> [20, 1, 0]) >= 0
+ require 'truffleruby/ffi_backend'
+ require 'ffi/ffi'
+
+else
+ # Remove the ffi gem dir from the load path, then reload the internal ffi implementation
+ $LOAD_PATH.delete(File.dirname(__FILE__))
+ $LOAD_PATH.delete(File.join(File.dirname(__FILE__), 'ffi'))
+ unless $LOADED_FEATURES.nil?
+ $LOADED_FEATURES.delete(__FILE__)
+ $LOADED_FEATURES.delete('ffi.rb')
+ end
+ require 'ffi.rb'
+end