fiddle 1.0.0 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,10 +13,13 @@ module Fiddle
13
13
  [val].pack("i!").unpack("I!")[0]
14
14
  when TYPE_LONG
15
15
  [val].pack("l!").unpack("L!")[0]
16
- when TYPE_LONG_LONG
17
- [val].pack("q").unpack("Q")[0]
18
16
  else
19
- val
17
+ if defined?(TYPE_LONG_LONG) and
18
+ ty.abs == TYPE_LONG_LONG
19
+ [val].pack("q").unpack("Q")[0]
20
+ else
21
+ val
22
+ end
20
23
  end
21
24
  end
22
25
 
@@ -30,10 +33,13 @@ module Fiddle
30
33
  [val].pack("I!").unpack("i!")[0]
31
34
  when TYPE_LONG
32
35
  [val].pack("L!").unpack("l!")[0]
33
- when TYPE_LONG_LONG
34
- [val].pack("Q").unpack("q")[0]
35
36
  else
36
- val
37
+ if defined?(TYPE_LONG_LONG) and
38
+ ty.abs == TYPE_LONG_LONG
39
+ [val].pack("Q").unpack("q")[0]
40
+ else
41
+ val
42
+ end
37
43
  end
38
44
  end
39
45
 
@@ -75,10 +81,13 @@ module Fiddle
75
81
  case SIZEOF_VOIDP
76
82
  when SIZEOF_LONG
77
83
  return [arg].pack("p").unpack("l!")[0]
78
- when SIZEOF_LONG_LONG
79
- return [arg].pack("p").unpack("q")[0]
80
84
  else
81
- raise(RuntimeError, "sizeof(void*)?")
85
+ if defined?(SIZEOF_LONG_LONG) and
86
+ SIZEOF_VOIDP == SIZEOF_LONG_LONG
87
+ return [arg].pack("p").unpack("q")[0]
88
+ else
89
+ raise(RuntimeError, "sizeof(void*)?")
90
+ end
82
91
  end
83
92
  end
84
93
  when Float, Integer
@@ -0,0 +1,3 @@
1
+ module Fiddle
2
+ VERSION = "1.0.5"
3
+ end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fiddle
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Patterson
8
8
  - SHIBATA Hiroshi
9
9
  autorequire:
10
- bindir: exe
10
+ bindir: bin
11
11
  cert_chain: []
12
- date: 2017-12-06 00:00:00.000000000 Z
12
+ date: 2020-12-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -58,21 +58,20 @@ email:
58
58
  - aaron@tenderlovemaking.com
59
59
  - hsbt@ruby-lang.org
60
60
  executables: []
61
- extensions: []
61
+ extensions:
62
+ - ext/fiddle/extconf.rb
62
63
  extra_rdoc_files: []
63
64
  files:
64
- - ".gitignore"
65
- - ".travis.yml"
66
- - Gemfile
67
65
  - LICENSE.txt
68
66
  - README.md
69
67
  - Rakefile
70
- - bin/console
71
- - bin/setup
68
+ - bin/downloader.rb
69
+ - bin/extlibs.rb
72
70
  - ext/fiddle/closure.c
73
71
  - ext/fiddle/closure.h
74
72
  - ext/fiddle/conversions.c
75
73
  - ext/fiddle/conversions.h
74
+ - ext/fiddle/depend
76
75
  - ext/fiddle/extconf.rb
77
76
  - ext/fiddle/extlibs
78
77
  - ext/fiddle/fiddle.c
@@ -80,6 +79,8 @@ files:
80
79
  - ext/fiddle/function.c
81
80
  - ext/fiddle/function.h
82
81
  - ext/fiddle/handle.c
82
+ - ext/fiddle/memory_view.c
83
+ - ext/fiddle/pinned.c
83
84
  - ext/fiddle/pointer.c
84
85
  - ext/fiddle/win32/fficonfig.h
85
86
  - ext/fiddle/win32/libffi-3.2.1-mswin.patch
@@ -95,10 +96,13 @@ files:
95
96
  - lib/fiddle/struct.rb
96
97
  - lib/fiddle/types.rb
97
98
  - lib/fiddle/value.rb
99
+ - lib/fiddle/version.rb
98
100
  homepage: https://github.com/ruby/fiddle
99
101
  licenses:
102
+ - Ruby
100
103
  - BSD-2-Clause
101
- metadata: {}
104
+ metadata:
105
+ msys2_mingw_dependencies: libffi
102
106
  post_install_message:
103
107
  rdoc_options: []
104
108
  require_paths:
@@ -114,8 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
114
118
  - !ruby/object:Gem::Version
115
119
  version: '0'
116
120
  requirements: []
117
- rubyforge_project:
118
- rubygems_version: 2.7.3
121
+ rubygems_version: 3.2.0.rc.2
119
122
  signing_key:
120
123
  specification_version: 4
121
124
  summary: A libffi wrapper for Ruby.
data/.gitignore DELETED
@@ -1,13 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
10
- /ext/fiddle/libffi-*/
11
- *.bundle
12
- *.so
13
- *.dll
@@ -1,7 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.3.5
5
- - 2.4.2
6
- - ruby-head
7
- before_install: gem install bundler
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in fiddle.gemspec
4
- gemspec
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "fiddle"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start(__FILE__)
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here