fiddle 1.1.3 → 1.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 96a73d1da87f69ec3f4aae33ed5a80ac8c920eb69fd93d91fb2d68c6ad0189af
4
- data.tar.gz: 50a145cd8275945f292bd8a82184d5955d64ef75a1ed44601daffc6716196dac
3
+ metadata.gz: c0f57583928674b1ebb1313d3d079afd7f72b7103f1cdff830ef5aa77f868faa
4
+ data.tar.gz: 0c2d7bbb4d6efd3da8f8023cb9b0d8de11b9baa3ab4e4f82d13e126e7eb301fd
5
5
  SHA512:
6
- metadata.gz: 2d1dda953aab9d5cb9fef0e0f437accfdf9c2cc891cc7319a2d53726d6e71570248a0a5b2308a18d75b7737e6667e798e404d0b5bdab2ad50d88106a061c74a6
7
- data.tar.gz: d4da3f220dfcbae91f58fd958de75746918a8bf20b1bedc342d99bfbeb3885d124bfece0c7c21523478b0d0c3f961a30b0a5103c65b8263dc37b03ddbc5db47a
6
+ metadata.gz: 6c7a270b8a8d967fcff910335e93051d8aaddaa0617387598ce90031f1c92170f58ba255de84b742a16eb6a2b647df45b07c91ee712c5c34247a6adceaacadc6
7
+ data.tar.gz: 121958d7cc7be584a1146c3a1ded233ab52facc1f4a31e4e02e49a91b5293897b3e6ae9f5280264ecc5adfbf72165a84837c05a75a82eae70764f16f48d567ef
@@ -1,11 +1,19 @@
1
1
  # frozen_string_literal: true
2
- require 'mkmf'
2
+
3
+ require "rbconfig"
3
4
 
4
5
  unless RUBY_ENGINE == "ruby"
5
- File.write('Makefile', dummy_makefile("").join)
6
+ File.write('Makefile', <<-MAKEFILE)
7
+ all install clean:
8
+ #{RbConfig::CONFIG["NULLCMD"]}
9
+
10
+ .PHONY: all install clean
11
+ MAKEFILE
6
12
  return
7
13
  end
8
14
 
15
+ require 'mkmf'
16
+
9
17
  # :stopdoc:
10
18
 
11
19
  def gcc?
@@ -68,11 +76,6 @@ unless bundle
68
76
  end
69
77
  if have_ffi_header && (have_library('ffi') || have_library('libffi'))
70
78
  have_libffi = true
71
- checking_for("undefined FFI_GO_CLOSURES is used") do
72
- if egrep_cpp(/warning: 'FFI_GO_CLOSURES' is not defined/, cpp_include(ffi_header), "2>&1")
73
- $defs.push('-DFFI_GO_CLOSURES=0')
74
- end
75
- end
76
79
  end
77
80
  end
78
81
 
data/ext/fiddle/fiddle.h CHANGED
@@ -40,6 +40,7 @@
40
40
  # endif
41
41
  #endif
42
42
 
43
+ #define FFI_GO_CLOSURES 0 /* fiddle does not use go closures */
43
44
  #ifdef USE_HEADER_HACKS
44
45
  #include <ffi/ffi.h>
45
46
  #else
@@ -154,7 +154,9 @@ initialize(int argc, VALUE argv[], VALUE self)
154
154
  if (args[kw_name] != Qundef) {
155
155
  name = args[kw_name];
156
156
  #ifdef HAVE_RB_STR_TO_INTERNED_STR
157
- name = rb_str_to_interned_str(name);
157
+ if (RB_TYPE_P(name, RUBY_T_STRING)) {
158
+ name = rb_str_to_interned_str(name);
159
+ }
158
160
  #endif
159
161
  }
160
162
  if (args[kw_need_gvl] != Qundef) {
@@ -475,8 +475,11 @@ module Fiddle
475
475
  RTLD_NOW = FFI::DynamicLibrary::RTLD_NOW
476
476
 
477
477
  def initialize(libname = nil, flags = RTLD_LAZY | RTLD_GLOBAL)
478
- @lib = FFI::DynamicLibrary.open(libname, flags) rescue LoadError
479
- raise DLError.new("Could not open #{libname}") unless @lib
478
+ begin
479
+ @lib = FFI::DynamicLibrary.open(libname, flags)
480
+ rescue LoadError, RuntimeError # LoadError for JRuby, RuntimeError for TruffleRuby
481
+ raise DLError, "Could not open #{libname}"
482
+ end
480
483
 
481
484
  @open = true
482
485
 
@@ -1,3 +1,3 @@
1
1
  module Fiddle
2
- VERSION = "1.1.3"
2
+ VERSION = "1.1.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fiddle
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.5
5
5
  platform: ruby
6
+ original_platform: ''
6
7
  authors:
7
8
  - Aaron Patterson
8
9
  - SHIBATA Hiroshi
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2024-10-11 00:00:00.000000000 Z
12
+ date: 2024-11-09 00:00:00.000000000 Z
12
13
  dependencies: []
13
14
  description: A libffi wrapper for Ruby.
14
15
  email: