ffi 1.13.1-x86-mingw32 → 1.14.0-x86-mingw32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +25 -0
- data/README.md +10 -2
- data/ffi.gemspec +1 -1
- 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/ffi.rb +2 -2
- data/lib/ffi/abstract_memory.rb +44 -0
- data/lib/ffi/ffi.rb +1 -0
- data/lib/ffi/library.rb +1 -1
- data/lib/ffi/platform.rb +15 -6
- data/lib/ffi/platform/aarch64-darwin/types.conf +130 -0
- data/lib/ffi/platform/aarch64-openbsd/types.conf +134 -0
- data/lib/ffi/platform/x86_64-haiku/types.conf +117 -0
- data/lib/ffi/platform/x86_64-msys/types.conf +119 -0
- data/lib/ffi/pointer.rb +21 -7
- data/lib/ffi/version.rb +1 -1
- metadata +7 -8
- data/.appveyor.yml +0 -30
- data/.github/workflows/ci.yml +0 -64
- data/.gitignore +0 -25
- data/.gitmodules +0 -4
- data/.travis.yml +0 -58
- data/.yardopts +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e8184354517195803468a9eba80024040685e79b3c4417d0b0c103d2c469e04
|
4
|
+
data.tar.gz: 1a460d06e141c46aa5392f85fd5318d17295d04ab63907c96965f00d517c3860
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b7cb006d5f69f2f3aa394cb30493e74b50e6572438826b68778d9e4239c0b32bc7371bddac9741541e535133a141d8a35db00a910fb54d12d470477893ca4d4
|
7
|
+
data.tar.gz: f7585720ce34fb301e2410033d6c282fb1a0176a93858a35476a45912ca90b9ee2972554ab3d464300ed7dfc6d20c85cd9b0d0f3b42c5d85eec3a6f8e25db61d
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,28 @@
|
|
1
|
+
1.14.0 / 2020-12-18
|
2
|
+
-------------------
|
3
|
+
|
4
|
+
Added:
|
5
|
+
* Add types.conf for x86_64-msys, x86_64-haiku, aarch64-openbsd and aarch64-darwin (alias arm64-darwin)
|
6
|
+
* Add method AbstractMemory#size_limit? . #829
|
7
|
+
* Add new extconf option --enable-libffi-alloc which is enabled per default on Apple M1 (arm64-darwin).
|
8
|
+
|
9
|
+
Changed:
|
10
|
+
* Do NULL pointer check only when array length > 0 . #305
|
11
|
+
* Raise an error on an unknown order argument. #830
|
12
|
+
* Change FFI::Pointer#write_string to terminate with a NUL byte like other string methods. #805
|
13
|
+
* Update bundled libffi to latest master.
|
14
|
+
|
15
|
+
Removed:
|
16
|
+
* Remove win32/stdint.h and stdbool.h because of copyright issue. #693
|
17
|
+
|
18
|
+
Fixed:
|
19
|
+
* Fix possible UTF-8 load error in loader script interpretation. #792
|
20
|
+
* Fix segfault on non-array argument to #write_array_of_*
|
21
|
+
* Fix memory leak in MethodHandle . #815
|
22
|
+
* Fix possible segfault in combination with fiddle or other libffi using gems . #835
|
23
|
+
* Fix possibility to use ffi ruby gem with JRuby-9.3 . #763
|
24
|
+
|
25
|
+
|
1
26
|
1.13.1 / 2020-06-09
|
2
27
|
-------------------
|
3
28
|
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Ruby-FFI https://github.com/ffi/ffi/wiki [](https://travis-ci.com/ffi/ffi) [](https://ci.appveyor.com/project/larskanis/ffi-aofqa/branch/master)
|
2
2
|
|
3
3
|
## Description
|
4
4
|
|
@@ -66,10 +66,18 @@ From rubygems:
|
|
66
66
|
or from the git repository on github:
|
67
67
|
|
68
68
|
git clone git://github.com/ffi/ffi.git
|
69
|
-
git submodule update --init --recursive
|
70
69
|
cd ffi
|
70
|
+
git submodule update --init --recursive
|
71
|
+
bundle install
|
71
72
|
rake install
|
72
73
|
|
74
|
+
### Install options:
|
75
|
+
|
76
|
+
* `--enable-system-libffi` : Force usage of system libffi
|
77
|
+
* `--disable-system-libffi` : Force usage of builtin libffi
|
78
|
+
* `--enable-libffi-alloc` : Force closure allocation by libffi
|
79
|
+
* `--disable-libffi-alloc` : Force closure allocation by builtin method
|
80
|
+
|
73
81
|
## License
|
74
82
|
|
75
83
|
The ffi library is covered by the BSD license, also see the LICENSE file.
|
data/ffi.gemspec
CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.metadata['mailing_list_uri'] = 'http://groups.google.com/group/ruby-ffi'
|
18
18
|
end
|
19
19
|
s.files = `git ls-files -z`.split("\x0").reject do |f|
|
20
|
-
f =~ /^(bench|gen|libtest|nbproject|spec)/
|
20
|
+
f =~ /^(\.|bench|gen|libtest|nbproject|spec)/
|
21
21
|
end
|
22
22
|
|
23
23
|
# Add libffi git files
|
data/lib/2.3/ffi_c.so
ADDED
Binary file
|
data/lib/2.4/ffi_c.so
ADDED
Binary file
|
data/lib/2.5/ffi_c.so
ADDED
Binary file
|
data/lib/2.6/ffi_c.so
ADDED
Binary file
|
data/lib/2.7/ffi_c.so
ADDED
Binary file
|
data/lib/ffi.rb
CHANGED
@@ -8,11 +8,11 @@ if RUBY_ENGINE == 'ruby' || RUBY_ENGINE == 'rbx'
|
|
8
8
|
|
9
9
|
require 'ffi/ffi'
|
10
10
|
|
11
|
-
elsif RUBY_ENGINE == 'jruby' &&
|
11
|
+
elsif RUBY_ENGINE == 'jruby' && (RUBY_ENGINE_VERSION.split('.').map(&:to_i) <=> [9, 3]) >= 0
|
12
12
|
JRuby::Util.load_ext("org.jruby.ext.ffi.FFIService")
|
13
13
|
require 'ffi/ffi'
|
14
14
|
|
15
|
-
elsif RUBY_ENGINE == 'truffleruby' &&
|
15
|
+
elsif RUBY_ENGINE == 'truffleruby' && (RUBY_ENGINE_VERSION.split('.').map(&:to_i) <=> [20, 1, 0]) >= 0
|
16
16
|
require 'truffleruby/ffi_backend'
|
17
17
|
require 'ffi/ffi'
|
18
18
|
|
@@ -0,0 +1,44 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (C) 2020 Lars Kanis
|
3
|
+
#
|
4
|
+
# This file is part of ruby-ffi.
|
5
|
+
#
|
6
|
+
# All rights reserved.
|
7
|
+
#
|
8
|
+
# Redistribution and use in source and binary forms, with or without
|
9
|
+
# modification, are permitted provided that the following conditions are met:
|
10
|
+
#
|
11
|
+
# * Redistributions of source code must retain the above copyright notice, this
|
12
|
+
# list of conditions and the following disclaimer.
|
13
|
+
# * Redistributions in binary form must reproduce the above copyright notice
|
14
|
+
# this list of conditions and the following disclaimer in the documentation
|
15
|
+
# and/or other materials provided with the distribution.
|
16
|
+
# * Neither the name of the Ruby FFI project nor the names of its contributors
|
17
|
+
# may be used to endorse or promote products derived from this software
|
18
|
+
# without specific prior written permission.
|
19
|
+
#
|
20
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
21
|
+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
22
|
+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
23
|
+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
24
|
+
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
25
|
+
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
26
|
+
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
27
|
+
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
28
|
+
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
29
|
+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
|
30
|
+
|
31
|
+
|
32
|
+
module FFI
|
33
|
+
class AbstractMemory
|
34
|
+
LONG_MAX = FFI::Pointer.new(1).size
|
35
|
+
private_constant :LONG_MAX
|
36
|
+
|
37
|
+
# Return +true+ if +self+ has a size limit.
|
38
|
+
#
|
39
|
+
# @return [Boolean]
|
40
|
+
def size_limit?
|
41
|
+
size != LONG_MAX
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
data/lib/ffi/ffi.rb
CHANGED
data/lib/ffi/library.rb
CHANGED
@@ -115,7 +115,7 @@ module FFI
|
|
115
115
|
rescue Exception => ex
|
116
116
|
ldscript = false
|
117
117
|
if ex.message =~ /(([^ \t()])+\.so([^ \t:()])*):([ \t])*(invalid ELF header|file too short|invalid file format)/
|
118
|
-
if File.
|
118
|
+
if File.binread($1) =~ /(?:GROUP|INPUT) *\( *([^ \)]+)/
|
119
119
|
libname = $1
|
120
120
|
ldscript = true
|
121
121
|
end
|
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
|
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
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
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
|
-
|
80
|
+
"arm"
|
80
81
|
end
|
82
|
+
else
|
83
|
+
RbConfig::CONFIG['host_cpu']
|
81
84
|
end
|
82
85
|
|
83
86
|
private
|
@@ -145,6 +148,12 @@ module FFI
|
|
145
148
|
"#{LIBPREFIX}c.#{LIBSUFFIX}"
|
146
149
|
end
|
147
150
|
|
151
|
+
LITTLE_ENDIAN = 1234 unless defined?(LITTLE_ENDIAN)
|
152
|
+
BIG_ENDIAN = 4321 unless defined?(BIG_ENDIAN)
|
153
|
+
unless defined?(BYTE_ORDER)
|
154
|
+
BYTE_ORDER = [0x12345678].pack("I") == [0x12345678].pack("N") ? BIG_ENDIAN : LITTLE_ENDIAN
|
155
|
+
end
|
156
|
+
|
148
157
|
# Test if current OS is a *BSD (include MAC)
|
149
158
|
# @return [Boolean]
|
150
159
|
def self.bsd?
|
@@ -0,0 +1,130 @@
|
|
1
|
+
rbx.platform.typedef.__darwin_blkcnt_t = long_long
|
2
|
+
rbx.platform.typedef.__darwin_blksize_t = int
|
3
|
+
rbx.platform.typedef.__darwin_clock_t = ulong
|
4
|
+
rbx.platform.typedef.__darwin_ct_rune_t = int
|
5
|
+
rbx.platform.typedef.__darwin_dev_t = int
|
6
|
+
rbx.platform.typedef.__darwin_fsblkcnt_t = uint
|
7
|
+
rbx.platform.typedef.__darwin_fsfilcnt_t = uint
|
8
|
+
rbx.platform.typedef.__darwin_gid_t = uint
|
9
|
+
rbx.platform.typedef.__darwin_id_t = uint
|
10
|
+
rbx.platform.typedef.__darwin_ino64_t = ulong_long
|
11
|
+
rbx.platform.typedef.__darwin_ino_t = ulong_long
|
12
|
+
rbx.platform.typedef.__darwin_intptr_t = long
|
13
|
+
rbx.platform.typedef.__darwin_mach_port_name_t = uint
|
14
|
+
rbx.platform.typedef.__darwin_mach_port_t = uint
|
15
|
+
rbx.platform.typedef.__darwin_mode_t = ushort
|
16
|
+
rbx.platform.typedef.__darwin_natural_t = uint
|
17
|
+
rbx.platform.typedef.__darwin_off_t = long_long
|
18
|
+
rbx.platform.typedef.__darwin_pid_t = int
|
19
|
+
rbx.platform.typedef.__darwin_pthread_key_t = ulong
|
20
|
+
rbx.platform.typedef.__darwin_ptrdiff_t = long
|
21
|
+
rbx.platform.typedef.__darwin_rune_t = int
|
22
|
+
rbx.platform.typedef.__darwin_sigset_t = uint
|
23
|
+
rbx.platform.typedef.__darwin_size_t = ulong
|
24
|
+
rbx.platform.typedef.__darwin_socklen_t = uint
|
25
|
+
rbx.platform.typedef.__darwin_ssize_t = long
|
26
|
+
rbx.platform.typedef.__darwin_suseconds_t = int
|
27
|
+
rbx.platform.typedef.__darwin_time_t = long
|
28
|
+
rbx.platform.typedef.__darwin_uid_t = uint
|
29
|
+
rbx.platform.typedef.__darwin_useconds_t = uint
|
30
|
+
rbx.platform.typedef.__darwin_uuid_string_t[37] = char
|
31
|
+
rbx.platform.typedef.__darwin_uuid_t[16] = uchar
|
32
|
+
rbx.platform.typedef.__darwin_wchar_t = int
|
33
|
+
rbx.platform.typedef.__darwin_wint_t = int
|
34
|
+
rbx.platform.typedef.__int16_t = short
|
35
|
+
rbx.platform.typedef.__int32_t = int
|
36
|
+
rbx.platform.typedef.__int64_t = long_long
|
37
|
+
rbx.platform.typedef.__int8_t = char
|
38
|
+
rbx.platform.typedef.__uint16_t = ushort
|
39
|
+
rbx.platform.typedef.__uint32_t = uint
|
40
|
+
rbx.platform.typedef.__uint64_t = ulong_long
|
41
|
+
rbx.platform.typedef.__uint8_t = uchar
|
42
|
+
rbx.platform.typedef.blkcnt_t = long_long
|
43
|
+
rbx.platform.typedef.blksize_t = int
|
44
|
+
rbx.platform.typedef.caddr_t = string
|
45
|
+
rbx.platform.typedef.clock_t = ulong
|
46
|
+
rbx.platform.typedef.daddr_t = int
|
47
|
+
rbx.platform.typedef.dev_t = int
|
48
|
+
rbx.platform.typedef.errno_t = int
|
49
|
+
rbx.platform.typedef.fd_mask = int
|
50
|
+
rbx.platform.typedef.fixpt_t = uint
|
51
|
+
rbx.platform.typedef.fsblkcnt_t = uint
|
52
|
+
rbx.platform.typedef.fsfilcnt_t = uint
|
53
|
+
rbx.platform.typedef.gid_t = uint
|
54
|
+
rbx.platform.typedef.id_t = uint
|
55
|
+
rbx.platform.typedef.in_addr_t = uint
|
56
|
+
rbx.platform.typedef.in_port_t = ushort
|
57
|
+
rbx.platform.typedef.ino64_t = ulong_long
|
58
|
+
rbx.platform.typedef.ino_t = ulong_long
|
59
|
+
rbx.platform.typedef.int16_t = short
|
60
|
+
rbx.platform.typedef.int32_t = int
|
61
|
+
rbx.platform.typedef.int64_t = long_long
|
62
|
+
rbx.platform.typedef.int8_t = char
|
63
|
+
rbx.platform.typedef.int_fast16_t = short
|
64
|
+
rbx.platform.typedef.int_fast32_t = int
|
65
|
+
rbx.platform.typedef.int_fast64_t = long_long
|
66
|
+
rbx.platform.typedef.int_fast8_t = char
|
67
|
+
rbx.platform.typedef.int_least16_t = short
|
68
|
+
rbx.platform.typedef.int_least32_t = int
|
69
|
+
rbx.platform.typedef.int_least64_t = long_long
|
70
|
+
rbx.platform.typedef.int_least8_t = char
|
71
|
+
rbx.platform.typedef.intmax_t = long
|
72
|
+
rbx.platform.typedef.intptr_t = long
|
73
|
+
rbx.platform.typedef.key_t = int
|
74
|
+
rbx.platform.typedef.mode_t = ushort
|
75
|
+
rbx.platform.typedef.nlink_t = ushort
|
76
|
+
rbx.platform.typedef.off_t = long_long
|
77
|
+
rbx.platform.typedef.pid_t = int
|
78
|
+
rbx.platform.typedef.pthread_key_t = ulong
|
79
|
+
rbx.platform.typedef.ptrdiff_t = long
|
80
|
+
rbx.platform.typedef.qaddr_t = pointer
|
81
|
+
rbx.platform.typedef.quad_t = long_long
|
82
|
+
rbx.platform.typedef.register_t = long_long
|
83
|
+
rbx.platform.typedef.rlim_t = ulong_long
|
84
|
+
rbx.platform.typedef.rsize_t = ulong
|
85
|
+
rbx.platform.typedef.sa_family_t = uchar
|
86
|
+
rbx.platform.typedef.sae_associd_t = uint
|
87
|
+
rbx.platform.typedef.sae_connid_t = uint
|
88
|
+
rbx.platform.typedef.segsz_t = int
|
89
|
+
rbx.platform.typedef.size_t = ulong
|
90
|
+
rbx.platform.typedef.socklen_t = uint
|
91
|
+
rbx.platform.typedef.ssize_t = long
|
92
|
+
rbx.platform.typedef.suseconds_t = int
|
93
|
+
rbx.platform.typedef.swblk_t = int
|
94
|
+
rbx.platform.typedef.syscall_arg_t = ulong_long
|
95
|
+
rbx.platform.typedef.time_t = long
|
96
|
+
rbx.platform.typedef.u_char = uchar
|
97
|
+
rbx.platform.typedef.u_int = uint
|
98
|
+
rbx.platform.typedef.u_int16_t = ushort
|
99
|
+
rbx.platform.typedef.u_int32_t = uint
|
100
|
+
rbx.platform.typedef.u_int64_t = ulong_long
|
101
|
+
rbx.platform.typedef.u_int8_t = uchar
|
102
|
+
rbx.platform.typedef.u_long = ulong
|
103
|
+
rbx.platform.typedef.u_quad_t = ulong_long
|
104
|
+
rbx.platform.typedef.u_short = ushort
|
105
|
+
rbx.platform.typedef.uid_t = uint
|
106
|
+
rbx.platform.typedef.uint = uint
|
107
|
+
rbx.platform.typedef.uint16_t = ushort
|
108
|
+
rbx.platform.typedef.uint32_t = uint
|
109
|
+
rbx.platform.typedef.uint64_t = ulong_long
|
110
|
+
rbx.platform.typedef.uint8_t = uchar
|
111
|
+
rbx.platform.typedef.uint_fast16_t = ushort
|
112
|
+
rbx.platform.typedef.uint_fast32_t = uint
|
113
|
+
rbx.platform.typedef.uint_fast64_t = ulong_long
|
114
|
+
rbx.platform.typedef.uint_fast8_t = uchar
|
115
|
+
rbx.platform.typedef.uint_least16_t = ushort
|
116
|
+
rbx.platform.typedef.uint_least32_t = uint
|
117
|
+
rbx.platform.typedef.uint_least64_t = ulong_long
|
118
|
+
rbx.platform.typedef.uint_least8_t = uchar
|
119
|
+
rbx.platform.typedef.uintmax_t = ulong
|
120
|
+
rbx.platform.typedef.uintptr_t = ulong
|
121
|
+
rbx.platform.typedef.useconds_t = uint
|
122
|
+
rbx.platform.typedef.user_addr_t = ulong_long
|
123
|
+
rbx.platform.typedef.user_long_t = long_long
|
124
|
+
rbx.platform.typedef.user_off_t = long_long
|
125
|
+
rbx.platform.typedef.user_size_t = ulong_long
|
126
|
+
rbx.platform.typedef.user_ssize_t = long_long
|
127
|
+
rbx.platform.typedef.user_time_t = long_long
|
128
|
+
rbx.platform.typedef.user_ulong_t = ulong_long
|
129
|
+
rbx.platform.typedef.ushort = ushort
|
130
|
+
rbx.platform.typedef.wchar_t = int
|
@@ -0,0 +1,134 @@
|
|
1
|
+
rbx.platform.typedef.__blkcnt_t = long_long
|
2
|
+
rbx.platform.typedef.__blksize_t = int
|
3
|
+
rbx.platform.typedef.__clock_t = long_long
|
4
|
+
rbx.platform.typedef.__clockid_t = int
|
5
|
+
rbx.platform.typedef.__cpuid_t = ulong
|
6
|
+
rbx.platform.typedef.__dev_t = int
|
7
|
+
rbx.platform.typedef.__fd_mask = uint
|
8
|
+
rbx.platform.typedef.__fixpt_t = uint
|
9
|
+
rbx.platform.typedef.__fsblkcnt_t = ulong_long
|
10
|
+
rbx.platform.typedef.__fsfilcnt_t = ulong_long
|
11
|
+
rbx.platform.typedef.__gid_t = uint
|
12
|
+
rbx.platform.typedef.__id_t = uint
|
13
|
+
rbx.platform.typedef.__in_addr_t = uint
|
14
|
+
rbx.platform.typedef.__in_port_t = ushort
|
15
|
+
rbx.platform.typedef.__ino_t = ulong_long
|
16
|
+
rbx.platform.typedef.__int16_t = short
|
17
|
+
rbx.platform.typedef.__int32_t = int
|
18
|
+
rbx.platform.typedef.__int64_t = long_long
|
19
|
+
rbx.platform.typedef.__int8_t = char
|
20
|
+
rbx.platform.typedef.__int_fast16_t = int
|
21
|
+
rbx.platform.typedef.__int_fast32_t = int
|
22
|
+
rbx.platform.typedef.__int_fast64_t = long_long
|
23
|
+
rbx.platform.typedef.__int_fast8_t = int
|
24
|
+
rbx.platform.typedef.__int_least16_t = short
|
25
|
+
rbx.platform.typedef.__int_least32_t = int
|
26
|
+
rbx.platform.typedef.__int_least64_t = long_long
|
27
|
+
rbx.platform.typedef.__int_least8_t = char
|
28
|
+
rbx.platform.typedef.__intmax_t = long_long
|
29
|
+
rbx.platform.typedef.__intptr_t = long
|
30
|
+
rbx.platform.typedef.__key_t = long
|
31
|
+
rbx.platform.typedef.__mode_t = uint
|
32
|
+
rbx.platform.typedef.__nlink_t = uint
|
33
|
+
rbx.platform.typedef.__off_t = long_long
|
34
|
+
rbx.platform.typedef.__paddr_t = ulong
|
35
|
+
rbx.platform.typedef.__pid_t = int
|
36
|
+
rbx.platform.typedef.__psize_t = ulong
|
37
|
+
rbx.platform.typedef.__ptrdiff_t = long
|
38
|
+
rbx.platform.typedef.__register_t = long
|
39
|
+
rbx.platform.typedef.__rlim_t = ulong_long
|
40
|
+
rbx.platform.typedef.__rune_t = int
|
41
|
+
rbx.platform.typedef.__sa_family_t = uchar
|
42
|
+
rbx.platform.typedef.__segsz_t = int
|
43
|
+
rbx.platform.typedef.__size_t = ulong
|
44
|
+
rbx.platform.typedef.__socklen_t = uint
|
45
|
+
rbx.platform.typedef.__ssize_t = long
|
46
|
+
rbx.platform.typedef.__suseconds_t = long
|
47
|
+
rbx.platform.typedef.__swblk_t = int
|
48
|
+
rbx.platform.typedef.__time_t = long_long
|
49
|
+
rbx.platform.typedef.__timer_t = int
|
50
|
+
rbx.platform.typedef.__uid_t = uint
|
51
|
+
rbx.platform.typedef.__uint16_t = ushort
|
52
|
+
rbx.platform.typedef.__uint32_t = uint
|
53
|
+
rbx.platform.typedef.__uint64_t = ulong_long
|
54
|
+
rbx.platform.typedef.__uint8_t = uchar
|
55
|
+
rbx.platform.typedef.__uint_fast16_t = uint
|
56
|
+
rbx.platform.typedef.__uint_fast32_t = uint
|
57
|
+
rbx.platform.typedef.__uint_fast64_t = ulong_long
|
58
|
+
rbx.platform.typedef.__uint_fast8_t = uint
|
59
|
+
rbx.platform.typedef.__uint_least16_t = ushort
|
60
|
+
rbx.platform.typedef.__uint_least32_t = uint
|
61
|
+
rbx.platform.typedef.__uint_least64_t = ulong_long
|
62
|
+
rbx.platform.typedef.__uint_least8_t = uchar
|
63
|
+
rbx.platform.typedef.__uintmax_t = ulong_long
|
64
|
+
rbx.platform.typedef.__uintptr_t = ulong
|
65
|
+
rbx.platform.typedef.__useconds_t = uint
|
66
|
+
rbx.platform.typedef.__vaddr_t = ulong
|
67
|
+
rbx.platform.typedef.__vsize_t = ulong
|
68
|
+
rbx.platform.typedef.__wchar_t = int
|
69
|
+
rbx.platform.typedef.__wctrans_t = pointer
|
70
|
+
rbx.platform.typedef.__wctype_t = pointer
|
71
|
+
rbx.platform.typedef.__wint_t = int
|
72
|
+
rbx.platform.typedef.blkcnt_t = long_long
|
73
|
+
rbx.platform.typedef.blksize_t = int
|
74
|
+
rbx.platform.typedef.caddr_t = string
|
75
|
+
rbx.platform.typedef.clock_t = long_long
|
76
|
+
rbx.platform.typedef.clockid_t = int
|
77
|
+
rbx.platform.typedef.cpuid_t = ulong
|
78
|
+
rbx.platform.typedef.daddr32_t = int
|
79
|
+
rbx.platform.typedef.daddr_t = long_long
|
80
|
+
rbx.platform.typedef.dev_t = int
|
81
|
+
rbx.platform.typedef.fixpt_t = uint
|
82
|
+
rbx.platform.typedef.fsblkcnt_t = ulong_long
|
83
|
+
rbx.platform.typedef.fsfilcnt_t = ulong_long
|
84
|
+
rbx.platform.typedef.gid_t = uint
|
85
|
+
rbx.platform.typedef.id_t = uint
|
86
|
+
rbx.platform.typedef.in_addr_t = uint
|
87
|
+
rbx.platform.typedef.in_port_t = ushort
|
88
|
+
rbx.platform.typedef.ino_t = ulong_long
|
89
|
+
rbx.platform.typedef.int16_t = short
|
90
|
+
rbx.platform.typedef.int32_t = int
|
91
|
+
rbx.platform.typedef.int64_t = long_long
|
92
|
+
rbx.platform.typedef.int8_t = char
|
93
|
+
rbx.platform.typedef.key_t = long
|
94
|
+
rbx.platform.typedef.mode_t = uint
|
95
|
+
rbx.platform.typedef.nlink_t = uint
|
96
|
+
rbx.platform.typedef.off_t = long_long
|
97
|
+
rbx.platform.typedef.paddr_t = ulong
|
98
|
+
rbx.platform.typedef.pid_t = int
|
99
|
+
rbx.platform.typedef.psize_t = ulong
|
100
|
+
rbx.platform.typedef.qaddr_t = pointer
|
101
|
+
rbx.platform.typedef.quad_t = long_long
|
102
|
+
rbx.platform.typedef.register_t = long
|
103
|
+
rbx.platform.typedef.rlim_t = ulong_long
|
104
|
+
rbx.platform.typedef.sa_family_t = uchar
|
105
|
+
rbx.platform.typedef.segsz_t = int
|
106
|
+
rbx.platform.typedef.sigset_t = uint
|
107
|
+
rbx.platform.typedef.size_t = ulong
|
108
|
+
rbx.platform.typedef.socklen_t = uint
|
109
|
+
rbx.platform.typedef.ssize_t = long
|
110
|
+
rbx.platform.typedef.suseconds_t = long
|
111
|
+
rbx.platform.typedef.swblk_t = int
|
112
|
+
rbx.platform.typedef.time_t = long_long
|
113
|
+
rbx.platform.typedef.timer_t = int
|
114
|
+
rbx.platform.typedef.u_char = uchar
|
115
|
+
rbx.platform.typedef.u_int = uint
|
116
|
+
rbx.platform.typedef.u_int16_t = ushort
|
117
|
+
rbx.platform.typedef.u_int32_t = uint
|
118
|
+
rbx.platform.typedef.u_int64_t = ulong_long
|
119
|
+
rbx.platform.typedef.u_int8_t = uchar
|
120
|
+
rbx.platform.typedef.u_long = ulong
|
121
|
+
rbx.platform.typedef.u_quad_t = ulong_long
|
122
|
+
rbx.platform.typedef.u_short = ushort
|
123
|
+
rbx.platform.typedef.uid_t = uint
|
124
|
+
rbx.platform.typedef.uint = uint
|
125
|
+
rbx.platform.typedef.uint16_t = ushort
|
126
|
+
rbx.platform.typedef.uint32_t = uint
|
127
|
+
rbx.platform.typedef.uint64_t = ulong_long
|
128
|
+
rbx.platform.typedef.uint8_t = uchar
|
129
|
+
rbx.platform.typedef.ulong = ulong
|
130
|
+
rbx.platform.typedef.unchar = uchar
|
131
|
+
rbx.platform.typedef.useconds_t = uint
|
132
|
+
rbx.platform.typedef.ushort = ushort
|
133
|
+
rbx.platform.typedef.vaddr_t = ulong
|
134
|
+
rbx.platform.typedef.vsize_t = ulong
|
@@ -0,0 +1,117 @@
|
|
1
|
+
rbx.platform.typedef.__haiku_addr_t = ulong
|
2
|
+
rbx.platform.typedef.__haiku_generic_addr_t = ulong
|
3
|
+
rbx.platform.typedef.__haiku_int16 = short
|
4
|
+
rbx.platform.typedef.__haiku_int32 = int
|
5
|
+
rbx.platform.typedef.__haiku_int64 = long
|
6
|
+
rbx.platform.typedef.__haiku_int8 = char
|
7
|
+
rbx.platform.typedef.__haiku_phys_addr_t = ulong
|
8
|
+
rbx.platform.typedef.__haiku_phys_saddr_t = long
|
9
|
+
rbx.platform.typedef.__haiku_saddr_t = long
|
10
|
+
rbx.platform.typedef.__haiku_std_int16 = short
|
11
|
+
rbx.platform.typedef.__haiku_std_int32 = int
|
12
|
+
rbx.platform.typedef.__haiku_std_int64 = long
|
13
|
+
rbx.platform.typedef.__haiku_std_int8 = char
|
14
|
+
rbx.platform.typedef.__haiku_std_uint16 = ushort
|
15
|
+
rbx.platform.typedef.__haiku_std_uint32 = uint
|
16
|
+
rbx.platform.typedef.__haiku_std_uint64 = ulong
|
17
|
+
rbx.platform.typedef.__haiku_std_uint8 = uchar
|
18
|
+
rbx.platform.typedef.__haiku_uint16 = ushort
|
19
|
+
rbx.platform.typedef.__haiku_uint32 = uint
|
20
|
+
rbx.platform.typedef.__haiku_uint64 = ulong
|
21
|
+
rbx.platform.typedef.__haiku_uint8 = uchar
|
22
|
+
rbx.platform.typedef.addr_t = ulong
|
23
|
+
rbx.platform.typedef.bigtime_t = long
|
24
|
+
rbx.platform.typedef.blkcnt_t = long
|
25
|
+
rbx.platform.typedef.blksize_t = int
|
26
|
+
rbx.platform.typedef.caddr_t = pointer
|
27
|
+
rbx.platform.typedef.clock_t = int
|
28
|
+
rbx.platform.typedef.clockid_t = int
|
29
|
+
rbx.platform.typedef.cnt_t = int
|
30
|
+
rbx.platform.typedef.daddr_t = long
|
31
|
+
rbx.platform.typedef.dev_t = int
|
32
|
+
rbx.platform.typedef.fd_mask = uint
|
33
|
+
rbx.platform.typedef.fsblkcnt_t = long
|
34
|
+
rbx.platform.typedef.fsfilcnt_t = long
|
35
|
+
rbx.platform.typedef.generic_addr_t = ulong
|
36
|
+
rbx.platform.typedef.generic_size_t = ulong
|
37
|
+
rbx.platform.typedef.gid_t = uint
|
38
|
+
rbx.platform.typedef.id_t = int
|
39
|
+
rbx.platform.typedef.in_addr_t = uint
|
40
|
+
rbx.platform.typedef.in_port_t = ushort
|
41
|
+
rbx.platform.typedef.ino_t = long
|
42
|
+
rbx.platform.typedef.int16 = short
|
43
|
+
rbx.platform.typedef.int16_t = short
|
44
|
+
rbx.platform.typedef.int32 = int
|
45
|
+
rbx.platform.typedef.int32_t = int
|
46
|
+
rbx.platform.typedef.int64 = long
|
47
|
+
rbx.platform.typedef.int64_t = long
|
48
|
+
rbx.platform.typedef.int8 = char
|
49
|
+
rbx.platform.typedef.int8_t = char
|
50
|
+
rbx.platform.typedef.int_fast16_t = int
|
51
|
+
rbx.platform.typedef.int_fast32_t = int
|
52
|
+
rbx.platform.typedef.int_fast64_t = long
|
53
|
+
rbx.platform.typedef.int_fast8_t = int
|
54
|
+
rbx.platform.typedef.int_least16_t = short
|
55
|
+
rbx.platform.typedef.int_least32_t = int
|
56
|
+
rbx.platform.typedef.int_least64_t = long
|
57
|
+
rbx.platform.typedef.int_least8_t = char
|
58
|
+
rbx.platform.typedef.intmax_t = long
|
59
|
+
rbx.platform.typedef.intptr_t = long
|
60
|
+
rbx.platform.typedef.key_t = int
|
61
|
+
rbx.platform.typedef.mode_t = uint
|
62
|
+
rbx.platform.typedef.nanotime_t = long
|
63
|
+
rbx.platform.typedef.nlink_t = int
|
64
|
+
rbx.platform.typedef.off_t = long
|
65
|
+
rbx.platform.typedef.perform_code = uint
|
66
|
+
rbx.platform.typedef.phys_addr_t = ulong
|
67
|
+
rbx.platform.typedef.phys_size_t = ulong
|
68
|
+
rbx.platform.typedef.pid_t = int
|
69
|
+
rbx.platform.typedef.pthread_key_t = int
|
70
|
+
rbx.platform.typedef.ptrdiff_t = long
|
71
|
+
rbx.platform.typedef.rlim_t = ulong
|
72
|
+
rbx.platform.typedef.sa_family_t = uchar
|
73
|
+
rbx.platform.typedef.sig_atomic_t = int
|
74
|
+
rbx.platform.typedef.sigset_t = ulong
|
75
|
+
rbx.platform.typedef.size_t = ulong
|
76
|
+
rbx.platform.typedef.socklen_t = uint
|
77
|
+
rbx.platform.typedef.status_t = int
|
78
|
+
rbx.platform.typedef.suseconds_t = int
|
79
|
+
rbx.platform.typedef.time_t = long
|
80
|
+
rbx.platform.typedef.type_code = uint
|
81
|
+
rbx.platform.typedef.u_char = uchar
|
82
|
+
rbx.platform.typedef.u_int = uint
|
83
|
+
rbx.platform.typedef.u_int16_t = ushort
|
84
|
+
rbx.platform.typedef.u_int32_t = uint
|
85
|
+
rbx.platform.typedef.u_int64_t = ulong
|
86
|
+
rbx.platform.typedef.u_int8_t = uchar
|
87
|
+
rbx.platform.typedef.u_long = ulong
|
88
|
+
rbx.platform.typedef.u_short = ushort
|
89
|
+
rbx.platform.typedef.uchar = uchar
|
90
|
+
rbx.platform.typedef.uid_t = uint
|
91
|
+
rbx.platform.typedef.uint = uint
|
92
|
+
rbx.platform.typedef.uint16 = ushort
|
93
|
+
rbx.platform.typedef.uint16_t = ushort
|
94
|
+
rbx.platform.typedef.uint32 = uint
|
95
|
+
rbx.platform.typedef.uint32_t = uint
|
96
|
+
rbx.platform.typedef.uint64 = ulong
|
97
|
+
rbx.platform.typedef.uint64_t = ulong
|
98
|
+
rbx.platform.typedef.uint8 = uchar
|
99
|
+
rbx.platform.typedef.uint8_t = uchar
|
100
|
+
rbx.platform.typedef.uint_fast16_t = uint
|
101
|
+
rbx.platform.typedef.uint_fast32_t = uint
|
102
|
+
rbx.platform.typedef.uint_fast64_t = ulong
|
103
|
+
rbx.platform.typedef.uint_fast8_t = uint
|
104
|
+
rbx.platform.typedef.uint_least16_t = ushort
|
105
|
+
rbx.platform.typedef.uint_least32_t = uint
|
106
|
+
rbx.platform.typedef.uint_least64_t = ulong
|
107
|
+
rbx.platform.typedef.uint_least8_t = uchar
|
108
|
+
rbx.platform.typedef.uintmax_t = ulong
|
109
|
+
rbx.platform.typedef.uintptr_t = ulong
|
110
|
+
rbx.platform.typedef.ulong = ulong
|
111
|
+
rbx.platform.typedef.umode_t = uint
|
112
|
+
rbx.platform.typedef.unchar = uchar
|
113
|
+
rbx.platform.typedef.unichar = ushort
|
114
|
+
rbx.platform.typedef.useconds_t = uint
|
115
|
+
rbx.platform.typedef.ushort = ushort
|
116
|
+
rbx.platform.typedef.void*) = pointer
|
117
|
+
rbx.platform.typedef.wchar_t = int
|
@@ -0,0 +1,119 @@
|
|
1
|
+
rbx.platform.typedef.*addr_t = char
|
2
|
+
rbx.platform.typedef.__ULong = uint
|
3
|
+
rbx.platform.typedef.__blkcnt_t = long
|
4
|
+
rbx.platform.typedef.__blksize_t = int
|
5
|
+
rbx.platform.typedef.__clock_t = ulong
|
6
|
+
rbx.platform.typedef.__clockid_t = ulong
|
7
|
+
rbx.platform.typedef.__cpu_mask = ulong
|
8
|
+
rbx.platform.typedef.__dev_t = uint
|
9
|
+
rbx.platform.typedef.__fsblkcnt_t = ulong
|
10
|
+
rbx.platform.typedef.__fsfilcnt_t = ulong
|
11
|
+
rbx.platform.typedef.__gid_t = uint
|
12
|
+
rbx.platform.typedef.__id_t = uint
|
13
|
+
rbx.platform.typedef.__ino_t = ulong
|
14
|
+
rbx.platform.typedef.__int32_t = int
|
15
|
+
rbx.platform.typedef.__int64_t = long
|
16
|
+
rbx.platform.typedef.__int8_t = char
|
17
|
+
rbx.platform.typedef.__int_least32_t = int
|
18
|
+
rbx.platform.typedef.__int_least64_t = long
|
19
|
+
rbx.platform.typedef.__int_least8_t = char
|
20
|
+
rbx.platform.typedef.__intmax_t = long
|
21
|
+
rbx.platform.typedef.__intptr_t = long
|
22
|
+
rbx.platform.typedef.__key_t = long_long
|
23
|
+
rbx.platform.typedef.__loff_t = long_long
|
24
|
+
rbx.platform.typedef.__mode_t = uint
|
25
|
+
rbx.platform.typedef.__nl_item = int
|
26
|
+
rbx.platform.typedef.__nlink_t = ushort
|
27
|
+
rbx.platform.typedef.__off_t = long
|
28
|
+
rbx.platform.typedef.__pid_t = int
|
29
|
+
rbx.platform.typedef.__sigset_t = ulong
|
30
|
+
rbx.platform.typedef.__size_t = ulong
|
31
|
+
rbx.platform.typedef.__socklen_t = int
|
32
|
+
rbx.platform.typedef.__suseconds_t = long
|
33
|
+
rbx.platform.typedef.__time_t = long
|
34
|
+
rbx.platform.typedef.__timer_t = ulong
|
35
|
+
rbx.platform.typedef.__uid_t = uint
|
36
|
+
rbx.platform.typedef.__uint32_t = uint
|
37
|
+
rbx.platform.typedef.__uint64_t = ulong
|
38
|
+
rbx.platform.typedef.__uint8_t = uchar
|
39
|
+
rbx.platform.typedef.__uint_least32_t = uint
|
40
|
+
rbx.platform.typedef.__uint_least64_t = ulong
|
41
|
+
rbx.platform.typedef.__uint_least8_t = uchar
|
42
|
+
rbx.platform.typedef.__uintmax_t = ulong
|
43
|
+
rbx.platform.typedef.__uintptr_t = ulong
|
44
|
+
rbx.platform.typedef.__useconds_t = ulong
|
45
|
+
rbx.platform.typedef._fpos64_t = long_long
|
46
|
+
rbx.platform.typedef._fpos_t = long
|
47
|
+
rbx.platform.typedef._off64_t = long_long
|
48
|
+
rbx.platform.typedef._off_t = long
|
49
|
+
rbx.platform.typedef.blkcnt_t = long
|
50
|
+
rbx.platform.typedef.blksize_t = int
|
51
|
+
rbx.platform.typedef.caddr_t = string
|
52
|
+
rbx.platform.typedef.clock_t = ulong
|
53
|
+
rbx.platform.typedef.clockid_t = ulong
|
54
|
+
rbx.platform.typedef.daddr_t = long
|
55
|
+
rbx.platform.typedef.dev_t = uint
|
56
|
+
rbx.platform.typedef.fd_mask = ulong
|
57
|
+
rbx.platform.typedef.fsblkcnt_t = ulong
|
58
|
+
rbx.platform.typedef.fsfilcnt_t = ulong
|
59
|
+
rbx.platform.typedef.gid_t = uint
|
60
|
+
rbx.platform.typedef.id_t = uint
|
61
|
+
rbx.platform.typedef.in_addr_t = uint
|
62
|
+
rbx.platform.typedef.ino_t = ulong
|
63
|
+
rbx.platform.typedef.int32_t = int
|
64
|
+
rbx.platform.typedef.int64_t = long
|
65
|
+
rbx.platform.typedef.int8_t = char
|
66
|
+
rbx.platform.typedef.int_fast16_t = long
|
67
|
+
rbx.platform.typedef.int_fast32_t = long
|
68
|
+
rbx.platform.typedef.int_fast64_t = long
|
69
|
+
rbx.platform.typedef.int_fast8_t = char
|
70
|
+
rbx.platform.typedef.int_least32_t = int
|
71
|
+
rbx.platform.typedef.int_least64_t = long
|
72
|
+
rbx.platform.typedef.int_least8_t = char
|
73
|
+
rbx.platform.typedef.intmax_t = long
|
74
|
+
rbx.platform.typedef.intptr_t = long
|
75
|
+
rbx.platform.typedef.key_t = long_long
|
76
|
+
rbx.platform.typedef.loff_t = long_long
|
77
|
+
rbx.platform.typedef.mode_t = uint
|
78
|
+
rbx.platform.typedef.nlink_t = ushort
|
79
|
+
rbx.platform.typedef.off_t = long
|
80
|
+
rbx.platform.typedef.pid_t = int
|
81
|
+
rbx.platform.typedef.ptrdiff_t = long
|
82
|
+
rbx.platform.typedef.register_t = long
|
83
|
+
rbx.platform.typedef.rlim_t = ulong
|
84
|
+
rbx.platform.typedef.sbintime_t = long
|
85
|
+
rbx.platform.typedef.sig_atomic_t = int
|
86
|
+
rbx.platform.typedef.sigset_t = ulong
|
87
|
+
rbx.platform.typedef.size_t = ulong
|
88
|
+
rbx.platform.typedef.socklen_t = int
|
89
|
+
rbx.platform.typedef.suseconds_t = long
|
90
|
+
rbx.platform.typedef.time_t = long
|
91
|
+
rbx.platform.typedef.timer_t = ulong
|
92
|
+
rbx.platform.typedef.u_char = uchar
|
93
|
+
rbx.platform.typedef.u_int = uint
|
94
|
+
rbx.platform.typedef.u_int32_t = uint
|
95
|
+
rbx.platform.typedef.u_int64_t = ulong
|
96
|
+
rbx.platform.typedef.u_int8_t = uchar
|
97
|
+
rbx.platform.typedef.u_long = ulong
|
98
|
+
rbx.platform.typedef.u_register_t = ulong
|
99
|
+
rbx.platform.typedef.u_short = ushort
|
100
|
+
rbx.platform.typedef.uid_t = uint
|
101
|
+
rbx.platform.typedef.uint = uint
|
102
|
+
rbx.platform.typedef.uint32_t = uint
|
103
|
+
rbx.platform.typedef.uint64_t = ulong
|
104
|
+
rbx.platform.typedef.uint8_t = uchar
|
105
|
+
rbx.platform.typedef.uint_fast16_t = ulong
|
106
|
+
rbx.platform.typedef.uint_fast32_t = ulong
|
107
|
+
rbx.platform.typedef.uint_fast64_t = ulong
|
108
|
+
rbx.platform.typedef.uint_fast8_t = uchar
|
109
|
+
rbx.platform.typedef.uint_least32_t = uint
|
110
|
+
rbx.platform.typedef.uint_least64_t = ulong
|
111
|
+
rbx.platform.typedef.uint_least8_t = uchar
|
112
|
+
rbx.platform.typedef.uintmax_t = ulong
|
113
|
+
rbx.platform.typedef.uintptr_t = ulong
|
114
|
+
rbx.platform.typedef.ulong = ulong
|
115
|
+
rbx.platform.typedef.useconds_t = ulong
|
116
|
+
rbx.platform.typedef.ushort = ushort
|
117
|
+
rbx.platform.typedef.vm_offset_t = ulong
|
118
|
+
rbx.platform.typedef.vm_size_t = ulong
|
119
|
+
rbx.platform.typedef.wint_t = uint
|
data/lib/ffi/pointer.rb
CHANGED
@@ -85,23 +85,37 @@ module FFI
|
|
85
85
|
# @param [String] str string to write
|
86
86
|
# @param [Numeric] len length of string to return
|
87
87
|
# @return [self]
|
88
|
-
# Write +len+ first bytes of +str+ in pointer's contents.
|
88
|
+
# Write +len+ first bytes of +str+ in pointer's contents and a final \0 byte.
|
89
89
|
#
|
90
90
|
# Same as:
|
91
91
|
# ptr.write_string(str, len) # with len not nil
|
92
92
|
def write_string_length(str, len)
|
93
|
-
|
93
|
+
write_string(str, len)
|
94
94
|
end unless method_defined?(:write_string_length)
|
95
95
|
|
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
|
100
|
-
# +len+ is
|
99
|
+
# Write +str+ in pointer's contents.
|
100
|
+
# If +len+ is given, write the first +len+ bytes of +str+.
|
101
|
+
# In both cases a final \0 byte is written after the string.
|
101
102
|
def write_string(str, len=nil)
|
102
|
-
|
103
|
-
|
104
|
-
|
103
|
+
if len
|
104
|
+
if len == size
|
105
|
+
warn "[DEPRECATION] Memory too small to write a final 0-byte in #{caller(1, 1)[0]}. This will raise an error in ffi-2.0. Please use write_bytes instead or enlarge the memory region."
|
106
|
+
write_bytes(str, 0, len)
|
107
|
+
else
|
108
|
+
put_char(len, 0) # Check size before writing str
|
109
|
+
write_bytes(str, 0, len)
|
110
|
+
end
|
111
|
+
else
|
112
|
+
if str.bytesize == size
|
113
|
+
warn "[DEPRECATION] Memory too small to write a final 0-byte in #{caller(1, 1)[0]}. This will raise an error in ffi-2.0. Please use write_bytes instead or enlarge the memory region."
|
114
|
+
write_bytes(str)
|
115
|
+
else
|
116
|
+
put_string(0, str)
|
117
|
+
end
|
118
|
+
end
|
105
119
|
end unless method_defined?(:write_string)
|
106
120
|
|
107
121
|
# @param [Type] type type of data to read from pointer's contents
|
data/lib/ffi/version.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.
|
4
|
+
version: 1.14.0
|
5
5
|
platform: x86-mingw32
|
6
6
|
authors:
|
7
7
|
- Wayne Meissner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -86,12 +86,6 @@ executables: []
|
|
86
86
|
extensions: []
|
87
87
|
extra_rdoc_files: []
|
88
88
|
files:
|
89
|
-
- ".appveyor.yml"
|
90
|
-
- ".github/workflows/ci.yml"
|
91
|
-
- ".gitignore"
|
92
|
-
- ".gitmodules"
|
93
|
-
- ".travis.yml"
|
94
|
-
- ".yardopts"
|
95
89
|
- CHANGELOG.md
|
96
90
|
- COPYING
|
97
91
|
- Gemfile
|
@@ -106,6 +100,7 @@ files:
|
|
106
100
|
- lib/2.6/ffi_c.so
|
107
101
|
- lib/2.7/ffi_c.so
|
108
102
|
- lib/ffi.rb
|
103
|
+
- lib/ffi/abstract_memory.rb
|
109
104
|
- lib/ffi/autopointer.rb
|
110
105
|
- lib/ffi/buffer.rb
|
111
106
|
- lib/ffi/callback.rb
|
@@ -118,9 +113,11 @@ files:
|
|
118
113
|
- lib/ffi/managedstruct.rb
|
119
114
|
- lib/ffi/memorypointer.rb
|
120
115
|
- lib/ffi/platform.rb
|
116
|
+
- lib/ffi/platform/aarch64-darwin/types.conf
|
121
117
|
- lib/ffi/platform/aarch64-freebsd/types.conf
|
122
118
|
- lib/ffi/platform/aarch64-freebsd12/types.conf
|
123
119
|
- lib/ffi/platform/aarch64-linux/types.conf
|
120
|
+
- lib/ffi/platform/aarch64-openbsd/types.conf
|
124
121
|
- lib/ffi/platform/arm-freebsd/types.conf
|
125
122
|
- lib/ffi/platform/arm-freebsd12/types.conf
|
126
123
|
- lib/ffi/platform/arm-linux/types.conf
|
@@ -160,7 +157,9 @@ files:
|
|
160
157
|
- lib/ffi/platform/x86_64-dragonflybsd/types.conf
|
161
158
|
- lib/ffi/platform/x86_64-freebsd/types.conf
|
162
159
|
- lib/ffi/platform/x86_64-freebsd12/types.conf
|
160
|
+
- lib/ffi/platform/x86_64-haiku/types.conf
|
163
161
|
- lib/ffi/platform/x86_64-linux/types.conf
|
162
|
+
- lib/ffi/platform/x86_64-msys/types.conf
|
164
163
|
- lib/ffi/platform/x86_64-netbsd/types.conf
|
165
164
|
- lib/ffi/platform/x86_64-openbsd/types.conf
|
166
165
|
- lib/ffi/platform/x86_64-solaris/types.conf
|
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"
|
data/.github/workflows/ci.yml
DELETED
@@ -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
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"
|