ffi 1.14.2-x64-mingw32 → 1.15.0-x64-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +23 -0
- data/Gemfile +1 -4
- data/Rakefile +16 -23
- data/lib/2.3/ffi_c.so +0 -0
- data/lib/2.4/ffi_c.so +0 -0
- data/lib/2.5/ffi_c.so +0 -0
- data/lib/2.6/ffi_c.so +0 -0
- data/lib/2.7/ffi_c.so +0 -0
- data/lib/3.0/ffi_c.so +0 -0
- data/lib/ffi/platform/powerpc64le-linux/types.conf +100 -0
- data/lib/ffi/platform/riscv64-linux/types.conf +104 -0
- data/lib/ffi/variadic.rb +0 -9
- data/lib/ffi/version.rb +1 -1
- data/rakelib/ffi_gem_helper.rb +65 -0
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c3d28f48c02d358aeb378f5f8527a9da7e7dd3bfd0489700b7f9fc8f9fa79dda
|
4
|
+
data.tar.gz: 60bed5d55754f93be752d503e4b77ff7703cfb105b82f97bac7e07edc75b8312
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a696de2c1053410df14f7ea1cc9902999488b281d0f425dc39d98874defd11b78e12f0e7711c42a915bcd587ca5b4bce701d537d50b641f90d1d704f08bc398
|
7
|
+
data.tar.gz: 616cf07e0733a34ffc8b4a349c00df5ad66bf15222d3fd5809b09db0c53be745d9efd985801ee6b14d31405f8bc4a72f52e1f271d1c55d7e13516a5ad62cb537
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,26 @@
|
|
1
|
+
1.15.0 / 2021-03-05
|
2
|
+
-------------------
|
3
|
+
|
4
|
+
Fixed:
|
5
|
+
* Fix MSVC build
|
6
|
+
* Fix async callbacks in conjunction with fork(). #884
|
7
|
+
|
8
|
+
Added:
|
9
|
+
* Allow to pass callbacks in varargs. #885
|
10
|
+
* Name the threads for FFI callback dispatcher and async thread calls for easier debugging. #883
|
11
|
+
The name can be retrieved by Thread.name and is shown by Thread.list.inspect etc.
|
12
|
+
Even gdb shows the thread name on supported operating systems.
|
13
|
+
* Add types.conf for powerpc64le-linux
|
14
|
+
* Add types.conf for riscv64-linux
|
15
|
+
* More release automation of ffi gems
|
16
|
+
|
17
|
+
Changed:
|
18
|
+
* Switch from rubygems-tasks to bundler/gem_helper
|
19
|
+
|
20
|
+
Removed:
|
21
|
+
* Remove unused VariadicInvoker#init
|
22
|
+
|
23
|
+
|
1
24
|
1.14.2 / 2020-12-21
|
2
25
|
-------------------
|
3
26
|
|
data/Gemfile
CHANGED
@@ -5,10 +5,7 @@ group :development do
|
|
5
5
|
gem 'rake-compiler', '~> 1.0.3'
|
6
6
|
gem 'rake-compiler-dock', '~> 1.0'
|
7
7
|
gem 'rspec', '~> 3.0'
|
8
|
-
|
9
|
-
# irb versions > 1.1.1 depend on reline,
|
10
|
-
# which sometimes causes 'bundle install' to fail on Ruby <= 2.4: https://github.com/rubygems/rubygems/issues/3463
|
11
|
-
gem 'rubygems-tasks', '>= 0.2', '< 0.2.5', :require => 'rubygems/tasks'
|
8
|
+
gem 'bundler', '~> 2.0'
|
12
9
|
end
|
13
10
|
|
14
11
|
group :doc do
|
data/Rakefile
CHANGED
@@ -1,20 +1,17 @@
|
|
1
|
-
require 'rubygems/tasks'
|
2
1
|
require 'rbconfig'
|
3
|
-
require 'rake/clean'
|
4
|
-
require_relative "lib/ffi/version"
|
5
|
-
|
6
2
|
require 'date'
|
7
3
|
require 'fileutils'
|
8
4
|
require 'rbconfig'
|
9
5
|
require 'rspec/core/rake_task'
|
10
6
|
require 'rubygems/package_task'
|
7
|
+
require 'rake/extensiontask'
|
8
|
+
require_relative "lib/ffi/version"
|
9
|
+
require_relative "rakelib/ffi_gem_helper"
|
11
10
|
|
12
11
|
BUILD_DIR = "build"
|
13
12
|
BUILD_EXT_DIR = File.join(BUILD_DIR, "#{RbConfig::CONFIG['arch']}", 'ffi_c', RUBY_VERSION)
|
14
13
|
|
15
|
-
|
16
|
-
@gem_spec ||= Gem::Specification.load('ffi.gemspec')
|
17
|
-
end
|
14
|
+
gem_spec = Bundler.load_gemspec('ffi.gemspec')
|
18
15
|
|
19
16
|
RSpec::Core::RakeTask.new(:spec => :compile) do |config|
|
20
17
|
config.rspec_opts = YAML.load_file 'spec/spec.opts'
|
@@ -87,6 +84,10 @@ end
|
|
87
84
|
|
88
85
|
task 'gem:java' => 'java:gem'
|
89
86
|
|
87
|
+
FfiGemHelper.install_tasks
|
88
|
+
# Register windows gems to be pushed to rubygems.org
|
89
|
+
Bundler::GemHelper.instance.cross_platforms = %w[x86-mingw32 x64-mingw32]
|
90
|
+
|
90
91
|
if RUBY_ENGINE == 'ruby' || RUBY_ENGINE == 'rbx'
|
91
92
|
require 'rake/extensiontask'
|
92
93
|
Rake::ExtensionTask.new('ffi_c', gem_spec) do |ext|
|
@@ -94,21 +95,11 @@ if RUBY_ENGINE == 'ruby' || RUBY_ENGINE == 'rbx'
|
|
94
95
|
# ext.lib_dir = BUILD_DIR # put binaries into this folder.
|
95
96
|
ext.tmp_dir = BUILD_DIR # temporary folder used during compilation.
|
96
97
|
ext.cross_compile = true # enable cross compilation (requires cross compile toolchain)
|
97
|
-
ext.cross_platform =
|
98
|
+
ext.cross_platform = Bundler::GemHelper.instance.cross_platforms
|
98
99
|
ext.cross_compiling do |spec|
|
99
100
|
spec.files.reject! { |path| File.fnmatch?('ext/*', path) }
|
100
101
|
end
|
101
|
-
end
|
102
|
-
|
103
|
-
# To reduce the gem file size strip mingw32 dlls before packaging
|
104
|
-
ENV['RUBY_CC_VERSION'].to_s.split(':').each do |ruby_version|
|
105
|
-
task "build/i386-mingw32/stage/lib/#{ruby_version[/^\d+\.\d+/]}/ffi_c.so" do |t|
|
106
|
-
sh "i686-w64-mingw32-strip -S build/i386-mingw32/stage/lib/#{ruby_version[/^\d+\.\d+/]}/ffi_c.so"
|
107
|
-
end
|
108
102
|
|
109
|
-
task "build/x64-mingw32/stage/lib/#{ruby_version[/^\d+\.\d+/]}/ffi_c.so" do |t|
|
110
|
-
sh "x86_64-w64-mingw32-strip -S build/x64-mingw32/stage/lib/#{ruby_version[/^\d+\.\d+/]}/ffi_c.so"
|
111
|
-
end
|
112
103
|
end
|
113
104
|
else
|
114
105
|
task :compile do
|
@@ -116,6 +107,7 @@ else
|
|
116
107
|
end
|
117
108
|
end
|
118
109
|
|
110
|
+
|
119
111
|
desc "build a windows gem without all the ceremony"
|
120
112
|
task "gem:windows" do
|
121
113
|
require "rake_compiler_dock"
|
@@ -132,7 +124,7 @@ task :libffi => "ext/ffi_c/libffi/autogen.sh"
|
|
132
124
|
|
133
125
|
LIBFFI_GIT_FILES = `git --git-dir ext/ffi_c/libffi/.git ls-files -z`.split("\x0")
|
134
126
|
|
135
|
-
# Generate files in gemspec but not in libffi's git repo by running autogen.sh
|
127
|
+
# Generate files which are in the gemspec but not in libffi's git repo by running autogen.sh
|
136
128
|
gem_spec.files.select do |f|
|
137
129
|
f =~ /ext\/ffi_c\/libffi\/(.*)/ && !LIBFFI_GIT_FILES.include?($1)
|
138
130
|
end.each do |f|
|
@@ -148,6 +140,11 @@ end.each do |f|
|
|
148
140
|
end
|
149
141
|
end
|
150
142
|
|
143
|
+
# Make sure we have all gemspec files before packaging
|
144
|
+
task :build => gem_spec.files
|
145
|
+
task :gem => :build
|
146
|
+
|
147
|
+
|
151
148
|
require_relative "lib/ffi/platform"
|
152
149
|
types_conf = File.expand_path(File.join(FFI::Platform::CONF_DIR, 'types.conf'))
|
153
150
|
logfile = File.join(File.dirname(__FILE__), 'types_log')
|
@@ -168,10 +165,6 @@ end
|
|
168
165
|
desc "Create or update type information for platform #{FFI::Platform::NAME}"
|
169
166
|
task :types_conf => types_conf
|
170
167
|
|
171
|
-
Gem::Tasks.new do |t|
|
172
|
-
t.scm.tag.format = '%s'
|
173
|
-
end
|
174
|
-
|
175
168
|
begin
|
176
169
|
require 'yard'
|
177
170
|
|
data/lib/2.3/ffi_c.so
CHANGED
Binary file
|
data/lib/2.4/ffi_c.so
CHANGED
Binary file
|
data/lib/2.5/ffi_c.so
CHANGED
Binary file
|
data/lib/2.6/ffi_c.so
CHANGED
Binary file
|
data/lib/2.7/ffi_c.so
CHANGED
Binary file
|
data/lib/3.0/ffi_c.so
CHANGED
Binary file
|
@@ -0,0 +1,100 @@
|
|
1
|
+
rbx.platform.typedef.*__caddr_t = char
|
2
|
+
rbx.platform.typedef.*__qaddr_t = long
|
3
|
+
rbx.platform.typedef.__blkcnt64_t = long
|
4
|
+
rbx.platform.typedef.__blkcnt_t = long
|
5
|
+
rbx.platform.typedef.__blksize_t = long
|
6
|
+
rbx.platform.typedef.__clock_t = long
|
7
|
+
rbx.platform.typedef.__clockid_t = int
|
8
|
+
rbx.platform.typedef.__daddr_t = int
|
9
|
+
rbx.platform.typedef.__dev_t = ulong
|
10
|
+
rbx.platform.typedef.__fd_mask = long
|
11
|
+
rbx.platform.typedef.__fsblkcnt64_t = ulong
|
12
|
+
rbx.platform.typedef.__fsblkcnt_t = ulong
|
13
|
+
rbx.platform.typedef.__fsfilcnt64_t = ulong
|
14
|
+
rbx.platform.typedef.__fsfilcnt_t = ulong
|
15
|
+
rbx.platform.typedef.__gid_t = uint
|
16
|
+
rbx.platform.typedef.__id_t = uint
|
17
|
+
rbx.platform.typedef.__ino64_t = ulong
|
18
|
+
rbx.platform.typedef.__ino_t = ulong
|
19
|
+
rbx.platform.typedef.__int16_t = short
|
20
|
+
rbx.platform.typedef.__int32_t = int
|
21
|
+
rbx.platform.typedef.__int64_t = long
|
22
|
+
rbx.platform.typedef.__int8_t = char
|
23
|
+
rbx.platform.typedef.__intptr_t = long
|
24
|
+
rbx.platform.typedef.__key_t = int
|
25
|
+
rbx.platform.typedef.__loff_t = long
|
26
|
+
rbx.platform.typedef.__mode_t = uint
|
27
|
+
rbx.platform.typedef.__nlink_t = ulong
|
28
|
+
rbx.platform.typedef.__off64_t = long
|
29
|
+
rbx.platform.typedef.__off_t = long
|
30
|
+
rbx.platform.typedef.__pid_t = int
|
31
|
+
rbx.platform.typedef.__priority_which_t = int
|
32
|
+
rbx.platform.typedef.__quad_t = long
|
33
|
+
rbx.platform.typedef.__rlim64_t = ulong
|
34
|
+
rbx.platform.typedef.__rlim_t = ulong
|
35
|
+
rbx.platform.typedef.__rlimit_resource_t = int
|
36
|
+
rbx.platform.typedef.__rusage_who_t = int
|
37
|
+
rbx.platform.typedef.__sig_atomic_t = int
|
38
|
+
rbx.platform.typedef.__socklen_t = uint
|
39
|
+
rbx.platform.typedef.__ssize_t = long
|
40
|
+
rbx.platform.typedef.__suseconds_t = long
|
41
|
+
rbx.platform.typedef.__swblk_t = long
|
42
|
+
rbx.platform.typedef.__time_t = long
|
43
|
+
rbx.platform.typedef.__timer_t = pointer
|
44
|
+
rbx.platform.typedef.__u_char = uchar
|
45
|
+
rbx.platform.typedef.__u_int = uint
|
46
|
+
rbx.platform.typedef.__u_long = ulong
|
47
|
+
rbx.platform.typedef.__u_quad_t = ulong
|
48
|
+
rbx.platform.typedef.__u_short = ushort
|
49
|
+
rbx.platform.typedef.__uid_t = uint
|
50
|
+
rbx.platform.typedef.__uint16_t = ushort
|
51
|
+
rbx.platform.typedef.__uint32_t = uint
|
52
|
+
rbx.platform.typedef.__uint64_t = ulong
|
53
|
+
rbx.platform.typedef.__uint8_t = uchar
|
54
|
+
rbx.platform.typedef.__useconds_t = uint
|
55
|
+
rbx.platform.typedef.blkcnt_t = long
|
56
|
+
rbx.platform.typedef.clockid_t = int
|
57
|
+
rbx.platform.typedef.daddr_t = int
|
58
|
+
rbx.platform.typedef.dev_t = ulong
|
59
|
+
rbx.platform.typedef.fd_mask = long
|
60
|
+
rbx.platform.typedef.fsblkcnt_t = ulong
|
61
|
+
rbx.platform.typedef.fsfilcnt_t = ulong
|
62
|
+
rbx.platform.typedef.gid_t = uint
|
63
|
+
rbx.platform.typedef.id_t = uint
|
64
|
+
rbx.platform.typedef.ino_t = ulong
|
65
|
+
rbx.platform.typedef.int16_t = short
|
66
|
+
rbx.platform.typedef.int32_t = int
|
67
|
+
rbx.platform.typedef.int64_t = long
|
68
|
+
rbx.platform.typedef.int8_t = char
|
69
|
+
rbx.platform.typedef.key_t = int
|
70
|
+
rbx.platform.typedef.loff_t = long
|
71
|
+
rbx.platform.typedef.mode_t = uint
|
72
|
+
rbx.platform.typedef.nlink_t = ulong
|
73
|
+
rbx.platform.typedef.off_t = long
|
74
|
+
rbx.platform.typedef.pid_t = int
|
75
|
+
rbx.platform.typedef.pthread_key_t = uint
|
76
|
+
rbx.platform.typedef.pthread_once_t = int
|
77
|
+
rbx.platform.typedef.pthread_t = ulong
|
78
|
+
rbx.platform.typedef.quad_t = long
|
79
|
+
rbx.platform.typedef.register_t = long
|
80
|
+
rbx.platform.typedef.rlim_t = ulong
|
81
|
+
rbx.platform.typedef.sa_family_t = ushort
|
82
|
+
rbx.platform.typedef.size_t = ulong
|
83
|
+
rbx.platform.typedef.socklen_t = uint
|
84
|
+
rbx.platform.typedef.ssize_t = long
|
85
|
+
rbx.platform.typedef.suseconds_t = long
|
86
|
+
rbx.platform.typedef.time_t = long
|
87
|
+
rbx.platform.typedef.timer_t = pointer
|
88
|
+
rbx.platform.typedef.u_char = uchar
|
89
|
+
rbx.platform.typedef.u_int = uint
|
90
|
+
rbx.platform.typedef.u_int16_t = ushort
|
91
|
+
rbx.platform.typedef.u_int32_t = uint
|
92
|
+
rbx.platform.typedef.u_int64_t = ulong
|
93
|
+
rbx.platform.typedef.u_int8_t = uchar
|
94
|
+
rbx.platform.typedef.u_long = ulong
|
95
|
+
rbx.platform.typedef.u_quad_t = ulong
|
96
|
+
rbx.platform.typedef.u_short = ushort
|
97
|
+
rbx.platform.typedef.uid_t = uint
|
98
|
+
rbx.platform.typedef.uint = uint
|
99
|
+
rbx.platform.typedef.ulong = ulong
|
100
|
+
rbx.platform.typedef.ushort = ushort
|
@@ -0,0 +1,104 @@
|
|
1
|
+
rbx.platform.typedef.*__caddr_t = char
|
2
|
+
rbx.platform.typedef.*__qaddr_t = long
|
3
|
+
rbx.platform.typedef.__blkcnt64_t = long
|
4
|
+
rbx.platform.typedef.__blkcnt_t = long
|
5
|
+
rbx.platform.typedef.__blksize_t = int
|
6
|
+
rbx.platform.typedef.__clock_t = long
|
7
|
+
rbx.platform.typedef.__clockid_t = int
|
8
|
+
rbx.platform.typedef.__daddr_t = int
|
9
|
+
rbx.platform.typedef.__dev_t = ulong
|
10
|
+
rbx.platform.typedef.__fd_mask = long
|
11
|
+
rbx.platform.typedef.__fsblkcnt64_t = ulong
|
12
|
+
rbx.platform.typedef.__fsblkcnt_t = ulong
|
13
|
+
rbx.platform.typedef.__fsfilcnt64_t = ulong
|
14
|
+
rbx.platform.typedef.__fsfilcnt_t = ulong
|
15
|
+
rbx.platform.typedef.__fsword_t = long
|
16
|
+
rbx.platform.typedef.__gid_t = uint
|
17
|
+
rbx.platform.typedef.__id_t = uint
|
18
|
+
rbx.platform.typedef.__ino64_t = ulong
|
19
|
+
rbx.platform.typedef.__ino_t = ulong
|
20
|
+
rbx.platform.typedef.__int16_t = short
|
21
|
+
rbx.platform.typedef.__int32_t = int
|
22
|
+
rbx.platform.typedef.__int64_t = long
|
23
|
+
rbx.platform.typedef.__int8_t = char
|
24
|
+
rbx.platform.typedef.__intptr_t = long
|
25
|
+
rbx.platform.typedef.__key_t = int
|
26
|
+
rbx.platform.typedef.__loff_t = long
|
27
|
+
rbx.platform.typedef.__mode_t = uint
|
28
|
+
rbx.platform.typedef.__nlink_t = uint
|
29
|
+
rbx.platform.typedef.__off64_t = long
|
30
|
+
rbx.platform.typedef.__off_t = long
|
31
|
+
rbx.platform.typedef.__pid_t = int
|
32
|
+
rbx.platform.typedef.__priority_which_t = int
|
33
|
+
rbx.platform.typedef.__quad_t = long
|
34
|
+
rbx.platform.typedef.__rlim64_t = ulong
|
35
|
+
rbx.platform.typedef.__rlim_t = ulong
|
36
|
+
rbx.platform.typedef.__rlimit_resource_t = int
|
37
|
+
rbx.platform.typedef.__rusage_who_t = int
|
38
|
+
rbx.platform.typedef.__sig_atomic_t = int
|
39
|
+
rbx.platform.typedef.__socklen_t = uint
|
40
|
+
rbx.platform.typedef.__ssize_t = long
|
41
|
+
rbx.platform.typedef.__suseconds_t = long
|
42
|
+
rbx.platform.typedef.__syscall_slong_t = long
|
43
|
+
rbx.platform.typedef.__syscall_ulong_t = ulong
|
44
|
+
rbx.platform.typedef.__time_t = long
|
45
|
+
rbx.platform.typedef.__timer_t = pointer
|
46
|
+
rbx.platform.typedef.__u_char = uchar
|
47
|
+
rbx.platform.typedef.__u_int = uint
|
48
|
+
rbx.platform.typedef.__u_long = ulong
|
49
|
+
rbx.platform.typedef.__u_quad_t = ulong
|
50
|
+
rbx.platform.typedef.__u_short = ushort
|
51
|
+
rbx.platform.typedef.__uid_t = uint
|
52
|
+
rbx.platform.typedef.__uint16_t = ushort
|
53
|
+
rbx.platform.typedef.__uint32_t = uint
|
54
|
+
rbx.platform.typedef.__uint64_t = ulong
|
55
|
+
rbx.platform.typedef.__uint8_t = uchar
|
56
|
+
rbx.platform.typedef.__useconds_t = uint
|
57
|
+
rbx.platform.typedef.blkcnt_t = long
|
58
|
+
rbx.platform.typedef.blksize_t = int
|
59
|
+
rbx.platform.typedef.clock_t = long
|
60
|
+
rbx.platform.typedef.clockid_t = int
|
61
|
+
rbx.platform.typedef.daddr_t = int
|
62
|
+
rbx.platform.typedef.dev_t = ulong
|
63
|
+
rbx.platform.typedef.fd_mask = long
|
64
|
+
rbx.platform.typedef.fsblkcnt_t = ulong
|
65
|
+
rbx.platform.typedef.fsfilcnt_t = ulong
|
66
|
+
rbx.platform.typedef.gid_t = uint
|
67
|
+
rbx.platform.typedef.id_t = uint
|
68
|
+
rbx.platform.typedef.ino_t = ulong
|
69
|
+
rbx.platform.typedef.int16_t = short
|
70
|
+
rbx.platform.typedef.int32_t = int
|
71
|
+
rbx.platform.typedef.int64_t = long
|
72
|
+
rbx.platform.typedef.int8_t = char
|
73
|
+
rbx.platform.typedef.key_t = int
|
74
|
+
rbx.platform.typedef.loff_t = long
|
75
|
+
rbx.platform.typedef.mode_t = uint
|
76
|
+
rbx.platform.typedef.nlink_t = uint
|
77
|
+
rbx.platform.typedef.off_t = long
|
78
|
+
rbx.platform.typedef.pid_t = int
|
79
|
+
rbx.platform.typedef.pthread_key_t = uint
|
80
|
+
rbx.platform.typedef.pthread_once_t = int
|
81
|
+
rbx.platform.typedef.pthread_t = ulong
|
82
|
+
rbx.platform.typedef.quad_t = long
|
83
|
+
rbx.platform.typedef.register_t = long
|
84
|
+
rbx.platform.typedef.rlim_t = ulong
|
85
|
+
rbx.platform.typedef.sa_family_t = ushort
|
86
|
+
rbx.platform.typedef.size_t = ulong
|
87
|
+
rbx.platform.typedef.socklen_t = uint
|
88
|
+
rbx.platform.typedef.ssize_t = long
|
89
|
+
rbx.platform.typedef.suseconds_t = long
|
90
|
+
rbx.platform.typedef.time_t = long
|
91
|
+
rbx.platform.typedef.timer_t = pointer
|
92
|
+
rbx.platform.typedef.u_char = uchar
|
93
|
+
rbx.platform.typedef.u_int = uint
|
94
|
+
rbx.platform.typedef.u_int16_t = ushort
|
95
|
+
rbx.platform.typedef.u_int32_t = uint
|
96
|
+
rbx.platform.typedef.u_int64_t = ulong
|
97
|
+
rbx.platform.typedef.u_int8_t = uchar
|
98
|
+
rbx.platform.typedef.u_long = ulong
|
99
|
+
rbx.platform.typedef.u_quad_t = ulong
|
100
|
+
rbx.platform.typedef.u_short = ushort
|
101
|
+
rbx.platform.typedef.uid_t = uint
|
102
|
+
rbx.platform.typedef.uint = uint
|
103
|
+
rbx.platform.typedef.ulong = ulong
|
104
|
+
rbx.platform.typedef.ushort = ushort
|
data/lib/ffi/variadic.rb
CHANGED
@@ -32,15 +32,6 @@
|
|
32
32
|
|
33
33
|
module FFI
|
34
34
|
class VariadicInvoker
|
35
|
-
def init(arg_types, type_map)
|
36
|
-
@fixed = Array.new
|
37
|
-
@type_map = type_map
|
38
|
-
arg_types.each_with_index do |type, i|
|
39
|
-
@fixed << type unless type == Type::VARARGS
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
|
44
35
|
def call(*args, &block)
|
45
36
|
param_types = Array.new(@fixed)
|
46
37
|
param_values = Array.new
|
data/lib/ffi/version.rb
CHANGED
@@ -0,0 +1,65 @@
|
|
1
|
+
require 'bundler'
|
2
|
+
require 'bundler/gem_helper'
|
3
|
+
|
4
|
+
class FfiGemHelper < Bundler::GemHelper
|
5
|
+
attr_accessor :cross_platforms
|
6
|
+
|
7
|
+
def install
|
8
|
+
super
|
9
|
+
|
10
|
+
task "release:guard_clean" => ["release:update_history"]
|
11
|
+
|
12
|
+
task "release:update_history" do
|
13
|
+
update_history
|
14
|
+
end
|
15
|
+
|
16
|
+
task "release:rubygem_push" => ["gem:windows", "gem:java"]
|
17
|
+
end
|
18
|
+
|
19
|
+
def hfile
|
20
|
+
"CHANGELOG.md"
|
21
|
+
end
|
22
|
+
|
23
|
+
def headline
|
24
|
+
'([^\w]*)(\d+\.\d+\.\d+(?:\.\w+)?)([^\w]+)([2Y][0Y][0-9Y][0-9Y]-[0-1M][0-9M]-[0-3D][0-9D])([^\w]*|$)'
|
25
|
+
end
|
26
|
+
|
27
|
+
def reldate
|
28
|
+
Time.now.strftime("%Y-%m-%d")
|
29
|
+
end
|
30
|
+
|
31
|
+
def update_history
|
32
|
+
hin = File.read(hfile)
|
33
|
+
hout = hin.sub(/#{headline}/) do
|
34
|
+
raise "#{hfile} isn't up-to-date for version #{version}" unless $2==version.to_s
|
35
|
+
$1 + $2 + $3 + reldate + $5
|
36
|
+
end
|
37
|
+
if hout != hin
|
38
|
+
Bundler.ui.confirm "Updating #{hfile} for release."
|
39
|
+
File.write(hfile, hout)
|
40
|
+
Rake::FileUtilsExt.sh "git", "commit", hfile, "-m", "Update release date in #{hfile}"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def tag_version
|
45
|
+
Bundler.ui.confirm "Tag release with annotation:"
|
46
|
+
m = File.read(hfile).match(/(?<annotation>#{headline}.*?)#{headline}/m) || raise("Unable to find release notes in #{hfile}")
|
47
|
+
Bundler.ui.info(m[:annotation].gsub(/^/, " "))
|
48
|
+
IO.popen(["git", "tag", "--file=-", version_tag], "w") do |fd|
|
49
|
+
fd.write m[:annotation]
|
50
|
+
end
|
51
|
+
yield if block_given?
|
52
|
+
rescue
|
53
|
+
Bundler.ui.error "Untagging #{version_tag} due to error."
|
54
|
+
sh_with_code "git tag -d #{version_tag}"
|
55
|
+
raise
|
56
|
+
end
|
57
|
+
|
58
|
+
def rubygem_push(path)
|
59
|
+
cross_platforms.each do |ruby_platform|
|
60
|
+
super(path.gsub(/\.gem\z/, "-#{ruby_platform}.gem"))
|
61
|
+
end
|
62
|
+
super(path.gsub(/\.gem\z/, "-java.gem"))
|
63
|
+
super(path)
|
64
|
+
end
|
65
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ffi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.15.0
|
5
5
|
platform: x64-mingw32
|
6
6
|
authors:
|
7
7
|
- Wayne Meissner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -146,6 +146,8 @@ files:
|
|
146
146
|
- lib/ffi/platform/powerpc-linux/types.conf
|
147
147
|
- lib/ffi/platform/powerpc-openbsd/types.conf
|
148
148
|
- lib/ffi/platform/powerpc64-linux/types.conf
|
149
|
+
- lib/ffi/platform/powerpc64le-linux/types.conf
|
150
|
+
- lib/ffi/platform/riscv64-linux/types.conf
|
149
151
|
- lib/ffi/platform/s390-linux/types.conf
|
150
152
|
- lib/ffi/platform/s390x-linux/types.conf
|
151
153
|
- lib/ffi/platform/sparc-linux/types.conf
|
@@ -179,6 +181,7 @@ files:
|
|
179
181
|
- lib/ffi/union.rb
|
180
182
|
- lib/ffi/variadic.rb
|
181
183
|
- lib/ffi/version.rb
|
184
|
+
- rakelib/ffi_gem_helper.rb
|
182
185
|
- samples/getlogin.rb
|
183
186
|
- samples/getpid.rb
|
184
187
|
- samples/gettimeofday.rb
|
@@ -216,7 +219,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
216
219
|
- !ruby/object:Gem::Version
|
217
220
|
version: '0'
|
218
221
|
requirements: []
|
219
|
-
rubygems_version: 3.2.
|
222
|
+
rubygems_version: 3.2.3
|
220
223
|
signing_key:
|
221
224
|
specification_version: 4
|
222
225
|
summary: Ruby FFI
|