ffi 1.15.3 → 1.15.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +25 -0
- data/Rakefile +21 -7
- data/ext/ffi_c/Call.c +1 -1
- data/ext/ffi_c/Platform.c +2 -2
- data/ffi.gemspec +0 -1
- data/lib/ffi/library.rb +1 -1
- data/lib/ffi/tools/const_generator.rb +5 -4
- data/lib/ffi/version.rb +1 -1
- data/lib/ffi.rb +1 -1
- data/rakelib/ffi_gem_helper.rb +1 -1
- metadata +6 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d6f15f4e38ad34949be88341216eed2ea132c4e5763d333c20c240491b033ff6
|
4
|
+
data.tar.gz: deefb7285ccae7d7248ee2697709e859d4c0017e3aab7e183ce7fc2a824bd395
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b2c32adb0af3689632c9b6113389245dba13d5f9e622efd2f322b0226933185ae0fbc128cb33c278dd2ef7fddda106fe8158904e95d1fa7d53b14ff72722ff6
|
7
|
+
data.tar.gz: 60ca6ad01c3d977b8b6efe0329683d4105cae8147848c9fcb0cabe643f5957e7a6ab6a06716e1f579ada6e0c3795f4fd4c0f16bda783342310a305423a5d7a60
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,28 @@
|
|
1
|
+
1.15.5 / 2022-01-10
|
2
|
+
-------------------
|
3
|
+
|
4
|
+
Fixed:
|
5
|
+
* Fix long double argument or return values on 32bit i686. #849
|
6
|
+
* FFI::ConstGenerator: avoid usage of the same binary file simultaneously. #929
|
7
|
+
|
8
|
+
Added:
|
9
|
+
* Add Windows fat binary gem for Ruby-3.1
|
10
|
+
|
11
|
+
Removed:
|
12
|
+
* Remove Windows fat binary gem for Ruby < 2.4
|
13
|
+
|
14
|
+
|
15
|
+
1.15.4 / 2021-09-01
|
16
|
+
-------------------
|
17
|
+
|
18
|
+
Fixed:
|
19
|
+
* Fix build for uClibc. #913
|
20
|
+
* Correct module lookup when including `ffi-module` gem. #912
|
21
|
+
|
22
|
+
Changed:
|
23
|
+
* Use ruby code of the ffi gem in JRuby-9.2.20+. #915
|
24
|
+
|
25
|
+
|
1
26
|
1.15.3 / 2021-06-16
|
2
27
|
-------------------
|
3
28
|
|
data/Rakefile
CHANGED
@@ -18,7 +18,7 @@ RSpec::Core::RakeTask.new(:spec => :compile) do |config|
|
|
18
18
|
end
|
19
19
|
|
20
20
|
desc "Build all packages"
|
21
|
-
task :package => %w[ gem:java gem:
|
21
|
+
task :package => %w[ gem:java gem:native ]
|
22
22
|
|
23
23
|
CLOBBER.include 'lib/ffi/types.conf'
|
24
24
|
CLOBBER.include 'pkg'
|
@@ -86,7 +86,7 @@ task 'gem:java' => 'java:gem'
|
|
86
86
|
|
87
87
|
FfiGemHelper.install_tasks
|
88
88
|
# Register windows gems to be pushed to rubygems.org
|
89
|
-
Bundler::GemHelper.instance.cross_platforms = %w[x86-mingw32 x64-mingw32]
|
89
|
+
Bundler::GemHelper.instance.cross_platforms = %w[x86-mingw32 x64-mingw-ucrt x64-mingw32]
|
90
90
|
|
91
91
|
if RUBY_ENGINE == 'ruby' || RUBY_ENGINE == 'rbx'
|
92
92
|
require 'rake/extensiontask'
|
@@ -108,11 +108,25 @@ else
|
|
108
108
|
end
|
109
109
|
|
110
110
|
|
111
|
-
|
112
|
-
task
|
113
|
-
|
114
|
-
|
115
|
-
|
111
|
+
namespace "gem" do
|
112
|
+
task 'prepare' do
|
113
|
+
require 'rake_compiler_dock'
|
114
|
+
sh "bundle package --all"
|
115
|
+
end
|
116
|
+
|
117
|
+
Bundler::GemHelper.instance.cross_platforms.each do |plat|
|
118
|
+
desc "Build all native binary gems in parallel"
|
119
|
+
multitask 'native' => plat
|
120
|
+
|
121
|
+
desc "Build the native gem for #{plat}"
|
122
|
+
task plat => ['prepare', 'build'] do
|
123
|
+
RakeCompilerDock.sh <<-EOT, platform: plat
|
124
|
+
sudo apt-get update &&
|
125
|
+
sudo apt-get install -y libltdl-dev && bundle --local &&
|
126
|
+
rake cross native gem MAKE='nice make -j`nproc`' RUBY_CC_VERSION=${RUBY_CC_VERSION/:2.2.2/}
|
127
|
+
EOT
|
128
|
+
end
|
129
|
+
end
|
116
130
|
end
|
117
131
|
|
118
132
|
directory "ext/ffi_c/libffi"
|
data/ext/ffi_c/Call.c
CHANGED
@@ -71,7 +71,7 @@
|
|
71
71
|
#define FLOAT32_ADJ (4)
|
72
72
|
#define FLOAT64_ADJ (8)
|
73
73
|
#define ADDRESS_ADJ (sizeof(void *))
|
74
|
-
#define LONGDOUBLE_ADJ (ffi_type_longdouble.alignment)
|
74
|
+
#define LONGDOUBLE_ADJ (ffi_type_longdouble.alignment > sizeof(long double) ? ffi_type_longdouble.alignment : sizeof(long double))
|
75
75
|
|
76
76
|
#endif /* USE_RAW */
|
77
77
|
|
data/ext/ffi_c/Platform.c
CHANGED
@@ -38,7 +38,7 @@
|
|
38
38
|
#include "rbffi_endian.h"
|
39
39
|
#include "Platform.h"
|
40
40
|
|
41
|
-
#if defined(__GNU__) || defined(__GLIBC__)
|
41
|
+
#if defined(__GNU__) || (defined(__GLIBC__) && !defined(__UCLIBC__))
|
42
42
|
# include <gnu/lib-names.h>
|
43
43
|
#endif
|
44
44
|
|
@@ -71,7 +71,7 @@ rbffi_Platform_Init(VALUE moduleFFI)
|
|
71
71
|
rb_define_const(PlatformModule, "BYTE_ORDER", INT2FIX(BYTE_ORDER));
|
72
72
|
rb_define_const(PlatformModule, "LITTLE_ENDIAN", INT2FIX(LITTLE_ENDIAN));
|
73
73
|
rb_define_const(PlatformModule, "BIG_ENDIAN", INT2FIX(BIG_ENDIAN));
|
74
|
-
#if defined(__GNU__) || defined(__GLIBC__)
|
74
|
+
#if defined(__GNU__) || (defined(__GLIBC__) && !defined(__UCLIBC__))
|
75
75
|
rb_define_const(PlatformModule, "GNU_LIBC", rb_str_new2(LIBC_SO));
|
76
76
|
#endif
|
77
77
|
export_primitive_types(PlatformModule);
|
data/ffi.gemspec
CHANGED
@@ -39,5 +39,4 @@ Gem::Specification.new do |s|
|
|
39
39
|
s.add_development_dependency 'rake-compiler', '~> 1.0'
|
40
40
|
s.add_development_dependency 'rake-compiler-dock', '~> 1.0'
|
41
41
|
s.add_development_dependency 'rspec', '~> 2.14.1'
|
42
|
-
s.add_development_dependency 'rubygems-tasks', "~> 0.2.4"
|
43
42
|
end
|
data/lib/ffi/library.rb
CHANGED
@@ -84,7 +84,7 @@ module FFI
|
|
84
84
|
# @raise {RuntimeError} if +mod+ is not a Module
|
85
85
|
# Test if extended object is a Module. If not, raise RuntimeError.
|
86
86
|
def self.extended(mod)
|
87
|
-
raise RuntimeError.new("must only be extended by module") unless mod.kind_of?(Module)
|
87
|
+
raise RuntimeError.new("must only be extended by module") unless mod.kind_of?(::Module)
|
88
88
|
end
|
89
89
|
|
90
90
|
|
@@ -105,9 +105,10 @@ module FFI
|
|
105
105
|
# @return [nil]
|
106
106
|
# @raise if a constant is missing and +:required+ was set to +true+ (see {#initialize})
|
107
107
|
def calculate(options = {})
|
108
|
-
|
108
|
+
binary_path = nil
|
109
109
|
|
110
110
|
Tempfile.open("#{@prefix}.const_generator") do |f|
|
111
|
+
binary_path = f.path + ".bin"
|
111
112
|
@includes.each do |inc|
|
112
113
|
f.puts "#include <#{inc}>"
|
113
114
|
end
|
@@ -125,7 +126,7 @@ module FFI
|
|
125
126
|
f.flush
|
126
127
|
|
127
128
|
cc = ENV['CC'] || 'gcc'
|
128
|
-
output = `#{cc} #{options[:cppflags]} -D_DARWIN_USE_64_BIT_INODE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -x c -Wall -Werror #{f.path} -o #{
|
129
|
+
output = `#{cc} #{options[:cppflags]} -D_DARWIN_USE_64_BIT_INODE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -x c -Wall -Werror #{f.path} -o #{binary_path} 2>&1`
|
129
130
|
|
130
131
|
unless $?.success? then
|
131
132
|
output = output.split("\n").map { |l| "\t#{l}" }.join "\n"
|
@@ -133,8 +134,8 @@ module FFI
|
|
133
134
|
end
|
134
135
|
end
|
135
136
|
|
136
|
-
output = `#{
|
137
|
-
File.unlink(
|
137
|
+
output = `#{binary_path}`
|
138
|
+
File.unlink(binary_path + (FFI::Platform.windows? ? ".exe" : ""))
|
138
139
|
output.each_line do |line|
|
139
140
|
line =~ /^(\S+)\s(.*)$/
|
140
141
|
const = @constants[$1]
|
data/lib/ffi/version.rb
CHANGED
data/lib/ffi.rb
CHANGED
@@ -7,7 +7,7 @@ if RUBY_ENGINE == 'ruby'
|
|
7
7
|
|
8
8
|
require 'ffi/ffi'
|
9
9
|
|
10
|
-
elsif RUBY_ENGINE == 'jruby' && (RUBY_ENGINE_VERSION.split('.').map(&:to_i) <=> [9,
|
10
|
+
elsif RUBY_ENGINE == 'jruby' && (RUBY_ENGINE_VERSION.split('.').map(&:to_i) <=> [9, 2, 20]) >= 0
|
11
11
|
JRuby::Util.load_ext("org.jruby.ext.ffi.FFIService")
|
12
12
|
require 'ffi/ffi'
|
13
13
|
|
data/rakelib/ffi_gem_helper.rb
CHANGED
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.15.
|
4
|
+
version: 1.15.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wayne Meissner
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -66,20 +66,6 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 2.14.1
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: rubygems-tasks
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - "~>"
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: 0.2.4
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - "~>"
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: 0.2.4
|
83
69
|
description: Ruby FFI library
|
84
70
|
email: wmeissner@gmail.com
|
85
71
|
executables: []
|
@@ -666,7 +652,7 @@ metadata:
|
|
666
652
|
wiki_uri: https://github.com/ffi/ffi/wiki
|
667
653
|
source_code_uri: https://github.com/ffi/ffi/
|
668
654
|
mailing_list_uri: http://groups.google.com/group/ruby-ffi
|
669
|
-
post_install_message:
|
655
|
+
post_install_message:
|
670
656
|
rdoc_options:
|
671
657
|
- "--exclude=ext/ffi_c/.*\\.o$"
|
672
658
|
- "--exclude=ffi_c\\.(bundle|so)$"
|
@@ -683,8 +669,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
683
669
|
- !ruby/object:Gem::Version
|
684
670
|
version: '0'
|
685
671
|
requirements: []
|
686
|
-
rubygems_version: 3.
|
687
|
-
signing_key:
|
672
|
+
rubygems_version: 3.3.4
|
673
|
+
signing_key:
|
688
674
|
specification_version: 4
|
689
675
|
summary: Ruby FFI
|
690
676
|
test_files: []
|