ffi 1.0.0 → 1.17.1

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.
Files changed (694) hide show
  1. checksums.yaml +7 -0
  2. checksums.yaml.gz.sig +4 -0
  3. data/CHANGELOG.md +465 -0
  4. data/COPYING +49 -0
  5. data/Gemfile +21 -0
  6. data/LICENSE +21 -11
  7. data/LICENSE.SPECS +22 -0
  8. data/README.md +137 -0
  9. data/Rakefile +165 -148
  10. data/ext/ffi_c/AbstractMemory.c +716 -97
  11. data/ext/ffi_c/AbstractMemory.h +38 -17
  12. data/ext/ffi_c/ArrayType.c +102 -33
  13. data/ext/ffi_c/ArrayType.h +20 -18
  14. data/ext/ffi_c/Buffer.c +229 -54
  15. data/ext/ffi_c/Call.c +211 -100
  16. data/ext/ffi_c/Call.h +46 -28
  17. data/ext/ffi_c/ClosurePool.c +110 -81
  18. data/ext/ffi_c/ClosurePool.h +31 -1
  19. data/ext/ffi_c/DynamicLibrary.c +216 -54
  20. data/ext/ffi_c/DynamicLibrary.h +76 -0
  21. data/ext/ffi_c/Function.c +527 -164
  22. data/ext/ffi_c/Function.h +24 -20
  23. data/ext/ffi_c/FunctionInfo.c +151 -50
  24. data/ext/ffi_c/LastError.c +112 -28
  25. data/ext/ffi_c/LastError.h +29 -0
  26. data/ext/ffi_c/LongDouble.c +65 -0
  27. data/ext/ffi_c/LongDouble.h +47 -0
  28. data/ext/ffi_c/MappedType.c +107 -42
  29. data/ext/ffi_c/MappedType.h +20 -20
  30. data/ext/ffi_c/MemoryPointer.c +108 -46
  31. data/ext/ffi_c/MemoryPointer.h +33 -4
  32. data/ext/ffi_c/MethodHandle.c +71 -67
  33. data/ext/ffi_c/MethodHandle.h +26 -23
  34. data/ext/ffi_c/Platform.c +42 -25
  35. data/ext/ffi_c/Platform.h +32 -3
  36. data/ext/ffi_c/Pointer.c +324 -51
  37. data/ext/ffi_c/Pointer.h +29 -18
  38. data/ext/ffi_c/Struct.c +434 -161
  39. data/ext/ffi_c/Struct.h +47 -27
  40. data/ext/ffi_c/StructByValue.c +74 -37
  41. data/ext/ffi_c/StructByValue.h +20 -18
  42. data/ext/ffi_c/StructLayout.c +358 -87
  43. data/ext/ffi_c/Thread.c +129 -0
  44. data/ext/ffi_c/Thread.h +76 -0
  45. data/ext/ffi_c/Type.c +241 -76
  46. data/ext/ffi_c/Type.h +27 -11
  47. data/ext/ffi_c/Types.c +54 -34
  48. data/ext/ffi_c/Types.h +24 -24
  49. data/ext/ffi_c/Variadic.c +151 -55
  50. data/ext/ffi_c/compat.h +48 -38
  51. data/ext/ffi_c/extconf.rb +106 -34
  52. data/ext/ffi_c/ffi.c +35 -26
  53. data/ext/ffi_c/libffi/.allow-ai-service +0 -0
  54. data/ext/ffi_c/libffi/.appveyor/site.exp +16 -0
  55. data/ext/ffi_c/libffi/.appveyor/unix-noexec.exp +7 -0
  56. data/ext/ffi_c/libffi/.appveyor.yml +84 -0
  57. data/ext/ffi_c/libffi/.ci/ar-lib +270 -0
  58. data/ext/ffi_c/libffi/.ci/bfin-sim.exp +58 -0
  59. data/ext/ffi_c/libffi/.ci/build-cross-in-container.sh +18 -0
  60. data/ext/ffi_c/libffi/.ci/build-in-container.sh +10 -0
  61. data/ext/ffi_c/libffi/.ci/build.sh +124 -0
  62. data/ext/ffi_c/libffi/.ci/compile +351 -0
  63. data/ext/ffi_c/libffi/.ci/install.sh +78 -0
  64. data/ext/ffi_c/libffi/.ci/m32r-sim.exp +58 -0
  65. data/ext/ffi_c/libffi/.ci/moxie-sim.exp +60 -0
  66. data/ext/ffi_c/libffi/.ci/msvs-detect +1103 -0
  67. data/ext/ffi_c/libffi/.ci/or1k-sim.exp +58 -0
  68. data/ext/ffi_c/libffi/.ci/powerpc-eabisim.exp +58 -0
  69. data/ext/ffi_c/libffi/.ci/site.exp +29 -0
  70. data/ext/ffi_c/libffi/.ci/wine-sim.exp +55 -0
  71. data/ext/ffi_c/libffi/.circleci/config.yml +156 -0
  72. data/ext/ffi_c/libffi/.gitattributes +4 -0
  73. data/ext/ffi_c/libffi/.github/issue_template.md +10 -0
  74. data/ext/ffi_c/libffi/.github/workflows/build.yml +479 -0
  75. data/ext/ffi_c/libffi/.github/workflows/emscripten.yml +172 -0
  76. data/ext/ffi_c/libffi/.gitignore +46 -0
  77. data/ext/ffi_c/libffi/{ChangeLog → ChangeLog.old} +6528 -3180
  78. data/ext/ffi_c/libffi/LICENSE +3 -3
  79. data/ext/ffi_c/libffi/LICENSE-BUILDTOOLS +353 -0
  80. data/ext/ffi_c/libffi/Makefile.am +132 -162
  81. data/ext/ffi_c/libffi/Makefile.in +1339 -1003
  82. data/ext/ffi_c/libffi/README.md +531 -0
  83. data/ext/ffi_c/libffi/acinclude.m4 +289 -4
  84. data/ext/ffi_c/libffi/autogen.sh +2 -0
  85. data/ext/ffi_c/libffi/compile +227 -21
  86. data/ext/ffi_c/libffi/config.guess +1034 -778
  87. data/ext/ffi_c/libffi/config.sub +1394 -1204
  88. data/ext/ffi_c/libffi/configure +14327 -8503
  89. data/ext/ffi_c/libffi/configure.ac +294 -247
  90. data/ext/ffi_c/libffi/configure.host +330 -4
  91. data/ext/ffi_c/libffi/doc/Makefile.am +3 -0
  92. data/ext/ffi_c/libffi/doc/Makefile.in +818 -0
  93. data/ext/ffi_c/libffi/doc/libffi.texi +572 -67
  94. data/ext/ffi_c/libffi/doc/version.texi +4 -4
  95. data/ext/ffi_c/libffi/fficonfig.h.in +53 -46
  96. data/ext/ffi_c/libffi/generate-darwin-source-and-headers.py +312 -0
  97. data/ext/ffi_c/libffi/include/Makefile.am +3 -3
  98. data/ext/ffi_c/libffi/include/Makefile.in +219 -79
  99. data/ext/ffi_c/libffi/include/ffi.h.in +230 -111
  100. data/ext/ffi_c/libffi/include/ffi_cfi.h +76 -0
  101. data/ext/ffi_c/libffi/include/ffi_common.h +78 -16
  102. data/ext/ffi_c/libffi/include/tramp.h +45 -0
  103. data/ext/ffi_c/libffi/install-sh +402 -184
  104. data/ext/ffi_c/libffi/libffi.map.in +81 -0
  105. data/ext/ffi_c/libffi/libffi.pc.in +3 -2
  106. data/ext/ffi_c/libffi/libffi.xcodeproj/project.pbxproj +997 -0
  107. data/ext/ffi_c/libffi/libtool-ldflags +106 -0
  108. data/ext/ffi_c/libffi/libtool-version +2 -2
  109. data/ext/ffi_c/libffi/ltmain.sh +5752 -2722
  110. data/ext/ffi_c/libffi/m4/asmcfi.m4 +13 -0
  111. data/ext/ffi_c/libffi/m4/ax_append_flag.m4 +50 -0
  112. data/ext/ffi_c/libffi/m4/ax_cc_maxopt.m4 +198 -0
  113. data/ext/ffi_c/libffi/m4/ax_cflags_warn_all.m4 +158 -0
  114. data/ext/ffi_c/libffi/m4/ax_check_compile_flag.m4 +53 -0
  115. data/ext/ffi_c/libffi/m4/ax_compiler_vendor.m4 +119 -0
  116. data/ext/ffi_c/libffi/m4/ax_configure_args.m4 +49 -0
  117. data/ext/ffi_c/libffi/m4/ax_enable_builddir.m4 +302 -0
  118. data/ext/ffi_c/libffi/m4/ax_gcc_archflag.m4 +267 -0
  119. data/ext/ffi_c/libffi/m4/ax_gcc_x86_cpuid.m4 +89 -0
  120. data/ext/ffi_c/libffi/m4/ax_prepend_flag.m4 +51 -0
  121. data/ext/ffi_c/libffi/m4/ax_require_defined.m4 +37 -0
  122. data/ext/ffi_c/libffi/make_sunver.pl +333 -0
  123. data/ext/ffi_c/libffi/man/Makefile.am +2 -2
  124. data/ext/ffi_c/libffi/man/Makefile.in +174 -57
  125. data/ext/ffi_c/libffi/man/ffi.3 +10 -0
  126. data/ext/ffi_c/libffi/man/ffi_prep_cif.3 +6 -4
  127. data/ext/ffi_c/libffi/man/ffi_prep_cif_var.3 +73 -0
  128. data/ext/ffi_c/libffi/missing +155 -300
  129. data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.sln +33 -0
  130. data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj +130 -0
  131. data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj.filters +57 -0
  132. data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj.user +4 -0
  133. data/ext/ffi_c/libffi/msvc_build/aarch64/aarch64_include/ffi.h +511 -0
  134. data/ext/ffi_c/libffi/msvc_build/aarch64/aarch64_include/fficonfig.h +219 -0
  135. data/ext/ffi_c/libffi/msvcc.sh +353 -0
  136. data/ext/ffi_c/libffi/src/aarch64/ffi.c +1142 -0
  137. data/ext/ffi_c/libffi/src/aarch64/ffitarget.h +97 -0
  138. data/ext/ffi_c/libffi/src/aarch64/internal.h +100 -0
  139. data/ext/ffi_c/libffi/src/aarch64/sysv.S +695 -0
  140. data/ext/ffi_c/libffi/src/aarch64/win64_armasm.S +506 -0
  141. data/ext/ffi_c/libffi/src/alpha/ffi.c +335 -98
  142. data/ext/ffi_c/libffi/src/alpha/ffitarget.h +10 -1
  143. data/ext/ffi_c/libffi/src/alpha/internal.h +23 -0
  144. data/ext/ffi_c/libffi/src/alpha/osf.S +162 -246
  145. data/ext/ffi_c/libffi/src/arc/arcompact.S +210 -0
  146. data/ext/ffi_c/libffi/src/arc/ffi.c +443 -0
  147. data/ext/ffi_c/libffi/src/arc/ffitarget.h +67 -0
  148. data/ext/ffi_c/libffi/src/arm/ffi.c +806 -194
  149. data/ext/ffi_c/libffi/src/arm/ffitarget.h +43 -3
  150. data/ext/ffi_c/libffi/src/arm/internal.h +17 -0
  151. data/ext/ffi_c/libffi/src/arm/sysv.S +381 -231
  152. data/ext/ffi_c/libffi/src/arm/sysv_msvc_arm32.S +311 -0
  153. data/ext/ffi_c/libffi/src/avr32/ffi.c +4 -2
  154. data/ext/ffi_c/libffi/src/avr32/ffitarget.h +8 -3
  155. data/ext/ffi_c/libffi/src/bfin/ffi.c +196 -0
  156. data/ext/ffi_c/libffi/src/bfin/ffitarget.h +43 -0
  157. data/ext/ffi_c/libffi/src/bfin/sysv.S +179 -0
  158. data/ext/ffi_c/libffi/src/closures.c +574 -100
  159. data/ext/ffi_c/libffi/src/cris/ffi.c +11 -8
  160. data/ext/ffi_c/libffi/src/cris/ffitarget.h +8 -3
  161. data/ext/ffi_c/libffi/src/csky/ffi.c +395 -0
  162. data/ext/ffi_c/libffi/src/csky/ffitarget.h +63 -0
  163. data/ext/ffi_c/libffi/src/csky/sysv.S +371 -0
  164. data/ext/ffi_c/libffi/src/debug.c +8 -3
  165. data/ext/ffi_c/libffi/src/dlmalloc.c +89 -17
  166. data/ext/ffi_c/libffi/src/frv/ffi.c +2 -2
  167. data/ext/ffi_c/libffi/src/frv/ffitarget.h +8 -7
  168. data/ext/ffi_c/libffi/src/ia64/ffi.c +48 -12
  169. data/ext/ffi_c/libffi/src/ia64/ffitarget.h +10 -4
  170. data/ext/ffi_c/libffi/src/ia64/unix.S +28 -3
  171. data/ext/ffi_c/libffi/src/java_raw_api.c +24 -6
  172. data/ext/ffi_c/libffi/src/kvx/asm.h +5 -0
  173. data/ext/ffi_c/libffi/src/kvx/ffi.c +273 -0
  174. data/ext/ffi_c/libffi/src/kvx/ffitarget.h +75 -0
  175. data/ext/ffi_c/libffi/src/kvx/sysv.S +127 -0
  176. data/ext/ffi_c/libffi/src/loongarch64/ffi.c +624 -0
  177. data/ext/ffi_c/libffi/src/loongarch64/ffitarget.h +82 -0
  178. data/ext/ffi_c/libffi/src/loongarch64/sysv.S +327 -0
  179. data/ext/ffi_c/libffi/src/m32r/ffi.c +32 -15
  180. data/ext/ffi_c/libffi/src/m32r/ffitarget.h +8 -3
  181. data/ext/ffi_c/libffi/src/m68k/ffi.c +97 -13
  182. data/ext/ffi_c/libffi/src/m68k/ffitarget.h +8 -3
  183. data/ext/ffi_c/libffi/src/m68k/sysv.S +148 -25
  184. data/ext/ffi_c/libffi/src/m88k/ffi.c +400 -0
  185. data/ext/ffi_c/libffi/src/m88k/ffitarget.h +49 -0
  186. data/ext/ffi_c/libffi/src/m88k/obsd.S +209 -0
  187. data/ext/ffi_c/libffi/src/metag/ffi.c +330 -0
  188. data/ext/ffi_c/libffi/src/metag/ffitarget.h +53 -0
  189. data/ext/ffi_c/libffi/src/metag/sysv.S +311 -0
  190. data/ext/ffi_c/libffi/src/microblaze/ffi.c +321 -0
  191. data/ext/ffi_c/libffi/src/microblaze/ffitarget.h +53 -0
  192. data/ext/ffi_c/libffi/src/microblaze/sysv.S +302 -0
  193. data/ext/ffi_c/libffi/src/mips/ffi.c +392 -104
  194. data/ext/ffi_c/libffi/src/mips/ffitarget.h +40 -24
  195. data/ext/ffi_c/libffi/src/mips/n32.S +325 -93
  196. data/ext/ffi_c/libffi/src/mips/o32.S +211 -31
  197. data/ext/ffi_c/libffi/src/moxie/eabi.S +101 -0
  198. data/ext/ffi_c/libffi/src/moxie/ffi.c +310 -0
  199. data/ext/ffi_c/libffi/src/moxie/ffitarget.h +52 -0
  200. data/ext/ffi_c/libffi/src/nios2/ffi.c +304 -0
  201. data/ext/ffi_c/libffi/src/nios2/ffitarget.h +52 -0
  202. data/ext/ffi_c/libffi/src/nios2/sysv.S +136 -0
  203. data/ext/ffi_c/libffi/src/or1k/ffi.c +341 -0
  204. data/ext/ffi_c/libffi/src/or1k/ffitarget.h +58 -0
  205. data/ext/ffi_c/libffi/src/or1k/sysv.S +107 -0
  206. data/ext/ffi_c/libffi/src/pa/ffi.c +68 -111
  207. data/ext/ffi_c/libffi/src/pa/ffi64.c +614 -0
  208. data/ext/ffi_c/libffi/src/pa/ffitarget.h +34 -17
  209. data/ext/ffi_c/libffi/src/pa/hpux32.S +87 -38
  210. data/ext/ffi_c/libffi/src/pa/hpux64.S +681 -0
  211. data/ext/ffi_c/libffi/src/pa/linux.S +109 -39
  212. data/ext/ffi_c/libffi/src/powerpc/aix.S +250 -8
  213. data/ext/ffi_c/libffi/src/powerpc/aix_closure.S +255 -4
  214. data/ext/ffi_c/libffi/src/powerpc/asm.h +3 -3
  215. data/ext/ffi_c/libffi/src/powerpc/darwin.S +211 -78
  216. data/ext/ffi_c/libffi/src/powerpc/darwin_closure.S +356 -102
  217. data/ext/ffi_c/libffi/src/powerpc/ffi.c +108 -1375
  218. data/ext/ffi_c/libffi/src/powerpc/ffi_darwin.c +746 -210
  219. data/ext/ffi_c/libffi/src/powerpc/ffi_linux64.c +1153 -0
  220. data/ext/ffi_c/libffi/src/powerpc/ffi_powerpc.h +105 -0
  221. data/ext/ffi_c/libffi/src/powerpc/ffi_sysv.c +923 -0
  222. data/ext/ffi_c/libffi/src/powerpc/ffitarget.h +126 -48
  223. data/ext/ffi_c/libffi/src/powerpc/linux64.S +191 -85
  224. data/ext/ffi_c/libffi/src/powerpc/linux64_closure.S +438 -108
  225. data/ext/ffi_c/libffi/src/powerpc/ppc_closure.S +138 -68
  226. data/ext/ffi_c/libffi/src/powerpc/sysv.S +73 -119
  227. data/ext/ffi_c/libffi/src/powerpc/t-aix +5 -0
  228. data/ext/ffi_c/libffi/src/prep_cif.c +141 -32
  229. data/ext/ffi_c/libffi/src/raw_api.c +18 -5
  230. data/ext/ffi_c/libffi/src/riscv/ffi.c +514 -0
  231. data/ext/ffi_c/libffi/src/riscv/ffitarget.h +69 -0
  232. data/ext/ffi_c/libffi/src/riscv/sysv.S +293 -0
  233. data/ext/ffi_c/libffi/src/s390/ffi.c +294 -318
  234. data/ext/ffi_c/libffi/src/s390/ffitarget.h +13 -3
  235. data/ext/ffi_c/libffi/src/s390/internal.h +11 -0
  236. data/ext/ffi_c/libffi/src/s390/sysv.S +257 -366
  237. data/ext/ffi_c/libffi/src/sh/ffi.c +4 -3
  238. data/ext/ffi_c/libffi/src/sh/ffitarget.h +8 -3
  239. data/ext/ffi_c/libffi/src/sh64/ffi.c +3 -2
  240. data/ext/ffi_c/libffi/src/sh64/ffitarget.h +8 -3
  241. data/ext/ffi_c/libffi/src/sparc/ffi.c +334 -491
  242. data/ext/ffi_c/libffi/src/sparc/ffi64.c +630 -0
  243. data/ext/ffi_c/libffi/src/sparc/ffitarget.h +20 -5
  244. data/ext/ffi_c/libffi/src/sparc/internal.h +26 -0
  245. data/ext/ffi_c/libffi/src/sparc/v8.S +364 -234
  246. data/ext/ffi_c/libffi/src/sparc/v9.S +340 -207
  247. data/ext/ffi_c/libffi/src/tile/ffi.c +355 -0
  248. data/ext/ffi_c/libffi/src/tile/ffitarget.h +65 -0
  249. data/ext/ffi_c/libffi/src/tile/tile.S +360 -0
  250. data/ext/ffi_c/libffi/src/tramp.c +716 -0
  251. data/ext/ffi_c/libffi/src/types.c +48 -19
  252. data/ext/ffi_c/libffi/src/vax/elfbsd.S +195 -0
  253. data/ext/ffi_c/libffi/src/vax/ffi.c +276 -0
  254. data/ext/ffi_c/libffi/src/vax/ffitarget.h +49 -0
  255. data/ext/ffi_c/libffi/src/wasm32/ffi.c +947 -0
  256. data/ext/ffi_c/libffi/src/wasm32/ffitarget.h +62 -0
  257. data/ext/ffi_c/libffi/src/x86/asmnames.h +30 -0
  258. data/ext/ffi_c/libffi/src/x86/ffi.c +690 -540
  259. data/ext/ffi_c/libffi/src/x86/ffi64.c +450 -126
  260. data/ext/ffi_c/libffi/src/x86/ffitarget.h +86 -42
  261. data/ext/ffi_c/libffi/src/x86/ffiw64.c +361 -0
  262. data/ext/ffi_c/libffi/src/x86/internal.h +43 -0
  263. data/ext/ffi_c/libffi/src/x86/internal64.h +36 -0
  264. data/ext/ffi_c/libffi/src/x86/sysv.S +1199 -381
  265. data/ext/ffi_c/libffi/src/x86/sysv_intel.S +998 -0
  266. data/ext/ffi_c/libffi/src/x86/unix64.S +587 -298
  267. data/ext/ffi_c/libffi/src/x86/win64.S +251 -457
  268. data/ext/ffi_c/libffi/src/x86/win64_intel.S +238 -0
  269. data/ext/ffi_c/libffi/src/xtensa/ffi.c +306 -0
  270. data/ext/ffi_c/libffi/src/xtensa/ffitarget.h +57 -0
  271. data/ext/ffi_c/libffi/src/xtensa/sysv.S +268 -0
  272. data/ext/ffi_c/libffi/stamp-h.in +1 -0
  273. data/ext/ffi_c/libffi/testsuite/Makefile.am +80 -73
  274. data/ext/ffi_c/libffi/testsuite/Makefile.in +251 -117
  275. data/ext/ffi_c/libffi/testsuite/emscripten/build-tests.sh +54 -0
  276. data/ext/ffi_c/libffi/testsuite/emscripten/build.sh +63 -0
  277. data/ext/ffi_c/libffi/testsuite/emscripten/conftest.py +86 -0
  278. data/ext/ffi_c/libffi/testsuite/emscripten/node-tests.sh +48 -0
  279. data/ext/ffi_c/libffi/testsuite/emscripten/test.html +7 -0
  280. data/ext/ffi_c/libffi/testsuite/emscripten/test_libffi.py +51 -0
  281. data/ext/ffi_c/libffi/testsuite/lib/libffi.exp +682 -0
  282. data/ext/ffi_c/libffi/testsuite/lib/target-libpath.exp +22 -2
  283. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/Makefile +28 -0
  284. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/README +78 -0
  285. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/alignof.h +50 -0
  286. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/bhaible.exp +63 -0
  287. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-call.c +1746 -0
  288. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-callback.c +2885 -0
  289. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/testcases.c +747 -0
  290. data/ext/ffi_c/libffi/testsuite/libffi.call/align_mixed.c +46 -0
  291. data/ext/ffi_c/libffi/testsuite/libffi.call/align_stdcall.c +46 -0
  292. data/ext/ffi_c/libffi/testsuite/libffi.call/bpo_38748.c +41 -0
  293. data/ext/ffi_c/libffi/testsuite/libffi.call/call.exp +28 -10
  294. data/ext/ffi_c/libffi/testsuite/libffi.call/callback.c +99 -0
  295. data/ext/ffi_c/libffi/testsuite/libffi.call/callback2.c +108 -0
  296. data/ext/ffi_c/libffi/testsuite/libffi.call/callback3.c +114 -0
  297. data/ext/ffi_c/libffi/testsuite/libffi.call/callback4.c +119 -0
  298. data/ext/ffi_c/libffi/testsuite/libffi.call/err_bad_typedef.c +4 -3
  299. data/ext/ffi_c/libffi/testsuite/libffi.call/ffitest.h +88 -42
  300. data/ext/ffi_c/libffi/testsuite/libffi.call/float1.c +3 -1
  301. data/ext/ffi_c/libffi/testsuite/libffi.call/float2.c +15 -12
  302. data/ext/ffi_c/libffi/testsuite/libffi.call/float3.c +4 -2
  303. data/ext/ffi_c/libffi/testsuite/libffi.call/float_va.c +110 -0
  304. data/ext/ffi_c/libffi/testsuite/libffi.call/many.c +6 -16
  305. data/ext/ffi_c/libffi/testsuite/libffi.call/many2.c +57 -0
  306. data/ext/ffi_c/libffi/testsuite/libffi.call/many_double.c +70 -0
  307. data/ext/ffi_c/libffi/testsuite/libffi.call/many_mixed.c +78 -0
  308. data/ext/ffi_c/libffi/testsuite/libffi.call/negint.c +0 -1
  309. data/ext/ffi_c/libffi/testsuite/libffi.call/offsets.c +46 -0
  310. data/ext/ffi_c/libffi/testsuite/libffi.call/pr1172638.c +127 -0
  311. data/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl.c +1 -0
  312. data/ext/ffi_c/libffi/testsuite/libffi.call/return_ldl.c +1 -1
  313. data/ext/ffi_c/libffi/testsuite/libffi.call/return_ll1.c +6 -0
  314. data/ext/ffi_c/libffi/testsuite/libffi.call/return_sc.c +1 -1
  315. data/ext/ffi_c/libffi/testsuite/libffi.call/return_sl.c +4 -0
  316. data/ext/ffi_c/libffi/testsuite/libffi.call/return_uc.c +1 -1
  317. data/ext/ffi_c/libffi/testsuite/libffi.call/return_ul.c +4 -0
  318. data/ext/ffi_c/libffi/testsuite/libffi.call/s55.c +60 -0
  319. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen.c +9 -10
  320. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen2.c +49 -0
  321. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen3.c +49 -0
  322. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen4.c +55 -0
  323. data/ext/ffi_c/libffi/testsuite/libffi.call/struct1.c +9 -7
  324. data/ext/ffi_c/libffi/testsuite/libffi.call/struct10.c +57 -0
  325. data/ext/ffi_c/libffi/testsuite/libffi.call/struct2.c +7 -7
  326. data/ext/ffi_c/libffi/testsuite/libffi.call/struct3.c +7 -6
  327. data/ext/ffi_c/libffi/testsuite/libffi.call/struct4.c +9 -8
  328. data/ext/ffi_c/libffi/testsuite/libffi.call/struct5.c +9 -8
  329. data/ext/ffi_c/libffi/testsuite/libffi.call/struct6.c +9 -9
  330. data/ext/ffi_c/libffi/testsuite/libffi.call/struct7.c +9 -9
  331. data/ext/ffi_c/libffi/testsuite/libffi.call/struct8.c +9 -8
  332. data/ext/ffi_c/libffi/testsuite/libffi.call/struct9.c +9 -8
  333. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_2.c +63 -0
  334. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_3.c +65 -0
  335. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_3f.c +65 -0
  336. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_4.c +67 -0
  337. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_4f.c +67 -0
  338. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_big.c +93 -0
  339. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_small.c +61 -0
  340. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_return_2H.c +63 -0
  341. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_return_8H.c +90 -0
  342. data/ext/ffi_c/libffi/testsuite/libffi.call/uninitialized.c +61 -0
  343. data/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c +78 -0
  344. data/ext/ffi_c/libffi/testsuite/libffi.call/va_2.c +220 -0
  345. data/ext/ffi_c/libffi/testsuite/libffi.call/va_3.c +154 -0
  346. data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct1.c +134 -0
  347. data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct2.c +134 -0
  348. data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct3.c +140 -0
  349. data/ext/ffi_c/libffi/testsuite/libffi.closures/closure.exp +67 -0
  350. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn0.c +3 -2
  351. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn1.c +2 -0
  352. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn2.c +2 -0
  353. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn3.c +21 -1
  354. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn4.c +2 -0
  355. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn5.c +2 -0
  356. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn6.c +2 -0
  357. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_loc_fn0.c +7 -6
  358. data/ext/ffi_c/libffi/testsuite/{libffi.call/closure_stdcall.c → libffi.closures/closure_simple.c} +13 -16
  359. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_12byte.c +22 -4
  360. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_16byte.c +26 -4
  361. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_18byte.c +28 -4
  362. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_19byte.c +33 -4
  363. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_1_1byte.c +8 -4
  364. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_20byte.c +23 -5
  365. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_20byte1.c +25 -5
  366. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_24byte.c +40 -8
  367. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_2byte.c +17 -4
  368. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3_1byte.c +23 -4
  369. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3byte1.c +17 -4
  370. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3byte2.c +17 -4
  371. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3float.c +113 -0
  372. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_4_1byte.c +26 -4
  373. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_4byte.c +17 -4
  374. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_5_1_byte.c +33 -5
  375. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_5byte.c +23 -5
  376. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_64byte.c +29 -5
  377. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_6_1_byte.c +32 -5
  378. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_6byte.c +28 -6
  379. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_7_1_byte.c +43 -5
  380. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_7byte.c +29 -5
  381. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_8byte.c +18 -4
  382. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_9byte1.c +18 -5
  383. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_9byte2.c +18 -6
  384. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_double.c +23 -5
  385. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_float.c +23 -5
  386. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble.c +24 -5
  387. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble_split.c +44 -31
  388. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble_split2.c +44 -9
  389. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_pointer.c +23 -5
  390. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint16.c +22 -5
  391. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint32.c +22 -7
  392. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint64.c +23 -5
  393. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint16.c +22 -5
  394. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint32.c +23 -5
  395. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint64.c +24 -5
  396. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_dbls_struct.c +7 -5
  397. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_double_va.c +21 -9
  398. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_float.c +4 -0
  399. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_longdouble.c +13 -3
  400. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_longdouble_va.c +34 -11
  401. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_many_mixed_args.c +70 -0
  402. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_many_mixed_float_double.c +55 -0
  403. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_schar.c +5 -1
  404. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_sshort.c +6 -1
  405. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_sshortchar.c +9 -1
  406. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_uchar.c +9 -1
  407. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_ushort.c +6 -2
  408. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_ushortchar.c +9 -1
  409. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_pointer.c +7 -2
  410. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_pointer_stack.c +22 -10
  411. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_schar.c +3 -0
  412. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_sint.c +2 -0
  413. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_sshort.c +3 -0
  414. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_struct_va1.c +125 -0
  415. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uchar.c +3 -0
  416. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uint.c +4 -0
  417. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uint_va.c +49 -0
  418. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ulong_va.c +49 -0
  419. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ulonglong.c +8 -5
  420. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ushort.c +3 -0
  421. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/err_bad_abi.c +2 -3
  422. data/ext/ffi_c/libffi/testsuite/libffi.closures/ffitest.h +1 -0
  423. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/huge_struct.c +57 -56
  424. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct.c +38 -15
  425. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct1.c +9 -9
  426. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct10.c +19 -6
  427. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct11.c +137 -0
  428. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct12.c +86 -0
  429. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct13.c +115 -0
  430. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct2.c +15 -6
  431. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct3.c +15 -6
  432. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct4.c +14 -5
  433. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct5.c +14 -5
  434. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct6.c +17 -6
  435. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct7.c +14 -5
  436. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct8.c +17 -6
  437. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct9.c +17 -6
  438. data/ext/ffi_c/libffi/testsuite/libffi.closures/single_entry_structs1.c +86 -0
  439. data/ext/ffi_c/libffi/testsuite/libffi.closures/single_entry_structs2.c +102 -0
  440. data/ext/ffi_c/libffi/testsuite/libffi.closures/single_entry_structs3.c +101 -0
  441. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_large.c +7 -7
  442. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_large2.c +7 -7
  443. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_medium.c +6 -6
  444. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_medium2.c +7 -6
  445. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/testclosure.c +8 -3
  446. data/ext/ffi_c/libffi/testsuite/{libffi.special → libffi.closures}/unwindtest.cc +4 -10
  447. data/ext/ffi_c/libffi/testsuite/{libffi.special → libffi.closures}/unwindtest_ffi_call.cc +4 -2
  448. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex.inc +91 -0
  449. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_double.c +10 -0
  450. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_float.c +10 -0
  451. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_longdouble.c +10 -0
  452. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex.inc +42 -0
  453. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_double.c +10 -0
  454. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_float.c +10 -0
  455. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_longdouble.c +10 -0
  456. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct.inc +71 -0
  457. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_double.c +10 -0
  458. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_float.c +10 -0
  459. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_longdouble.c +10 -0
  460. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va.inc +80 -0
  461. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_double.c +10 -0
  462. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_float.c +16 -0
  463. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_longdouble.c +10 -0
  464. data/ext/ffi_c/libffi/testsuite/{libffi.special/special.exp → libffi.complex/complex.exp} +9 -10
  465. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex.inc +51 -0
  466. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_double.inc +7 -0
  467. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_float.inc +7 -0
  468. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_longdouble.inc +7 -0
  469. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_double.c +10 -0
  470. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_float.c +10 -0
  471. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_int.c +86 -0
  472. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_longdouble.c +10 -0
  473. data/ext/ffi_c/libffi/testsuite/libffi.complex/ffitest.h +1 -0
  474. data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex.inc +78 -0
  475. data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_double.c +10 -0
  476. data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_float.c +10 -0
  477. data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_longdouble.c +10 -0
  478. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex.inc +37 -0
  479. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1.inc +41 -0
  480. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_double.c +10 -0
  481. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_float.c +10 -0
  482. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_longdouble.c +10 -0
  483. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2.inc +44 -0
  484. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_double.c +10 -0
  485. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_float.c +10 -0
  486. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_longdouble.c +10 -0
  487. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_double.c +10 -0
  488. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_float.c +10 -0
  489. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_longdouble.c +10 -0
  490. data/ext/ffi_c/libffi/testsuite/libffi.go/aa-direct.c +34 -0
  491. data/ext/ffi_c/libffi/testsuite/libffi.go/closure1.c +28 -0
  492. data/ext/ffi_c/libffi/testsuite/libffi.go/ffitest.h +1 -0
  493. data/ext/ffi_c/libffi/testsuite/libffi.go/go.exp +36 -0
  494. data/ext/ffi_c/libffi/testsuite/libffi.go/static-chain.h +19 -0
  495. data/ext/ffi_c/libffi.bsd.mk +14 -8
  496. data/ext/ffi_c/libffi.darwin.mk +56 -26
  497. data/ext/ffi_c/libffi.gnu.mk +9 -6
  498. data/ext/ffi_c/libffi.mk +13 -8
  499. data/ext/ffi_c/libffi.vc.mk +26 -0
  500. data/ext/ffi_c/libffi.vc64.mk +26 -0
  501. data/ext/ffi_c/rbffi.h +34 -6
  502. data/ext/ffi_c/{endian.h → rbffi_endian.h} +21 -2
  503. data/ffi.gemspec +42 -0
  504. data/lib/ffi/abstract_memory.rb +44 -0
  505. data/lib/ffi/autopointer.rb +111 -52
  506. data/lib/ffi/compat.rb +43 -0
  507. data/lib/ffi/data_converter.rb +67 -0
  508. data/lib/ffi/dynamic_library.rb +118 -0
  509. data/lib/ffi/enum.rb +203 -22
  510. data/lib/ffi/errno.rb +27 -12
  511. data/lib/ffi/ffi.rb +88 -11
  512. data/lib/ffi/function.rb +71 -0
  513. data/lib/ffi/io.rb +35 -14
  514. data/lib/ffi/library.rb +382 -96
  515. data/lib/ffi/library_path.rb +109 -0
  516. data/lib/ffi/managedstruct.rb +64 -35
  517. data/lib/ffi/memorypointer.rb +1 -33
  518. data/lib/ffi/platform/aarch64-darwin/types.conf +130 -0
  519. data/lib/ffi/platform/aarch64-freebsd/types.conf +128 -0
  520. data/lib/ffi/platform/aarch64-freebsd12/types.conf +181 -0
  521. data/lib/ffi/platform/aarch64-linux/types.conf +175 -0
  522. data/lib/ffi/platform/aarch64-openbsd/types.conf +134 -0
  523. data/lib/ffi/platform/aarch64-windows/types.conf +52 -0
  524. data/lib/ffi/platform/arm-freebsd/types.conf +152 -0
  525. data/lib/ffi/platform/arm-freebsd12/types.conf +152 -0
  526. data/lib/ffi/platform/arm-linux/types.conf +132 -0
  527. data/lib/ffi/platform/hppa1.1-linux/types.conf +178 -0
  528. data/lib/ffi/platform/hppa2.0-linux/types.conf +178 -0
  529. data/lib/ffi/platform/i386-cygwin/types.conf +3 -0
  530. data/lib/ffi/platform/i386-darwin/types.conf +100 -0
  531. data/lib/ffi/platform/i386-freebsd/types.conf +152 -0
  532. data/lib/ffi/platform/i386-freebsd12/types.conf +152 -0
  533. data/lib/ffi/platform/i386-gnu/types.conf +107 -0
  534. data/lib/ffi/platform/i386-linux/types.conf +103 -0
  535. data/lib/ffi/platform/i386-netbsd/types.conf +126 -0
  536. data/lib/ffi/platform/i386-openbsd/types.conf +128 -0
  537. data/lib/ffi/platform/i386-solaris/types.conf +122 -0
  538. data/lib/ffi/platform/i386-windows/types.conf +52 -0
  539. data/lib/ffi/platform/ia64-linux/types.conf +104 -0
  540. data/lib/ffi/platform/loongarch64-linux/types.conf +141 -0
  541. data/lib/ffi/platform/mips-linux/types.conf +102 -0
  542. data/lib/ffi/platform/mips64-linux/types.conf +104 -0
  543. data/lib/ffi/platform/mips64el-linux/types.conf +104 -0
  544. data/lib/ffi/platform/mipsel-linux/types.conf +102 -0
  545. data/lib/ffi/platform/mipsisa32r6-linux/types.conf +102 -0
  546. data/lib/ffi/platform/mipsisa32r6el-linux/types.conf +102 -0
  547. data/lib/ffi/platform/mipsisa64r6-linux/types.conf +104 -0
  548. data/lib/ffi/platform/mipsisa64r6el-linux/types.conf +104 -0
  549. data/lib/ffi/platform/powerpc-aix/types.conf +180 -0
  550. data/lib/ffi/platform/powerpc-darwin/types.conf +100 -0
  551. data/lib/ffi/platform/powerpc-linux/types.conf +130 -0
  552. data/lib/ffi/platform/powerpc-openbsd/types.conf +156 -0
  553. data/lib/ffi/platform/powerpc64-linux/types.conf +104 -0
  554. data/lib/ffi/platform/powerpc64le-linux/types.conf +100 -0
  555. data/lib/ffi/platform/riscv64-linux/types.conf +104 -0
  556. data/lib/ffi/platform/s390-linux/types.conf +102 -0
  557. data/lib/ffi/platform/s390x-linux/types.conf +102 -0
  558. data/lib/ffi/platform/sparc-linux/types.conf +102 -0
  559. data/lib/ffi/platform/sparc-solaris/types.conf +128 -0
  560. data/lib/ffi/platform/sparcv9-linux/types.conf +102 -0
  561. data/lib/ffi/platform/sparcv9-openbsd/types.conf +156 -0
  562. data/lib/ffi/platform/sparcv9-solaris/types.conf +128 -0
  563. data/lib/ffi/platform/sw_64-linux/types.conf +141 -0
  564. data/lib/ffi/platform/x86_64-cygwin/types.conf +3 -0
  565. data/lib/ffi/platform/x86_64-darwin/types.conf +130 -0
  566. data/lib/ffi/platform/x86_64-dragonflybsd/types.conf +130 -0
  567. data/lib/ffi/platform/x86_64-freebsd/types.conf +128 -0
  568. data/lib/ffi/platform/x86_64-freebsd12/types.conf +158 -0
  569. data/lib/ffi/platform/x86_64-haiku/types.conf +117 -0
  570. data/lib/ffi/platform/x86_64-linux/types.conf +132 -0
  571. data/lib/ffi/platform/x86_64-msys/types.conf +119 -0
  572. data/lib/ffi/platform/x86_64-netbsd/types.conf +128 -0
  573. data/lib/ffi/platform/x86_64-openbsd/types.conf +134 -0
  574. data/lib/ffi/platform/x86_64-solaris/types.conf +122 -0
  575. data/lib/ffi/platform/x86_64-windows/types.conf +52 -0
  576. data/lib/ffi/platform.rb +110 -34
  577. data/lib/ffi/pointer.rb +117 -90
  578. data/lib/ffi/struct.rb +101 -70
  579. data/lib/ffi/struct_by_reference.rb +72 -0
  580. data/lib/ffi/struct_layout.rb +96 -0
  581. data/lib/ffi/struct_layout_builder.rb +90 -21
  582. data/lib/ffi/tools/const_generator.rb +86 -31
  583. data/lib/ffi/tools/generator.rb +49 -2
  584. data/lib/ffi/tools/generator_task.rb +13 -16
  585. data/lib/ffi/tools/struct_generator.rb +6 -5
  586. data/lib/ffi/tools/types_generator.rb +25 -11
  587. data/lib/ffi/types.rb +105 -36
  588. data/lib/ffi/union.rb +23 -12
  589. data/lib/ffi/variadic.rb +44 -29
  590. data/lib/ffi/version.rb +3 -0
  591. data/lib/ffi.rb +25 -9
  592. data/rakelib/ffi_gem_helper.rb +65 -0
  593. data/samples/getlogin.rb +8 -0
  594. data/samples/getpid.rb +8 -0
  595. data/samples/gettimeofday.rb +18 -0
  596. data/samples/hello.rb +8 -0
  597. data/samples/hello_ractor.rb +11 -0
  598. data/samples/inotify.rb +60 -0
  599. data/samples/pty.rb +75 -0
  600. data/samples/qsort.rb +20 -0
  601. data/samples/qsort_ractor.rb +28 -0
  602. data/sig/ffi/abstract_memory.rbs +165 -0
  603. data/sig/ffi/auto_pointer.rbs +26 -0
  604. data/sig/ffi/buffer.rbs +18 -0
  605. data/sig/ffi/data_converter.rbs +10 -0
  606. data/sig/ffi/dynamic_library.rbs +9 -0
  607. data/sig/ffi/enum.rbs +38 -0
  608. data/sig/ffi/function.rbs +39 -0
  609. data/sig/ffi/library.rbs +42 -0
  610. data/sig/ffi/native_type.rbs +86 -0
  611. data/sig/ffi/pointer.rbs +42 -0
  612. data/sig/ffi/struct.rbs +76 -0
  613. data/sig/ffi/struct_by_reference.rbs +11 -0
  614. data/sig/ffi/struct_by_value.rbs +7 -0
  615. data/sig/ffi/struct_layout.rbs +9 -0
  616. data/sig/ffi/struct_layout_builder.rbs +5 -0
  617. data/sig/ffi/type.rbs +39 -0
  618. data/sig/ffi.rbs +26 -0
  619. data.tar.gz.sig +0 -0
  620. metadata +547 -248
  621. metadata.gz.sig +0 -0
  622. data/History.txt +0 -109
  623. data/README.rdoc +0 -70
  624. data/ext/ffi_c/DataConverter.c +0 -62
  625. data/ext/ffi_c/StructByReference.c +0 -150
  626. data/ext/ffi_c/StructByReference.h +0 -50
  627. data/ext/ffi_c/libffi/ChangeLog.libffi +0 -658
  628. data/ext/ffi_c/libffi/ChangeLog.libgcj +0 -40
  629. data/ext/ffi_c/libffi/ChangeLog.v1 +0 -764
  630. data/ext/ffi_c/libffi/README +0 -306
  631. data/ext/ffi_c/libffi/aclocal.m4 +0 -8998
  632. data/ext/ffi_c/libffi/depcomp +0 -584
  633. data/ext/ffi_c/libffi/doc/libffi.info +0 -533
  634. data/ext/ffi_c/libffi/doc/stamp-vti +0 -4
  635. data/ext/ffi_c/libffi/m4/libtool.m4 +0 -7360
  636. data/ext/ffi_c/libffi/m4/ltoptions.m4 +0 -368
  637. data/ext/ffi_c/libffi/m4/ltsugar.m4 +0 -123
  638. data/ext/ffi_c/libffi/m4/ltversion.m4 +0 -23
  639. data/ext/ffi_c/libffi/m4/lt~obsolete.m4 +0 -92
  640. data/ext/ffi_c/libffi/mdate-sh +0 -201
  641. data/ext/ffi_c/libffi/src/x86/darwin.S +0 -444
  642. data/ext/ffi_c/libffi/src/x86/darwin64.S +0 -416
  643. data/ext/ffi_c/libffi/src/x86/freebsd.S +0 -458
  644. data/ext/ffi_c/libffi/src/x86/win32.S +0 -877
  645. data/ext/ffi_c/libffi/testsuite/lib/libffi-dg.exp +0 -300
  646. data/ext/ffi_c/libffi/testsuite/libffi.call/many_win32.c +0 -63
  647. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen_win32.c +0 -44
  648. data/ext/ffi_c/libffi/testsuite/libffi.special/ffitestcxx.h +0 -96
  649. data/ext/ffi_c/libffi/texinfo.tex +0 -7210
  650. data/gen/Rakefile +0 -14
  651. data/spec/ffi/async_callback_spec.rb +0 -23
  652. data/spec/ffi/bool_spec.rb +0 -24
  653. data/spec/ffi/buffer_spec.rb +0 -202
  654. data/spec/ffi/callback_spec.rb +0 -653
  655. data/spec/ffi/custom_param_type.rb +0 -31
  656. data/spec/ffi/custom_type_spec.rb +0 -73
  657. data/spec/ffi/enum_spec.rb +0 -183
  658. data/spec/ffi/errno_spec.rb +0 -13
  659. data/spec/ffi/ffi_spec.rb +0 -24
  660. data/spec/ffi/function_spec.rb +0 -73
  661. data/spec/ffi/library_spec.rb +0 -174
  662. data/spec/ffi/managed_struct_spec.rb +0 -56
  663. data/spec/ffi/number_spec.rb +0 -231
  664. data/spec/ffi/pointer_spec.rb +0 -210
  665. data/spec/ffi/rbx/attach_function_spec.rb +0 -28
  666. data/spec/ffi/rbx/memory_pointer_spec.rb +0 -109
  667. data/spec/ffi/rbx/spec_helper.rb +0 -1
  668. data/spec/ffi/rbx/struct_spec.rb +0 -13
  669. data/spec/ffi/spec_helper.rb +0 -21
  670. data/spec/ffi/string_spec.rb +0 -103
  671. data/spec/ffi/strptr_spec.rb +0 -36
  672. data/spec/ffi/struct_callback_spec.rb +0 -64
  673. data/spec/ffi/struct_initialize_spec.rb +0 -30
  674. data/spec/ffi/struct_packed_spec.rb +0 -46
  675. data/spec/ffi/struct_spec.rb +0 -638
  676. data/spec/ffi/typedef_spec.rb +0 -62
  677. data/spec/ffi/union_spec.rb +0 -60
  678. data/spec/ffi/variadic_spec.rb +0 -84
  679. data/spec/spec.opts +0 -4
  680. data/tasks/ann.rake +0 -80
  681. data/tasks/extension.rake +0 -25
  682. data/tasks/gem.rake +0 -200
  683. data/tasks/git.rake +0 -41
  684. data/tasks/notes.rake +0 -27
  685. data/tasks/post_load.rake +0 -34
  686. data/tasks/rdoc.rake +0 -50
  687. data/tasks/rubyforge.rake +0 -55
  688. data/tasks/setup.rb +0 -301
  689. data/tasks/spec.rake +0 -54
  690. data/tasks/svn.rake +0 -47
  691. data/tasks/test.rake +0 -40
  692. /data/ext/ffi_c/libffi/testsuite/libffi.call/{pyobjc-tc.c → pyobjc_tc.c} +0 -0
  693. /data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_double.c +0 -0
  694. /data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/problem1.c +0 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 3a6a87ee152caf4030d9a90bedcefece7f4717639dc96443727b1e1c492db617
4
+ data.tar.gz: 722b6e07fb23b25c2ad2c2e426040e2fb3f929e6dda3c00c26ac7fbc7c7820aa
5
+ SHA512:
6
+ metadata.gz: a4b65f1f9f9852a7d74c0739eb940f487a85354466b998caf4e637b20046c91a4338c389992de8d42118536624db2bbab4b4de799477af3591701e823355a69c
7
+ data.tar.gz: 6877266da6f47d6d921b8535ee63737caefeb89a937489a1c4756273b87bdcfec93f13e5c9a4dd7c7c56a680d0b1822aecf0197b9b92f778778732cf9fa6556e
checksums.yaml.gz.sig ADDED
@@ -0,0 +1,4 @@
1
+ n�ա'�����Ŗ�e�<^l���ß ��Ո��|7�?&�����K���"�� �Q��y��6��Mܕ^E3W��ybS�
2
+
3
+ � n�Q�r��U�\����c�!1L��4��|��Mw�XD�J���wm�k��+:ÇLJyl�ώ`���P4��‹U[�n��V�ˬ*�QӔ�[����h�>��"�LS��Q`dL�y�b-r�j[61T�UKlB���y����~U�M)��I�B����;_8N�PM�7h�<X$��Ɵ=��ɇ_�� ݲt�^�\�EH-��B�y�AY2S���@���@?�뗺Ey�u��g��W����j�Z�<}������g� r lj�A���dA ,9����N�
4
+ GG�۔ �
data/CHANGELOG.md ADDED
@@ -0,0 +1,465 @@
1
+ 1.17.1 / 2024-12-30
2
+ -------------------
3
+
4
+ Fixed:
5
+ * #1117 Restart async callback dispatcher thread after fork.
6
+ * #1133 Add ruby-3.4 native gem.
7
+ * #1134 Fix FFI::DataConverter non-generic usage in RBS files.
8
+
9
+
10
+ 1.17.0 / 2024-06-02
11
+ -------------------
12
+
13
+ Fixed:
14
+ * Add FFI::AbstractMemory#read_array_of_string . It was defined but not exposed to Ruby nor tested. #1070
15
+
16
+
17
+ 1.17.0.rc2 / 2024-04-22
18
+ -------------------
19
+
20
+ Fixed:
21
+ * Add missing write barriers to StructLayout#initialize causing a segfault with GC.stress. #1079
22
+
23
+
24
+ 1.17.0.rc1 / 2024-04-08
25
+ -------------------
26
+
27
+ Fixed:
28
+ * Fix type definitions on `aarch64-linux`. #1067, #1066
29
+ * Use RB_TEST for `Pointer.autorelease=` . #1065
30
+ So that `false` and `nil` are treated as falsey and anything else as truthy.
31
+ * Replace Fixnum by Integer. #1064
32
+ Fixnum is no longer present in the ruby language.
33
+ * Update `FFI::NativeType` doc. #1061
34
+ * Store FFI::Type::Mapped of FFI::StrPtrConverter in global instead of custom type map
35
+ * Various documentation fixes. #1042
36
+ * Update `FFI::Pointer#==` to return `false` if a pointer is compared to a non-pointer object, which is the expected behavior. #1083
37
+ * Avoid warning about undefined wariable `@ffi_functions` #1085
38
+ * Fix a very unlikely GC bug when using a callback block. # 1089
39
+
40
+ Added:
41
+ * Provide binary gems for many platforms. #990
42
+ * Add Windows fat binary gem for Ruby-3.3
43
+ * Add RBS type definitions for many user facing parts of the FFI API. #1042
44
+ * Improve fallback search path logic. #1088
45
+ Respect LD_LIBRARY_PATH and DYLD_LIBRARY_PATH on Macos.
46
+ * Update libffi to current git master branch.
47
+
48
+ Removed:
49
+ * Remove `enum CHAR_ARRAY` which is no longer used. #1063
50
+
51
+
52
+ 1.16.3 / 2023-10-04
53
+ -------------------
54
+
55
+ Fixed:
56
+ * Fix gcc error when building on CentOS 7. #1052
57
+ * Avoid trying to store new DataConverter type in frozen TypeDefs hash. #1057
58
+
59
+
60
+ 1.16.2 / 2023-09-25
61
+ -------------------
62
+
63
+ Fixed:
64
+ * Handle null pointer crash after fork. #1051
65
+
66
+
67
+ 1.16.1 / 2023-09-24
68
+ -------------------
69
+
70
+ Fixed:
71
+ * Fix compiling the builtin libffi. #1049
72
+
73
+
74
+ 1.16.0 / 2023-09-23
75
+ -------------------
76
+
77
+ Fixed:
78
+ * Fix an issue with signed bitmasks when using flags on the most significant bit. #949
79
+ * Fix FFI::Pointer#initialize using NUM2LL instead of NUM2ULL.
80
+ * Fix FFI::Type#inspect to properly display the constant name. #1002
81
+ * Use libffi closure allocations on hppa-Linux. #1017
82
+ Previously they would segfault.
83
+ * Fix class name of Symbol#inspect.
84
+ * Fix MSVC support of libtest. #1028
85
+ * Fix attach_function of functions ending in ? or ! #971
86
+
87
+ Added:
88
+ * Convert all C-based classes to TypedData and use write barriers. #994, #995, #996, #997, #998, #999, #1000, #1001, #1003, #1004, #1005, #1006, #1007, #1008, #1009, #1010, #1011, #1012
89
+ This results in less pressure on the garbage collector, since the objects can be promoted to the old generation, which means they only get marked on major GC.
90
+ * Implement `ObjectSpace.memsize_of()` of all C-based classes.
91
+ * Make FFI Ractor compatible. #1023
92
+ Modules extended per `extend FFI::Library` need to be frozen in order to be used by non-main Ractors.
93
+ This can be done by calling `freeze` below of all C interface definitions.
94
+ * In a Ractor it's possible to:
95
+ * load DLLs and call its functions, access its global variables
96
+ * use builtin typedefs
97
+ * use and modify ractor local typedefs
98
+ * define callbacks
99
+ * receive async callbacks from non-ruby threads
100
+ * use frozen FFI::Library based modules with all attributes (enums, structs, typedefs, functions, callbacks)
101
+ * invoke frozen functions and callbacks defined in the main Ractor
102
+ * use FFI::Struct definitions from the main Ractor
103
+ * In a Ractor it's impossible to:
104
+ * create new FFI::Library based modules
105
+ * create new FFI::Struct definitions
106
+ * use custom global typedefs
107
+ * use non-frozen FFI::Library based modules
108
+ * Allow type retrieval of attached functions+variables. #1023
109
+ * Make FFI classes `GC.compact` friendly. #1021
110
+ * Update libffi and disable custom trampoline when using libffi closure allocation. #1020
111
+ This is because libffi changed the way how closures are allocated to static trampolines.
112
+ * Add types.conf for loongarch64-linux. #943
113
+ * Add types.conf for sw_64-linux (Shen Wei 64-bit, based on Alpha). #1018
114
+ * Add support for aarch64-windows. #1035
115
+ * Windows: Update LoadLibrary error message to include error code. #1026
116
+ * Allow private release method for FFI::ManagedStruct and FFI::AutoPointer. #1029
117
+ * Add support for passing ABI version to FFI.map_library_name. #963
118
+ This adds the new class FFI::LibraryPath .
119
+ * Add support for ruby-3.2 to windows binary gem. #1047
120
+ * Enable debug symbols for `rake compile` builds to ease debugging. #1048
121
+
122
+ Removed:
123
+ * Remove allocator of AbstractMemory. #1013
124
+ This disables AbstractMemory.new, which has no practical use.
125
+ * Remove unused FFI::SizeTypes. #1022
126
+
127
+
128
+ 1.15.5 / 2022-01-10
129
+ -------------------
130
+
131
+ Fixed:
132
+ * Fix long double argument or return values on 32bit i686. #849
133
+ * FFI::ConstGenerator: avoid usage of the same binary file simultaneously. #929
134
+
135
+ Added:
136
+ * Add Windows fat binary gem for Ruby-3.1
137
+
138
+ Removed:
139
+ * Remove Windows fat binary gem for Ruby < 2.4
140
+
141
+
142
+ 1.15.4 / 2021-09-01
143
+ -------------------
144
+
145
+ Fixed:
146
+ * Fix build for uClibc. #913
147
+ * Correct module lookup when including `ffi-module` gem. #912
148
+
149
+ Changed:
150
+ * Use ruby code of the ffi gem in JRuby-9.2.20+. #915
151
+
152
+
153
+ 1.15.3 / 2021-06-16
154
+ -------------------
155
+
156
+ Fixed:
157
+ * Fix temporary packaging issue with libffi. #904
158
+
159
+
160
+ 1.15.2 / 2021-06-16
161
+ -------------------
162
+
163
+ Added:
164
+ * Add support for Windows MINGW-UCRT build. #903
165
+ * Add `/opt/homebrew/lib/` to fallback search paths to improve homebrew support. #880 #882
166
+
167
+ Changed:
168
+ * Regenerate `types.conf` for FreeBSD12 aarch64. #902
169
+
170
+
171
+ 1.15.1 / 2021-05-22
172
+ -------------------
173
+
174
+ Fixed:
175
+ * Append -pthread to linker options. #893
176
+ * Use arm or aarch64 to identify Apple ARM CPU arch. #899
177
+ * Allow overriding `gcc` with the `CC` env var in `const_generator.rb` and `struct_generator.rb`. #897
178
+
179
+
180
+ 1.15.0 / 2021-03-05
181
+ -------------------
182
+
183
+ Fixed:
184
+ * Fix MSVC build
185
+ * Fix async callbacks in conjunction with fork(). #884
186
+
187
+ Added:
188
+ * Allow to pass callbacks in varargs. #885
189
+ * Name the threads for FFI callback dispatcher and async thread calls for easier debugging. #883
190
+ The name can be retrieved by Thread.name and is shown by Thread.list.inspect etc.
191
+ Even gdb shows the thread name on supported operating systems.
192
+ * Add types.conf for powerpc64le-linux
193
+ * Add types.conf for riscv64-linux
194
+ * More release automation of ffi gems
195
+
196
+ Changed:
197
+ * Switch from rubygems-tasks to bundler/gem_helper
198
+
199
+ Removed:
200
+ * Remove unused VariadicInvoker#init
201
+
202
+
203
+ 1.14.2 / 2020-12-21
204
+ -------------------
205
+
206
+ Fixed:
207
+ * Fix builtin libffi on newer Ubuntu caused by an outdated Makefile.in . #863
208
+
209
+
210
+ 1.14.1 / 2020-12-19
211
+ -------------------
212
+
213
+ Changed:
214
+ * Revert changes to FFI::Pointer#write_string made in ffi-1.14.0.
215
+ It breaks compatibilty in a way that can cause hard to find errors. #857
216
+
217
+
218
+ 1.14.0 / 2020-12-18
219
+ -------------------
220
+
221
+ Added:
222
+ * Add types.conf for x86_64-msys, x86_64-haiku, aarch64-openbsd and aarch64-darwin (alias arm64-darwin)
223
+ * Add method AbstractMemory#size_limit? . #829
224
+ * Add new extconf option --enable-libffi-alloc which is enabled per default on Apple M1 (arm64-darwin).
225
+
226
+ Changed:
227
+ * Do NULL pointer check only when array length > 0 . #305
228
+ * Raise an error on an unknown order argument. #830
229
+ * Change FFI::Pointer#write_string to terminate with a NUL byte like other string methods. #805
230
+ * Update bundled libffi to latest master.
231
+
232
+ Removed:
233
+ * Remove win32/stdint.h and stdbool.h because of copyright issue. #693
234
+
235
+ Fixed:
236
+ * Fix possible UTF-8 load error in loader script interpretation. #792
237
+ * Fix segfault on non-array argument to #write_array_of_*
238
+ * Fix memory leak in MethodHandle . #815
239
+ * Fix possible segfault in combination with fiddle or other libffi using gems . #835
240
+ * Fix possibility to use ffi ruby gem with JRuby-9.3 . #763
241
+ * Fix a GC issue, when a callback Proc is used on more than 2 callback signatures. #820
242
+
243
+
244
+ 1.13.1 / 2020-06-09
245
+ -------------------
246
+
247
+ Changed:
248
+ * Revert use of `ucrtbase.dll` as default C library on Windows-MINGW.
249
+ `ucrtbase.dll` is still used on MSWIN target. #790
250
+ * Test for `ffi_prep_closure_loc()` to make sure we can use this function.
251
+ This fixes incorrect use of system libffi on MacOS Mojave (10.14). #787
252
+ * Update types.conf on x86_64-dragonflybsd
253
+
254
+
255
+ 1.13.0 / 2020-06-01
256
+ -------------------
257
+
258
+ Added:
259
+ * Add TruffleRuby support. Almost all specs are running on TruffleRuby and succeed. #768
260
+ * Add ruby source files to the java gem. This allows to ship the Ruby library code per platform java gem and add it as a default gem to JRuby. #763
261
+ * Add FFI::Platform::LONG_DOUBLE_SIZE
262
+ * Add bounds checks for writing to an inline char[] . #756
263
+ * Add long double as callback return value. #771
264
+ * Update type definitions and add types from stdint.h and stddef.h on i386-windows, x86_64-windows, x86_64-darwin, x86_64-linux, arm-linux, powerpc-linux. #749
265
+ * Add new type definitions for powerpc-openbsd and sparcv9-openbsd. #775, #778
266
+
267
+ Changed:
268
+ * Raise required ruby version to >= 2.3.
269
+ * Lots of cleanups and improvements in library, specs and benchmarks.
270
+ * Fix a lot of compiler warnings at the C-extension
271
+ * Fix several install issues on MacOS:
272
+ * Look for libffi in SDK paths, since recent versions of macOS removed it from `/usr/include` . #757
273
+ * Fix error `ld: library not found for -lgcc_s.10.4`
274
+ * Don't built for i386 architecture as it is deprecated
275
+ * Several fixes for MSVC build on Windows. #779
276
+ * Use `ucrtbase.dll` as default C library on Windows instead of old `msvcrt.dll`. #779
277
+ * Update builtin libffi to fix a Powerpc issue with parameters of type long
278
+ * Allow unmodified sourcing of (the ruby code of) this gem in JRuby and TruffleRuby as a default gem. #747
279
+ * Improve check to detect if a module has a #find_type method suitable for FFI. This fixes compatibility with stdlib `mkmf` . #776
280
+
281
+ Removed:
282
+ * Reject callback with `:string` return type at definition, because it didn't work so far and is not save to use. #751, #782
283
+
284
+
285
+ 1.12.2 / 2020-02-01
286
+ -------------------
287
+
288
+ * Fix possible segfault at FFI::Struct#[] and []= after GC.compact . #742
289
+
290
+
291
+ 1.12.1 / 2020-01-14
292
+ -------------------
293
+
294
+ Added:
295
+ * Add binary gem support for ruby-2.7 on Windows
296
+
297
+
298
+ 1.12.0 / 2020-01-14
299
+ -------------------
300
+
301
+ Added:
302
+ * FFI::VERSION is defined as part of `require 'ffi'` now.
303
+ It is no longer necessary to `require 'ffi/version'` .
304
+
305
+ Changed:
306
+ * Update libffi to latest master.
307
+
308
+ Deprecated:
309
+ * Overwriting struct layouts is now warned and will be disallowed in ffi-2.0. #734, #735
310
+
311
+
312
+ 1.11.3 / 2019-11-25
313
+ -------------------
314
+
315
+ Removed:
316
+ * Remove support for tainted objects which cause deprecation warnings in ruby-2.7. #730
317
+
318
+
319
+ 1.11.2 / 2019-11-11
320
+ -------------------
321
+
322
+ Added:
323
+ * Add DragonFlyBSD as a platform. #724
324
+
325
+ Changed:
326
+ * Sort all types.conf files, so that files and changes are easier to compare.
327
+ * Regenerated type conf for freebsd12 and x86_64-linux targets. #722
328
+ * Remove MACOSX_DEPLOYMENT_TARGET that was targeting very old version 10.4. #647
329
+ * Fix library name mangling for non glibc Linux/UNIX. #727
330
+ * Fix compiler warnings raised by ruby-2.7
331
+ * Update libffi to latest master.
332
+
333
+
334
+ 1.11.1 / 2019-05-20
335
+ -------------------
336
+
337
+ Changed:
338
+ * Raise required ruby version to >=2.0. #699, #700
339
+ * Fix a possible linker error on ruby < 2.3 on Linux.
340
+
341
+
342
+ 1.11.0 / 2019-05-17
343
+ -------------------
344
+ This version was yanked on 2019-05-20 to fix an install issue on ruby-1.9.3. #700
345
+
346
+ Added:
347
+ * Add ability to disable or force use of system libffi. #669
348
+ Use like `gem inst ffi -- --enable-system-libffi` .
349
+ * Add ability to call FFI callbacks from outside of FFI call frame. #584
350
+ * Add proper documentation to FFI::Generator and ::Task
351
+ * Add gemspec metadata. #696, #698
352
+
353
+ Changed:
354
+ * Fix stdcall on Win32. #649, #669
355
+ * Fix load paths for FFI::Generator::Task
356
+ * Fix FFI::Pointer#read_string(0) to return a binary String. #692
357
+ * Fix benchmark suite so that it runs on ruby-2.x
358
+ * Move FFI::Platform::CPU from C to Ruby. #663
359
+ * Move FFI::StructByReference to Ruby. #681
360
+ * Move FFI::DataConverter to Ruby (#661)
361
+ * Various cleanups and improvements of specs and benchmarks
362
+
363
+ Removed:
364
+ * Remove ruby-1.8 and 1.9 compatibility code. #683
365
+ * Remove unused spec files. #684
366
+
367
+
368
+ 1.10.0 / 2019-01-06
369
+ -------------------
370
+
371
+ Added:
372
+ * Add /opt/local/lib/ to ffi's fallback library search path. #638
373
+ * Add binary gem support for ruby-2.6 on Windows
374
+ * Add FreeBSD on AArch64 and ARM support. #644
375
+ * Add FFI::LastError.winapi_error on Windows native or Cygwin. #633
376
+
377
+ Changed:
378
+ * Update to rake-compiler-dock-0.7.0
379
+ * Use 64-bit inodes on FreeBSD >= 12. #644
380
+ * Switch time_t and suseconds_t types to long on FreeBSD. #627
381
+ * Make register_t long_long on 64-bit FreeBSD. #644
382
+ * Fix Pointer#write_array_of_type #637
383
+
384
+ Removed:
385
+ * Drop binary gem support for ruby-2.0 and 2.1 on Windows
386
+
387
+
388
+ 1.9.25 / 2018-06-03
389
+ -------------------
390
+
391
+ Changed:
392
+ * Revert closures via libffi.
393
+ This re-adds ClosurePool and fixes compat with SELinux enabled systems. #621
394
+
395
+
396
+ 1.9.24 / 2018-06-02
397
+ -------------------
398
+
399
+ Security Note:
400
+
401
+ This update addresses vulnerability CVE-2018-1000201: DLL loading issue which can be hijacked on Windows OS, when a Symbol is used as DLL name instead of a String. Found by Matthew Bush.
402
+
403
+ Added:
404
+ * Added a CHANGELOG file
405
+ * Add mips64(eb) support, and mips r6 support. (#601)
406
+
407
+ Changed:
408
+ * Update libffi to latest changes on master.
409
+ * Don't search in hardcoded /usr paths on Windows.
410
+ * Don't treat Symbol args different to Strings in ffi_lib.
411
+ * Make sure size_t is defined in Thread.c. Fixes #609
412
+
413
+
414
+ 1.9.23 / 2018-02-25
415
+ -------------------
416
+
417
+ Changed:
418
+ * Fix unnecessary rebuild of configure in darwin multi arch. Fixes #605
419
+
420
+
421
+ 1.9.22 / 2018-02-22
422
+ -------------------
423
+
424
+ Changed:
425
+ * Update libffi to latest changes on master.
426
+ * Update detection of system libffi to match new requirements. Fixes #617
427
+ * Prefer bundled libffi over system libffi on Mac OS.
428
+ * Do closures via libffi. This removes ClosurePool and fixes compat with PaX. #540
429
+ * Use a more deterministic gem packaging.
430
+ * Fix unnecessary update of autoconf files at gem install.
431
+
432
+
433
+ 1.9.21 / 2018-02-06
434
+ -------------------
435
+
436
+ Added:
437
+ * Ruby-2.5 support by Windows binary gems. Fixes #598
438
+ * Add missing win64 types.
439
+ * Added support for Bitmask. (#573)
440
+ * Add support for MSYS2 (#572) and Sparc64 Linux. (#574)
441
+
442
+ Changed:
443
+ * Fix read_string to not throw an error on length 0.
444
+ * Don't use absolute paths for sh and env. Fixes usage on Adroid #528
445
+ * Use Ruby implementation for `which` for better compat with Windows. Fixes #315
446
+ * Fix compatibility with PPC64LE platform. (#577)
447
+ * Normalize sparc64 to sparcv9. (#575)
448
+
449
+ Removed:
450
+ * Drop Ruby 1.8.7 support (#480)
451
+
452
+
453
+ 1.9.18 / 2017-03-03
454
+ -------------------
455
+
456
+ Added:
457
+ * Add compatibility with Ruby-2.4.
458
+
459
+ Changed:
460
+ * Add missing shlwapi.h include to fix Windows build.
461
+ * Avoid undefined behaviour of LoadLibrary() on Windows. #553
462
+
463
+
464
+ 1.9.17 / 2017-01-13
465
+ -------------------
data/COPYING ADDED
@@ -0,0 +1,49 @@
1
+ Copyright (c) 2008-2013, Ruby FFI project contributors
2
+ All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without
5
+ modification, are permitted provided that the following conditions are met:
6
+ * Redistributions of source code must retain the above copyright
7
+ notice, this list of conditions and the following disclaimer.
8
+ * Redistributions in binary form must reproduce the above copyright
9
+ notice, this list of conditions and the following disclaimer in the
10
+ documentation and/or other materials provided with the distribution.
11
+ * Neither the name of the Ruby FFI project nor the
12
+ names of its contributors may be used to endorse or promote products
13
+ derived from this software without specific prior written permission.
14
+
15
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18
+ DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
19
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25
+
26
+ libffi, used by this project, is licensed under the MIT license:
27
+
28
+ libffi - Copyright (c) 1996-2011 Anthony Green, Red Hat, Inc and others.
29
+ See source files for details.
30
+
31
+ Permission is hereby granted, free of charge, to any person obtaining
32
+ a copy of this software and associated documentation files (the
33
+ ``Software''), to deal in the Software without restriction, including
34
+ without limitation the rights to use, copy, modify, merge, publish,
35
+ distribute, sublicense, and/or sell copies of the Software, and to
36
+ permit persons to whom the Software is furnished to do so, subject to
37
+ the following conditions:
38
+
39
+ The above copyright notice and this permission notice shall be
40
+ included in all copies or substantial portions of the Software.
41
+
42
+ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
43
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
44
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
45
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
46
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
47
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
48
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
49
+
data/Gemfile ADDED
@@ -0,0 +1,21 @@
1
+ source 'https://rubygems.org'
2
+
3
+ group :development do
4
+ gem 'bigdecimal' # necessary on ruby-3.3+
5
+ gem 'bundler', '>= 1.16', '< 3'
6
+ gem 'rake', '~> 13.0'
7
+ gem 'rake-compiler', '~> 1.1'
8
+ gem 'rake-compiler-dock', '~> 1.7.0'
9
+ gem 'rspec', '~> 3.0'
10
+ end
11
+
12
+ group :doc do
13
+ gem 'kramdown'
14
+ gem 'yard', '~> 0.9'
15
+ end
16
+
17
+ group :type_check do
18
+ if RUBY_VERSION >= "2.6" && %w[ ruby truffleruby ].include?(RUBY_ENGINE)
19
+ gem 'rbs', '~> 3.0'
20
+ end
21
+ end
data/LICENSE CHANGED
@@ -1,14 +1,24 @@
1
- Copyright (c) 2008-2010 Ruby-FFI contributors
1
+ Copyright (c) 2008-2016, Ruby FFI project contributors
2
2
  All rights reserved.
3
3
 
4
- This code is free software: you can redistribute it and/or modify it under
5
- the terms of the GNU Lesser General Public License version 3 only, as
6
- published by the Free Software Foundation.
4
+ Redistribution and use in source and binary forms, with or without
5
+ modification, are permitted provided that the following conditions are met:
6
+ * Redistributions of source code must retain the above copyright
7
+ notice, this list of conditions and the following disclaimer.
8
+ * Redistributions in binary form must reproduce the above copyright
9
+ notice, this list of conditions and the following disclaimer in the
10
+ documentation and/or other materials provided with the distribution.
11
+ * Neither the name of the Ruby FFI project nor the
12
+ names of its contributors may be used to endorse or promote products
13
+ derived from this software without specific prior written permission.
7
14
 
8
- This code is distributed in the hope that it will be useful, but WITHOUT
9
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
11
- version 3 for more details.
12
-
13
- You should have received a copy of the GNU Lesser General Public License
14
- version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
15
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18
+ DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
19
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
data/LICENSE.SPECS ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2008-2012 Ruby-FFI contributors
2
+
3
+ Permission is hereby granted, free of charge, to any person
4
+ obtaining a copy of this software and associated documentation
5
+ files (the "Software"), to deal in the Software without
6
+ restriction, including without limitation the rights to use,
7
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the
9
+ Software is furnished to do so, subject to the following
10
+ conditions:
11
+
12
+ The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
+ OTHER DEALINGS IN THE SOFTWARE.