ffi 1.13.0 → 1.15.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +127 -0
  3. data/Gemfile +1 -4
  4. data/README.md +14 -2
  5. data/Rakefile +43 -29
  6. data/ext/ffi_c/AbstractMemory.c +24 -25
  7. data/ext/ffi_c/Buffer.c +2 -7
  8. data/ext/ffi_c/Call.c +3 -9
  9. data/ext/ffi_c/ClosurePool.c +64 -11
  10. data/ext/ffi_c/ClosurePool.h +3 -1
  11. data/ext/ffi_c/DynamicLibrary.c +1 -6
  12. data/ext/ffi_c/Function.c +31 -16
  13. data/ext/ffi_c/Function.h +0 -4
  14. data/ext/ffi_c/FunctionInfo.c +2 -6
  15. data/ext/ffi_c/LastError.c +2 -6
  16. data/ext/ffi_c/MemoryPointer.c +2 -7
  17. data/ext/ffi_c/MemoryPointer.h +0 -4
  18. data/ext/ffi_c/MethodHandle.c +4 -8
  19. data/ext/ffi_c/Platform.c +4 -9
  20. data/ext/ffi_c/Pointer.c +24 -25
  21. data/ext/ffi_c/Pointer.h +0 -4
  22. data/ext/ffi_c/Struct.c +3 -6
  23. data/ext/ffi_c/StructByValue.c +2 -7
  24. data/ext/ffi_c/StructLayout.c +2 -6
  25. data/ext/ffi_c/Thread.c +0 -5
  26. data/ext/ffi_c/Thread.h +1 -6
  27. data/ext/ffi_c/Type.c +1 -1
  28. data/ext/ffi_c/Types.c +6 -7
  29. data/ext/ffi_c/Types.h +3 -4
  30. data/ext/ffi_c/Variadic.c +14 -9
  31. data/ext/ffi_c/extconf.rb +25 -10
  32. data/ext/ffi_c/libffi/.travis/bfin-sim.exp +1 -1
  33. data/ext/ffi_c/libffi/.travis/m32r-sim.exp +1 -1
  34. data/ext/ffi_c/libffi/.travis/moxie-sim.exp +1 -1
  35. data/ext/ffi_c/libffi/.travis/or1k-sim.exp +1 -1
  36. data/ext/ffi_c/libffi/.travis/powerpc-eabisim.exp +1 -1
  37. data/ext/ffi_c/libffi/.travis/wine-sim.exp +1 -1
  38. data/ext/ffi_c/libffi/Makefile.am +48 -58
  39. data/ext/ffi_c/libffi/Makefile.in +420 -156
  40. data/ext/ffi_c/libffi/README.md +4 -0
  41. data/ext/ffi_c/libffi/config.guess +552 -331
  42. data/ext/ffi_c/libffi/config.sub +1321 -1306
  43. data/ext/ffi_c/libffi/configure +158 -96
  44. data/ext/ffi_c/libffi/configure.ac +6 -1
  45. data/ext/ffi_c/libffi/configure.host +32 -20
  46. data/ext/ffi_c/libffi/doc/Makefile.in +8 -5
  47. data/ext/ffi_c/libffi/fficonfig.h.in +6 -0
  48. data/ext/ffi_c/libffi/generate-darwin-source-and-headers.py +1 -1
  49. data/ext/ffi_c/libffi/include/Makefile.in +8 -5
  50. data/ext/ffi_c/libffi/install-sh +23 -13
  51. data/ext/ffi_c/libffi/ltmain.sh +156 -61
  52. data/ext/ffi_c/libffi/man/Makefile.in +8 -5
  53. data/ext/ffi_c/libffi/missing +8 -8
  54. data/ext/ffi_c/libffi/msvcc.sh +11 -11
  55. data/ext/ffi_c/libffi/src/aarch64/ffi.c +45 -35
  56. data/ext/ffi_c/libffi/src/aarch64/ffitarget.h +10 -5
  57. data/ext/ffi_c/libffi/src/aarch64/internal.h +1 -0
  58. data/ext/ffi_c/libffi/src/aarch64/sysv.S +1 -1
  59. data/ext/ffi_c/libffi/src/aarch64/win64_armasm.S +1 -1
  60. data/ext/ffi_c/libffi/src/arm/ffi.c +22 -0
  61. data/ext/ffi_c/libffi/src/arm/sysv.S +4 -4
  62. data/ext/ffi_c/libffi/src/closures.c +23 -6
  63. data/ext/ffi_c/libffi/src/csky/ffi.c +395 -0
  64. data/ext/ffi_c/libffi/src/csky/ffitarget.h +63 -0
  65. data/ext/ffi_c/libffi/src/csky/sysv.S +371 -0
  66. data/ext/ffi_c/libffi/src/dlmalloc.c +1 -1
  67. data/ext/ffi_c/libffi/src/kvx/asm.h +5 -0
  68. data/ext/ffi_c/libffi/src/kvx/ffi.c +273 -0
  69. data/ext/ffi_c/libffi/src/kvx/ffitarget.h +75 -0
  70. data/ext/ffi_c/libffi/src/kvx/sysv.S +127 -0
  71. data/ext/ffi_c/libffi/src/mips/ffi.c +5 -1
  72. data/ext/ffi_c/libffi/src/mips/ffitarget.h +1 -1
  73. data/ext/ffi_c/libffi/src/powerpc/ffi_darwin.c +13 -1
  74. data/ext/ffi_c/libffi/src/powerpc/ffi_powerpc.h +1 -1
  75. data/ext/ffi_c/libffi/src/powerpc/linux64.S +8 -0
  76. data/ext/ffi_c/libffi/src/powerpc/linux64_closure.S +13 -1
  77. data/ext/ffi_c/libffi/src/prep_cif.c +1 -1
  78. data/ext/ffi_c/libffi/src/x86/ffi.c +8 -2
  79. data/ext/ffi_c/libffi/src/x86/ffi64.c +7 -0
  80. data/ext/ffi_c/libffi/src/x86/ffiw64.c +5 -0
  81. data/ext/ffi_c/libffi/src/x86/sysv.S +2 -2
  82. data/ext/ffi_c/libffi/src/x86/unix64.S +1 -2
  83. data/ext/ffi_c/libffi/src/x86/win64.S +3 -2
  84. data/ext/ffi_c/libffi/src/x86/win64_intel.S +3 -2
  85. data/ext/ffi_c/libffi/testsuite/Makefile.in +9 -6
  86. data/ext/ffi_c/libffi/testsuite/lib/libffi.exp +22 -2
  87. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-call.c +4 -4
  88. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-callback.c +2 -2
  89. data/ext/ffi_c/libffi/testsuite/libffi.closures/huge_struct.c +2 -0
  90. data/ffi.gemspec +1 -2
  91. data/lib/ffi/abstract_memory.rb +44 -0
  92. data/lib/ffi/autopointer.rb +1 -1
  93. data/lib/ffi/ffi.rb +1 -0
  94. data/lib/ffi/io.rb +3 -3
  95. data/lib/ffi/library.rb +3 -3
  96. data/lib/ffi/managedstruct.rb +2 -2
  97. data/lib/ffi/platform/aarch64-darwin/types.conf +130 -0
  98. data/lib/ffi/platform/aarch64-freebsd/types.conf +2 -2
  99. data/lib/ffi/platform/aarch64-freebsd12/types.conf +113 -60
  100. data/lib/ffi/platform/aarch64-openbsd/types.conf +134 -0
  101. data/lib/ffi/platform/powerpc64le-linux/types.conf +100 -0
  102. data/lib/ffi/platform/riscv64-linux/types.conf +104 -0
  103. data/lib/ffi/platform/x86_64-dragonflybsd/types.conf +4 -22
  104. data/lib/ffi/platform/x86_64-haiku/types.conf +117 -0
  105. data/lib/ffi/platform/x86_64-msys/types.conf +119 -0
  106. data/lib/ffi/platform.rb +17 -7
  107. data/lib/ffi/pointer.rb +2 -2
  108. data/lib/ffi/tools/const_generator.rb +6 -4
  109. data/lib/ffi/tools/struct_generator.rb +2 -1
  110. data/lib/ffi/variadic.rb +1 -10
  111. data/lib/ffi/version.rb +1 -1
  112. data/lib/ffi.rb +3 -4
  113. data/rakelib/ffi_gem_helper.rb +65 -0
  114. metadata +21 -28
  115. data/.appveyor.yml +0 -30
  116. data/.github/workflows/ci.yml +0 -64
  117. data/.gitignore +0 -25
  118. data/.gitmodules +0 -4
  119. data/.travis.yml +0 -58
  120. data/.yardopts +0 -5
  121. data/ext/ffi_c/win32/stdbool.h +0 -8
  122. data/ext/ffi_c/win32/stdint.h +0 -201
data/lib/ffi/platform.rb CHANGED
@@ -63,7 +63,7 @@ module FFI
63
63
  ARCH = case CPU.downcase
64
64
  when /amd64|x86_64|x64/
65
65
  "x86_64"
66
- when /i?86|x86|i86pc/
66
+ when /i\d86|x86|i86pc/
67
67
  "i386"
68
68
  when /ppc64|powerpc64/
69
69
  "powerpc64"
@@ -71,13 +71,16 @@ module FFI
71
71
  "powerpc"
72
72
  when /sparcv9|sparc64/
73
73
  "sparcv9"
74
- else
75
- case RbConfig::CONFIG['host_cpu']
76
- when /^arm/
77
- "arm"
74
+ when /arm64|aarch64/ # MacOS calls it "arm64", other operating systems "aarch64"
75
+ "aarch64"
76
+ when /^arm/
77
+ if OS == "darwin" # Ruby before 3.0 reports "arm" instead of "arm64" as host_cpu on darwin
78
+ "aarch64"
78
79
  else
79
- RbConfig::CONFIG['host_cpu']
80
+ "arm"
80
81
  end
82
+ else
83
+ RbConfig::CONFIG['host_cpu']
81
84
  end
82
85
 
83
86
  private
@@ -129,7 +132,8 @@ module FFI
129
132
  end
130
133
 
131
134
  LIBC = if IS_WINDOWS
132
- "ucrtbase.dll"
135
+ crtname = RbConfig::CONFIG["RUBY_SO_NAME"][/msvc\w+/] || 'ucrtbase'
136
+ "#{crtname}.dll"
133
137
  elsif IS_GNU
134
138
  GNU_LIBC
135
139
  elsif OS == 'cygwin'
@@ -141,6 +145,12 @@ module FFI
141
145
  "#{LIBPREFIX}c.#{LIBSUFFIX}"
142
146
  end
143
147
 
148
+ LITTLE_ENDIAN = 1234 unless defined?(LITTLE_ENDIAN)
149
+ BIG_ENDIAN = 4321 unless defined?(BIG_ENDIAN)
150
+ unless defined?(BYTE_ORDER)
151
+ BYTE_ORDER = [0x12345678].pack("I") == [0x12345678].pack("N") ? BIG_ENDIAN : LITTLE_ENDIAN
152
+ end
153
+
144
154
  # Test if current OS is a *BSD (include MAC)
145
155
  # @return [Boolean]
146
156
  def self.bsd?
data/lib/ffi/pointer.rb CHANGED
@@ -52,7 +52,7 @@ module FFI
52
52
 
53
53
  # @param [nil,Numeric] len length of string to return
54
54
  # @return [String]
55
- # Read pointer's contents as a string, or the first +len+ bytes of the
55
+ # Read pointer's contents as a string, or the first +len+ bytes of the
56
56
  # equivalent string if +len+ is not +nil+.
57
57
  def read_string(len=nil)
58
58
  if len
@@ -96,7 +96,7 @@ module FFI
96
96
  # @param [String] str string to write
97
97
  # @param [Numeric] len length of string to return
98
98
  # @return [self]
99
- # Write +str+ in pointer's contents, or first +len+ bytes if
99
+ # Write +str+ in pointer's contents, or first +len+ bytes if
100
100
  # +len+ is not +nil+.
101
101
  def write_string(str, len=nil)
102
102
  len = str.bytesize unless len
@@ -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
- binary = File.join Dir.tmpdir, "rb_const_gen_bin_#{Process.pid}"
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
@@ -124,7 +125,8 @@ module FFI
124
125
  f.puts "\n\treturn 0;\n}"
125
126
  f.flush
126
127
 
127
- output = `gcc #{options[:cppflags]} -D_DARWIN_USE_64_BIT_INODE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -x c -Wall -Werror #{f.path} -o #{binary} 2>&1`
128
+ cc = ENV['CC'] || 'gcc'
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`
128
130
 
129
131
  unless $?.success? then
130
132
  output = output.split("\n").map { |l| "\t#{l}" }.join "\n"
@@ -132,8 +134,8 @@ module FFI
132
134
  end
133
135
  end
134
136
 
135
- output = `#{binary}`
136
- File.unlink(binary + (FFI::Platform.windows? ? ".exe" : ""))
137
+ output = `#{binary_path}`
138
+ File.unlink(binary_path + (FFI::Platform.windows? ? ".exe" : ""))
137
139
  output.each_line do |line|
138
140
  line =~ /^(\S+)\s(.*)$/
139
141
  const = @constants[$1]
@@ -82,7 +82,8 @@ module FFI
82
82
  f.puts "\n return 0;\n}"
83
83
  f.flush
84
84
 
85
- output = `gcc #{options[:cppflags]} #{options[:cflags]} -D_DARWIN_USE_64_BIT_INODE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -x c -Wall -Werror #{f.path} -o #{binary} 2>&1`
85
+ cc = ENV['CC'] || 'gcc'
86
+ output = `#{cc} #{options[:cppflags]} #{options[:cflags]} -D_DARWIN_USE_64_BIT_INODE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -x c -Wall -Werror #{f.path} -o #{binary} 2>&1`
86
87
 
87
88
  unless $?.success? then
88
89
  @found = false
data/lib/ffi/variadic.rb CHANGED
@@ -31,16 +31,7 @@
31
31
  #
32
32
 
33
33
  module FFI
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
-
34
+ class VariadicInvoker
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
@@ -1,3 +1,3 @@
1
1
  module FFI
2
- VERSION = '1.13.0'
2
+ VERSION = '1.15.5'
3
3
  end
data/lib/ffi.rb CHANGED
@@ -1,5 +1,4 @@
1
- if RUBY_ENGINE == 'ruby' || RUBY_ENGINE == 'rbx'
2
- Object.send(:remove_const, :FFI) if defined?(::FFI)
1
+ if RUBY_ENGINE == 'ruby'
3
2
  begin
4
3
  require RUBY_VERSION.split('.')[0, 2].join('.') + '/ffi_c'
5
4
  rescue Exception
@@ -8,11 +7,11 @@ if RUBY_ENGINE == 'ruby' || RUBY_ENGINE == 'rbx'
8
7
 
9
8
  require 'ffi/ffi'
10
9
 
11
- elsif RUBY_ENGINE == 'jruby' && Gem::Version.new(RUBY_ENGINE_VERSION) >= Gem::Version.new("9.3.pre")
10
+ elsif RUBY_ENGINE == 'jruby' && (RUBY_ENGINE_VERSION.split('.').map(&:to_i) <=> [9, 2, 20]) >= 0
12
11
  JRuby::Util.load_ext("org.jruby.ext.ffi.FFIService")
13
12
  require 'ffi/ffi'
14
13
 
15
- elsif RUBY_ENGINE == 'truffleruby' && Gem::Version.new(RUBY_ENGINE_VERSION) >= Gem::Version.new("20.1.0-dev-a")
14
+ elsif RUBY_ENGINE == 'truffleruby' && (RUBY_ENGINE_VERSION.split('.').map(&:to_i) <=> [20, 1, 0]) >= 0
16
15
  require 'truffleruby/ffi_backend'
17
16
  require 'ffi/ffi'
18
17
 
@@ -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:native", "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.13.0
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: 2020-06-01 00:00:00.000000000 Z
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: []
@@ -87,12 +73,6 @@ extensions:
87
73
  - ext/ffi_c/extconf.rb
88
74
  extra_rdoc_files: []
89
75
  files:
90
- - ".appveyor.yml"
91
- - ".github/workflows/ci.yml"
92
- - ".gitignore"
93
- - ".gitmodules"
94
- - ".travis.yml"
95
- - ".yardopts"
96
76
  - CHANGELOG.md
97
77
  - COPYING
98
78
  - Gemfile
@@ -251,6 +231,9 @@ files:
251
231
  - ext/ffi_c/libffi/src/cris/ffi.c
252
232
  - ext/ffi_c/libffi/src/cris/ffitarget.h
253
233
  - ext/ffi_c/libffi/src/cris/sysv.S
234
+ - ext/ffi_c/libffi/src/csky/ffi.c
235
+ - ext/ffi_c/libffi/src/csky/ffitarget.h
236
+ - ext/ffi_c/libffi/src/csky/sysv.S
254
237
  - ext/ffi_c/libffi/src/debug.c
255
238
  - ext/ffi_c/libffi/src/dlmalloc.c
256
239
  - ext/ffi_c/libffi/src/frv/eabi.S
@@ -261,6 +244,10 @@ files:
261
244
  - ext/ffi_c/libffi/src/ia64/ia64_flags.h
262
245
  - ext/ffi_c/libffi/src/ia64/unix.S
263
246
  - ext/ffi_c/libffi/src/java_raw_api.c
247
+ - ext/ffi_c/libffi/src/kvx/asm.h
248
+ - ext/ffi_c/libffi/src/kvx/ffi.c
249
+ - ext/ffi_c/libffi/src/kvx/ffitarget.h
250
+ - ext/ffi_c/libffi/src/kvx/sysv.S
264
251
  - ext/ffi_c/libffi/src/m32r/ffi.c
265
252
  - ext/ffi_c/libffi/src/m32r/ffitarget.h
266
253
  - ext/ffi_c/libffi/src/m32r/sysv.S
@@ -565,10 +552,9 @@ files:
565
552
  - ext/ffi_c/libffi/testsuite/libffi.go/static-chain.h
566
553
  - ext/ffi_c/rbffi.h
567
554
  - ext/ffi_c/rbffi_endian.h
568
- - ext/ffi_c/win32/stdbool.h
569
- - ext/ffi_c/win32/stdint.h
570
555
  - ffi.gemspec
571
556
  - lib/ffi.rb
557
+ - lib/ffi/abstract_memory.rb
572
558
  - lib/ffi/autopointer.rb
573
559
  - lib/ffi/buffer.rb
574
560
  - lib/ffi/callback.rb
@@ -581,9 +567,11 @@ files:
581
567
  - lib/ffi/managedstruct.rb
582
568
  - lib/ffi/memorypointer.rb
583
569
  - lib/ffi/platform.rb
570
+ - lib/ffi/platform/aarch64-darwin/types.conf
584
571
  - lib/ffi/platform/aarch64-freebsd/types.conf
585
572
  - lib/ffi/platform/aarch64-freebsd12/types.conf
586
573
  - lib/ffi/platform/aarch64-linux/types.conf
574
+ - lib/ffi/platform/aarch64-openbsd/types.conf
587
575
  - lib/ffi/platform/arm-freebsd/types.conf
588
576
  - lib/ffi/platform/arm-freebsd12/types.conf
589
577
  - lib/ffi/platform/arm-linux/types.conf
@@ -611,6 +599,8 @@ files:
611
599
  - lib/ffi/platform/powerpc-linux/types.conf
612
600
  - lib/ffi/platform/powerpc-openbsd/types.conf
613
601
  - lib/ffi/platform/powerpc64-linux/types.conf
602
+ - lib/ffi/platform/powerpc64le-linux/types.conf
603
+ - lib/ffi/platform/riscv64-linux/types.conf
614
604
  - lib/ffi/platform/s390-linux/types.conf
615
605
  - lib/ffi/platform/s390x-linux/types.conf
616
606
  - lib/ffi/platform/sparc-linux/types.conf
@@ -623,7 +613,9 @@ files:
623
613
  - lib/ffi/platform/x86_64-dragonflybsd/types.conf
624
614
  - lib/ffi/platform/x86_64-freebsd/types.conf
625
615
  - lib/ffi/platform/x86_64-freebsd12/types.conf
616
+ - lib/ffi/platform/x86_64-haiku/types.conf
626
617
  - lib/ffi/platform/x86_64-linux/types.conf
618
+ - lib/ffi/platform/x86_64-msys/types.conf
627
619
  - lib/ffi/platform/x86_64-netbsd/types.conf
628
620
  - lib/ffi/platform/x86_64-openbsd/types.conf
629
621
  - lib/ffi/platform/x86_64-solaris/types.conf
@@ -642,6 +634,7 @@ files:
642
634
  - lib/ffi/union.rb
643
635
  - lib/ffi/variadic.rb
644
636
  - lib/ffi/version.rb
637
+ - rakelib/ffi_gem_helper.rb
645
638
  - samples/getlogin.rb
646
639
  - samples/getpid.rb
647
640
  - samples/gettimeofday.rb
@@ -659,7 +652,7 @@ metadata:
659
652
  wiki_uri: https://github.com/ffi/ffi/wiki
660
653
  source_code_uri: https://github.com/ffi/ffi/
661
654
  mailing_list_uri: http://groups.google.com/group/ruby-ffi
662
- post_install_message:
655
+ post_install_message:
663
656
  rdoc_options:
664
657
  - "--exclude=ext/ffi_c/.*\\.o$"
665
658
  - "--exclude=ffi_c\\.(bundle|so)$"
@@ -676,8 +669,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
676
669
  - !ruby/object:Gem::Version
677
670
  version: '0'
678
671
  requirements: []
679
- rubygems_version: 3.1.2
680
- signing_key:
672
+ rubygems_version: 3.3.4
673
+ signing_key:
681
674
  specification_version: 4
682
675
  summary: Ruby FFI
683
676
  test_files: []
data/.appveyor.yml DELETED
@@ -1,30 +0,0 @@
1
- install:
2
- - SET PATH=C:\Ruby%RUBYVER%\bin;%PATH%
3
- - SET RAKEOPT=-rdevkit
4
- - ps: |
5
- if ($env:RUBYVER -like "*head*") {
6
- $(new-object net.webclient).DownloadFile("https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-head/rubyinstaller-$env:RUBYVER.exe", "$pwd/ruby-setup.exe")
7
- cmd /c ruby-setup.exe /verysilent /dir=C:/Ruby$env:RUBYVER
8
- }
9
- - ridk version
10
- - gem --version
11
- - gem install bundler --quiet --no-document
12
- - bundle install
13
- # Update to libffi-3.3 since Appveyor version fails on LongDouble specs
14
- - ridk exec pacman --sync --refresh --needed --noconfirm mingw-w64-x86_64-libffi mingw-w64-i686-libffi
15
- build: off
16
- build_script:
17
- - bundle exec rake libffi compile -- %EXTCONFOPTS% || bundle exec rake compile -- %EXTCONFOPTS%
18
- test_script:
19
- - bundle exec rake test
20
- - bundle exec rake types_conf && git --no-pager diff
21
- environment:
22
- matrix:
23
- - RUBYVER: "head-x64"
24
- EXTCONFOPTS: "--disable-system-libffi"
25
- - RUBYVER: 24
26
- EXTCONFOPTS: "--disable-system-libffi"
27
- - RUBYVER: 25-x64
28
- EXTCONFOPTS: "--enable-system-libffi"
29
- - RUBYVER: 26
30
- EXTCONFOPTS: "--enable-system-libffi"
@@ -1,64 +0,0 @@
1
- name: CI
2
- on: [push, pull_request]
3
- jobs:
4
- system-libffi:
5
- # Run on latest MRI with explicit selection of system or builtin libffi
6
- strategy:
7
- fail-fast: false
8
- matrix:
9
- os: [ ubuntu, macos, windows ]
10
- extconfopts: [ --disable-system-libffi, --enable-system-libffi ]
11
- runs-on: ${{ matrix.os }}-latest
12
- steps:
13
- - uses: actions/checkout@v2
14
- - uses: ruby/setup-ruby@v1
15
- with:
16
- ruby-version: 2.7
17
-
18
- - run: brew install automake libffi pkg-config
19
- if: matrix.os == 'macos'
20
- - run: ridk exec pacman --sync --refresh --needed --noconfirm mingw-w64-x86_64-libffi
21
- if: matrix.os == 'windows' && matrix.extconfopts == '--enable-system-libffi'
22
-
23
- - run: bundle install
24
- - run: bundle exec rake libffi
25
- - run: bundle exec rake compile -- ${{ matrix.extconfopts }}
26
- env:
27
- # work around misconfiguration of libffi on MacOS with homebrew
28
- PKG_CONFIG_PATH: ${{ env.PKG_CONFIG_PATH }}:/usr/local/opt/libffi/lib/pkgconfig
29
- - run: bundle exec rake test
30
- - run: bundle exec rake types_conf && git --no-pager diff
31
-
32
- specs:
33
- # Run all specs on all ruby implementations
34
- # Use automatic libffi selection on MRI
35
- strategy:
36
- fail-fast: false
37
- matrix:
38
- os: [ ubuntu, macos, windows ]
39
- ruby: [ 2.3, 2.4, 2.5, 2.6, 2.7, ruby-head, truffleruby-head ]
40
- exclude:
41
- - os: windows
42
- ruby: truffleruby-head
43
- - os: windows
44
- ruby: 2.3 # compilation fails
45
- runs-on: ${{ matrix.os }}-latest
46
- steps:
47
- - uses: actions/checkout@v2
48
- - uses: ruby/setup-ruby@v1
49
- with:
50
- ruby-version: ${{ matrix.ruby }}
51
-
52
- - run: brew install automake
53
- if: matrix.os == 'macos'
54
-
55
- - run: bundle install
56
- - run: bundle exec rake libffi
57
- - run: bundle exec rake compile
58
-
59
- - run: bundle exec rake test
60
-
61
- - run: bundle exec rake bench:all
62
- if: matrix.ruby != 'truffleruby-head'
63
- env:
64
- ITER: 10
data/.gitignore DELETED
@@ -1,25 +0,0 @@
1
- doc/
2
- bin/
3
- .yardoc
4
- *.orig
5
- nbproject/private
6
- pkg
7
- *.orig
8
- *.rej
9
- *.patch
10
- *.diff
11
- build
12
- *.so
13
- *.[oa]
14
- core
15
- lib/ffi/types.conf
16
- lib/ffi_c.bundle
17
- lib/ffi_c.so
18
- vendor
19
- .bundle
20
- Gemfile.lock
21
- types_log
22
- *.gem
23
- embed-test.log
24
- spec/ffi/embed-test/ext/Makefile
25
- spec/ffi/embed-test/ext/embed_test.bundle
data/.gitmodules DELETED
@@ -1,4 +0,0 @@
1
- [submodule "ext/ffi_c/libffi"]
2
- path = ext/ffi_c/libffi
3
- url = https://github.com/libffi/libffi.git
4
- branch = master
data/.travis.yml DELETED
@@ -1,58 +0,0 @@
1
- dist: trusty
2
- group: beta
3
- language: ruby
4
- git:
5
- submodules: false
6
-
7
- script:
8
- - bundle exec rake libffi
9
- - bundle exec rake compile
10
- - bundle exec rake test
11
- - |
12
- if [[ $(ruby -v) != *truffleruby* ]]; then
13
- ITER=10 bundle exec rake bench:all
14
- fi
15
- - bundle exec rake types_conf && git --no-pager diff
16
- os:
17
- - linux
18
- - osx
19
- rvm:
20
- - 2.3.8
21
- - 2.4.6
22
- - 2.5.5
23
- - 2.6.5
24
- - 2.7.0
25
- - ruby-head
26
- - truffleruby-head
27
-
28
- env:
29
- - CC=gcc
30
- - CC=clang
31
- matrix:
32
- allow_failures:
33
- - os: osx
34
- rvm: ruby-head
35
- - os: osx
36
- rvm: 2.3.8
37
- - os: linux
38
- rvm: ruby-head
39
- include:
40
- - name: powerpc
41
- language: generic
42
- before_install: |
43
- docker run --rm --privileged multiarch/qemu-user-static:register --reset &&
44
- docker build --rm -t ffi-powerpc -f spec/env/Dockerfile.powerpc .
45
- script: |
46
- docker run --rm -t -v `pwd`:/ffi ffi-powerpc
47
- - name: armhf
48
- language: generic
49
- before_install: |
50
- docker run --rm --privileged multiarch/qemu-user-static:register --reset &&
51
- docker build --rm -t ffi-armhf -f spec/env/Dockerfile.armhf .
52
- script: |
53
- docker run --rm -t -v `pwd`:/ffi ffi-armhf
54
- exclude:
55
- - os: osx
56
- rvm: truffleruby-head
57
- after_failure:
58
- - "find build -name mkmf.log | xargs cat"
data/.yardopts DELETED
@@ -1,5 +0,0 @@
1
- --title "Ruby FFI"
2
- --charset UTF-8
3
- --private
4
- lib/**/*.rb
5
- ext/**/*.c
@@ -1,8 +0,0 @@
1
- #ifndef FFI_STDBOOL_H
2
- #define FFI_STDBOOL_H
3
-
4
- typedef int bool;
5
- #define true 1
6
- #define false 0
7
-
8
- #endif /* FFI_STDBOOL_H */