ffi 1.13.1 → 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 +116 -0
- data/Gemfile +1 -4
- data/README.md +14 -2
- data/Rakefile +43 -29
- data/ext/ffi_c/AbstractMemory.c +24 -25
- data/ext/ffi_c/Buffer.c +2 -7
- data/ext/ffi_c/Call.c +3 -9
- data/ext/ffi_c/ClosurePool.c +64 -11
- data/ext/ffi_c/ClosurePool.h +3 -1
- data/ext/ffi_c/DynamicLibrary.c +1 -6
- data/ext/ffi_c/Function.c +31 -16
- data/ext/ffi_c/Function.h +0 -4
- data/ext/ffi_c/FunctionInfo.c +2 -6
- data/ext/ffi_c/LastError.c +2 -6
- data/ext/ffi_c/MemoryPointer.c +2 -7
- data/ext/ffi_c/MemoryPointer.h +0 -4
- data/ext/ffi_c/MethodHandle.c +4 -8
- data/ext/ffi_c/Platform.c +4 -9
- data/ext/ffi_c/Pointer.c +24 -25
- data/ext/ffi_c/Pointer.h +0 -4
- data/ext/ffi_c/Struct.c +3 -6
- data/ext/ffi_c/StructByValue.c +2 -7
- data/ext/ffi_c/StructLayout.c +2 -6
- data/ext/ffi_c/Thread.c +0 -5
- data/ext/ffi_c/Thread.h +1 -6
- data/ext/ffi_c/Type.c +1 -1
- data/ext/ffi_c/Types.c +6 -7
- data/ext/ffi_c/Types.h +3 -4
- data/ext/ffi_c/Variadic.c +14 -9
- data/ext/ffi_c/extconf.rb +20 -4
- data/ext/ffi_c/libffi/.travis/bfin-sim.exp +1 -1
- data/ext/ffi_c/libffi/.travis/m32r-sim.exp +1 -1
- data/ext/ffi_c/libffi/.travis/moxie-sim.exp +1 -1
- data/ext/ffi_c/libffi/.travis/or1k-sim.exp +1 -1
- data/ext/ffi_c/libffi/.travis/powerpc-eabisim.exp +1 -1
- data/ext/ffi_c/libffi/.travis/wine-sim.exp +1 -1
- data/ext/ffi_c/libffi/Makefile.am +48 -58
- data/ext/ffi_c/libffi/Makefile.in +420 -156
- data/ext/ffi_c/libffi/README.md +4 -0
- data/ext/ffi_c/libffi/config.guess +552 -331
- data/ext/ffi_c/libffi/config.sub +1321 -1306
- data/ext/ffi_c/libffi/configure +158 -96
- data/ext/ffi_c/libffi/configure.ac +6 -1
- data/ext/ffi_c/libffi/configure.host +32 -20
- data/ext/ffi_c/libffi/doc/Makefile.in +8 -5
- data/ext/ffi_c/libffi/fficonfig.h.in +6 -0
- data/ext/ffi_c/libffi/generate-darwin-source-and-headers.py +1 -1
- data/ext/ffi_c/libffi/include/Makefile.in +8 -5
- data/ext/ffi_c/libffi/install-sh +23 -13
- data/ext/ffi_c/libffi/ltmain.sh +156 -61
- data/ext/ffi_c/libffi/man/Makefile.in +8 -5
- data/ext/ffi_c/libffi/missing +8 -8
- data/ext/ffi_c/libffi/msvcc.sh +11 -11
- data/ext/ffi_c/libffi/src/aarch64/ffi.c +45 -35
- data/ext/ffi_c/libffi/src/aarch64/ffitarget.h +10 -5
- data/ext/ffi_c/libffi/src/aarch64/internal.h +1 -0
- data/ext/ffi_c/libffi/src/aarch64/sysv.S +1 -1
- data/ext/ffi_c/libffi/src/aarch64/win64_armasm.S +1 -1
- data/ext/ffi_c/libffi/src/arm/ffi.c +22 -0
- data/ext/ffi_c/libffi/src/arm/sysv.S +4 -4
- data/ext/ffi_c/libffi/src/closures.c +23 -6
- data/ext/ffi_c/libffi/src/csky/ffi.c +395 -0
- data/ext/ffi_c/libffi/src/csky/ffitarget.h +63 -0
- data/ext/ffi_c/libffi/src/csky/sysv.S +371 -0
- data/ext/ffi_c/libffi/src/dlmalloc.c +1 -1
- data/ext/ffi_c/libffi/src/kvx/asm.h +5 -0
- data/ext/ffi_c/libffi/src/kvx/ffi.c +273 -0
- data/ext/ffi_c/libffi/src/kvx/ffitarget.h +75 -0
- data/ext/ffi_c/libffi/src/kvx/sysv.S +127 -0
- data/ext/ffi_c/libffi/src/mips/ffi.c +5 -1
- data/ext/ffi_c/libffi/src/mips/ffitarget.h +1 -1
- data/ext/ffi_c/libffi/src/powerpc/ffi_darwin.c +13 -1
- data/ext/ffi_c/libffi/src/powerpc/ffi_powerpc.h +1 -1
- data/ext/ffi_c/libffi/src/powerpc/linux64.S +8 -0
- data/ext/ffi_c/libffi/src/powerpc/linux64_closure.S +13 -1
- data/ext/ffi_c/libffi/src/prep_cif.c +1 -1
- data/ext/ffi_c/libffi/src/x86/ffi.c +8 -2
- data/ext/ffi_c/libffi/src/x86/ffi64.c +7 -0
- data/ext/ffi_c/libffi/src/x86/ffiw64.c +5 -0
- data/ext/ffi_c/libffi/src/x86/sysv.S +2 -2
- data/ext/ffi_c/libffi/src/x86/unix64.S +1 -2
- data/ext/ffi_c/libffi/src/x86/win64.S +3 -2
- data/ext/ffi_c/libffi/src/x86/win64_intel.S +3 -2
- data/ext/ffi_c/libffi/testsuite/Makefile.in +9 -6
- data/ext/ffi_c/libffi/testsuite/lib/libffi.exp +22 -2
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-call.c +4 -4
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-callback.c +2 -2
- data/ext/ffi_c/libffi/testsuite/libffi.closures/huge_struct.c +2 -0
- data/ffi.gemspec +1 -2
- data/lib/ffi/abstract_memory.rb +44 -0
- data/lib/ffi/autopointer.rb +1 -1
- data/lib/ffi/ffi.rb +1 -0
- data/lib/ffi/io.rb +3 -3
- data/lib/ffi/library.rb +3 -3
- data/lib/ffi/managedstruct.rb +2 -2
- data/lib/ffi/platform/aarch64-darwin/types.conf +130 -0
- data/lib/ffi/platform/aarch64-freebsd/types.conf +2 -2
- data/lib/ffi/platform/aarch64-freebsd12/types.conf +113 -60
- data/lib/ffi/platform/aarch64-openbsd/types.conf +134 -0
- data/lib/ffi/platform/powerpc64le-linux/types.conf +100 -0
- data/lib/ffi/platform/riscv64-linux/types.conf +104 -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/platform.rb +17 -11
- data/lib/ffi/pointer.rb +2 -2
- data/lib/ffi/tools/const_generator.rb +6 -4
- data/lib/ffi/tools/struct_generator.rb +2 -1
- data/lib/ffi/variadic.rb +1 -10
- data/lib/ffi/version.rb +1 -1
- data/lib/ffi.rb +3 -4
- data/rakelib/ffi_gem_helper.rb +65 -0
- metadata +21 -28
- 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
- data/ext/ffi_c/win32/stdbool.h +0 -8
- data/ext/ffi_c/win32/stdint.h +0 -201
@@ -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,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
|
@@ -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/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
|
@@ -129,11 +132,8 @@ module FFI
|
|
129
132
|
end
|
130
133
|
|
131
134
|
LIBC = if IS_WINDOWS
|
132
|
-
|
133
|
-
|
134
|
-
else
|
135
|
-
"ucrtbase.dll"
|
136
|
-
end
|
135
|
+
crtname = RbConfig::CONFIG["RUBY_SO_NAME"][/msvc\w+/] || 'ucrtbase'
|
136
|
+
"#{crtname}.dll"
|
137
137
|
elsif IS_GNU
|
138
138
|
GNU_LIBC
|
139
139
|
elsif OS == 'cygwin'
|
@@ -145,6 +145,12 @@ module FFI
|
|
145
145
|
"#{LIBPREFIX}c.#{LIBSUFFIX}"
|
146
146
|
end
|
147
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
|
+
|
148
154
|
# Test if current OS is a *BSD (include MAC)
|
149
155
|
# @return [Boolean]
|
150
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
|
-
|
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
|
-
|
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 = `#{
|
136
|
-
File.unlink(
|
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]
|