ffi 1.10.0 → 1.14.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (332) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +165 -0
  3. data/Gemfile +6 -4
  4. data/README.md +38 -18
  5. data/Rakefile +36 -120
  6. data/ext/ffi_c/AbstractMemory.c +29 -34
  7. data/ext/ffi_c/Buffer.c +4 -9
  8. data/ext/ffi_c/Call.c +16 -48
  9. data/ext/ffi_c/Call.h +4 -7
  10. data/ext/ffi_c/ClosurePool.c +75 -25
  11. data/ext/ffi_c/ClosurePool.h +3 -1
  12. data/ext/ffi_c/DynamicLibrary.c +2 -7
  13. data/ext/ffi_c/Function.c +25 -129
  14. data/ext/ffi_c/FunctionInfo.c +3 -8
  15. data/ext/ffi_c/LastError.c +2 -6
  16. data/ext/ffi_c/LongDouble.c +12 -10
  17. data/ext/ffi_c/LongDouble.h +0 -4
  18. data/ext/ffi_c/MemoryPointer.c +3 -8
  19. data/ext/ffi_c/MethodHandle.c +21 -31
  20. data/ext/ffi_c/MethodHandle.h +3 -2
  21. data/ext/ffi_c/Platform.c +3 -54
  22. data/ext/ffi_c/Pointer.c +25 -26
  23. data/ext/ffi_c/Struct.c +49 -56
  24. data/ext/ffi_c/Struct.h +12 -6
  25. data/ext/ffi_c/StructByValue.c +2 -7
  26. data/ext/ffi_c/StructLayout.c +22 -19
  27. data/ext/ffi_c/Thread.c +4 -228
  28. data/ext/ffi_c/Thread.h +1 -20
  29. data/ext/ffi_c/Type.c +1 -19
  30. data/ext/ffi_c/Type.h +0 -1
  31. data/ext/ffi_c/Types.c +1 -1
  32. data/ext/ffi_c/Variadic.c +11 -22
  33. data/ext/ffi_c/compat.h +4 -0
  34. data/ext/ffi_c/extconf.rb +53 -30
  35. data/ext/ffi_c/ffi.c +3 -8
  36. data/ext/ffi_c/libffi.darwin.mk +1 -1
  37. data/ext/ffi_c/libffi/.appveyor.yml +29 -13
  38. data/ext/ffi_c/libffi/.gitattributes +4 -0
  39. data/ext/ffi_c/libffi/.travis.yml +51 -2
  40. data/ext/ffi_c/libffi/.travis/bfin-sim.exp +58 -0
  41. data/ext/ffi_c/libffi/.travis/build-cross-in-container.sh +14 -0
  42. data/ext/ffi_c/libffi/.travis/build-in-container.sh +12 -0
  43. data/ext/ffi_c/libffi/.travis/build.sh +116 -8
  44. data/ext/ffi_c/libffi/.travis/install.sh +65 -16
  45. data/ext/ffi_c/libffi/.travis/m32r-sim.exp +58 -0
  46. data/ext/ffi_c/libffi/.travis/moxie-sim.exp +1 -1
  47. data/ext/ffi_c/libffi/.travis/or1k-sim.exp +58 -0
  48. data/ext/ffi_c/libffi/.travis/powerpc-eabisim.exp +58 -0
  49. data/ext/ffi_c/libffi/.travis/site.exp +10 -1
  50. data/ext/ffi_c/libffi/.travis/wine-sim.exp +55 -0
  51. data/ext/ffi_c/libffi/{ChangeLog.libffi-3.1 → ChangeLog.old} +1407 -0
  52. data/ext/ffi_c/libffi/LICENSE +1 -1
  53. data/ext/ffi_c/libffi/LICENSE-BUILDTOOLS +5 -4
  54. data/ext/ffi_c/libffi/Makefile.am +56 -72
  55. data/ext/ffi_c/libffi/README.md +33 -8
  56. data/ext/ffi_c/libffi/config.guess +552 -331
  57. data/ext/ffi_c/libffi/config.sub +1321 -1306
  58. data/ext/ffi_c/libffi/configure.ac +37 -12
  59. data/ext/ffi_c/libffi/configure.host +56 -27
  60. data/ext/ffi_c/libffi/doc/Makefile.am +3 -0
  61. data/ext/ffi_c/libffi/doc/libffi.texi +997 -0
  62. data/ext/ffi_c/libffi/doc/version.texi +4 -0
  63. data/ext/ffi_c/libffi/generate-darwin-source-and-headers.py +2 -4
  64. data/ext/ffi_c/libffi/include/ffi.h.in +19 -7
  65. data/ext/ffi_c/libffi/include/ffi_common.h +5 -1
  66. data/ext/ffi_c/libffi/libffi.map.in +8 -12
  67. data/ext/ffi_c/libffi/libffi.xcodeproj/project.pbxproj +2 -48
  68. data/ext/ffi_c/libffi/libtool-version +1 -1
  69. data/ext/ffi_c/libffi/m4/asmcfi.m4 +1 -1
  70. data/ext/ffi_c/libffi/m4/ax_append_flag.m4 +5 -26
  71. data/ext/ffi_c/libffi/m4/ax_check_compile_flag.m4 +5 -26
  72. data/ext/ffi_c/libffi/m4/ax_compiler_vendor.m4 +2 -1
  73. data/ext/ffi_c/libffi/m4/ax_configure_args.m4 +5 -26
  74. data/ext/ffi_c/libffi/m4/ax_gcc_archflag.m4 +7 -3
  75. data/ext/ffi_c/libffi/make_sunver.pl +333 -0
  76. data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.sln +33 -0
  77. data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj +130 -0
  78. data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj.filters +57 -0
  79. data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj.user +4 -0
  80. data/ext/ffi_c/libffi/msvc_build/aarch64/aarch64_include/ffi.h +511 -0
  81. data/ext/ffi_c/libffi/msvcc.sh +38 -13
  82. data/ext/ffi_c/libffi/src/aarch64/ffi.c +153 -69
  83. data/ext/ffi_c/libffi/src/aarch64/ffitarget.h +19 -3
  84. data/ext/ffi_c/libffi/src/aarch64/internal.h +1 -0
  85. data/ext/ffi_c/libffi/src/aarch64/sysv.S +22 -9
  86. data/ext/ffi_c/libffi/src/aarch64/win64_armasm.S +506 -0
  87. data/ext/ffi_c/libffi/src/arm/ffi.c +62 -5
  88. data/ext/ffi_c/libffi/src/arm/ffitarget.h +8 -1
  89. data/ext/ffi_c/libffi/src/arm/sysv.S +6 -4
  90. data/ext/ffi_c/libffi/src/arm/sysv_msvc_arm32.S +311 -0
  91. data/ext/ffi_c/libffi/src/closures.c +69 -14
  92. data/ext/ffi_c/libffi/src/csky/ffi.c +395 -0
  93. data/ext/ffi_c/libffi/src/csky/ffitarget.h +63 -0
  94. data/ext/ffi_c/libffi/src/csky/sysv.S +371 -0
  95. data/ext/ffi_c/libffi/src/dlmalloc.c +1 -1
  96. data/ext/ffi_c/libffi/src/frv/ffi.c +1 -1
  97. data/ext/ffi_c/libffi/src/kvx/asm.h +5 -0
  98. data/ext/ffi_c/libffi/src/kvx/ffi.c +273 -0
  99. data/ext/ffi_c/libffi/src/kvx/ffitarget.h +75 -0
  100. data/ext/ffi_c/libffi/src/kvx/sysv.S +127 -0
  101. data/ext/ffi_c/libffi/src/metag/ffi.c +1 -1
  102. data/ext/ffi_c/libffi/src/mips/ffi.c +5 -1
  103. data/ext/ffi_c/libffi/src/mips/ffitarget.h +1 -1
  104. data/ext/ffi_c/libffi/src/mips/o32.S +2 -0
  105. data/ext/ffi_c/libffi/src/moxie/ffi.c +1 -1
  106. data/ext/ffi_c/libffi/src/pa/ffi.c +46 -91
  107. data/ext/ffi_c/libffi/src/pa/ffitarget.h +1 -6
  108. data/ext/ffi_c/libffi/src/pa/hpux32.S +4 -2
  109. data/ext/ffi_c/libffi/src/pa/linux.S +27 -4
  110. data/ext/ffi_c/libffi/src/powerpc/ffi.c +6 -4
  111. data/ext/ffi_c/libffi/src/powerpc/ffi_darwin.c +13 -1
  112. data/ext/ffi_c/libffi/src/powerpc/ffi_linux64.c +211 -32
  113. data/ext/ffi_c/libffi/src/powerpc/ffi_powerpc.h +18 -7
  114. data/ext/ffi_c/libffi/src/powerpc/ffitarget.h +10 -4
  115. data/ext/ffi_c/libffi/src/powerpc/linux64.S +91 -28
  116. data/ext/ffi_c/libffi/src/powerpc/linux64_closure.S +81 -5
  117. data/ext/ffi_c/libffi/src/powerpc/sysv.S +5 -7
  118. data/ext/ffi_c/libffi/src/prep_cif.c +4 -2
  119. data/ext/ffi_c/libffi/src/riscv/ffi.c +42 -6
  120. data/ext/ffi_c/libffi/src/riscv/ffitarget.h +1 -0
  121. data/ext/ffi_c/libffi/src/riscv/sysv.S +86 -7
  122. data/ext/ffi_c/libffi/src/x86/ffi.c +29 -12
  123. data/ext/ffi_c/libffi/src/x86/ffi64.c +22 -11
  124. data/ext/ffi_c/libffi/src/x86/ffitarget.h +15 -2
  125. data/ext/ffi_c/libffi/src/x86/ffiw64.c +20 -10
  126. data/ext/ffi_c/libffi/src/x86/sysv.S +105 -10
  127. data/ext/ffi_c/libffi/src/x86/sysv_intel.S +995 -0
  128. data/ext/ffi_c/libffi/src/x86/unix64.S +100 -4
  129. data/ext/ffi_c/libffi/src/x86/win64.S +12 -3
  130. data/ext/ffi_c/libffi/src/x86/win64_intel.S +3 -2
  131. data/ext/ffi_c/libffi/testsuite/Makefile.am +114 -109
  132. data/ext/ffi_c/libffi/testsuite/lib/libffi.exp +32 -8
  133. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/bhaible.exp +7 -2
  134. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-call.c +4 -4
  135. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-callback.c +2 -2
  136. data/ext/ffi_c/libffi/testsuite/libffi.call/call.exp +12 -1
  137. data/ext/ffi_c/libffi/testsuite/libffi.call/float2.c +9 -8
  138. data/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c +1 -1
  139. data/ext/ffi_c/libffi/testsuite/libffi.closures/closure.exp +67 -0
  140. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn0.c +0 -0
  141. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn1.c +0 -0
  142. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn2.c +0 -0
  143. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn3.c +0 -0
  144. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn4.c +0 -0
  145. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn5.c +0 -0
  146. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn6.c +0 -0
  147. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_loc_fn0.c +0 -0
  148. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_simple.c +0 -0
  149. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_12byte.c +0 -0
  150. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_16byte.c +0 -0
  151. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_18byte.c +0 -0
  152. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_19byte.c +0 -0
  153. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_1_1byte.c +0 -0
  154. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_20byte.c +0 -0
  155. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_20byte1.c +0 -0
  156. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_24byte.c +0 -0
  157. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_2byte.c +0 -0
  158. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3_1byte.c +0 -0
  159. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3byte1.c +0 -0
  160. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3byte2.c +0 -0
  161. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3float.c +0 -0
  162. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_4_1byte.c +0 -0
  163. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_4byte.c +0 -0
  164. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_5_1_byte.c +0 -0
  165. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_5byte.c +0 -0
  166. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_64byte.c +0 -0
  167. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_6_1_byte.c +0 -0
  168. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_6byte.c +0 -0
  169. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_7_1_byte.c +0 -0
  170. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_7byte.c +0 -0
  171. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_8byte.c +0 -0
  172. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_9byte1.c +0 -0
  173. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_9byte2.c +0 -0
  174. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_double.c +0 -0
  175. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_float.c +0 -0
  176. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble.c +0 -0
  177. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble_split.c +0 -0
  178. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble_split2.c +0 -0
  179. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_pointer.c +0 -0
  180. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint16.c +0 -0
  181. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint32.c +0 -0
  182. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint64.c +0 -0
  183. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint16.c +0 -0
  184. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint32.c +0 -0
  185. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint64.c +0 -0
  186. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_dbls_struct.c +0 -0
  187. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_double.c +0 -0
  188. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_double_va.c +0 -0
  189. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_float.c +0 -0
  190. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_longdouble.c +0 -0
  191. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_longdouble_va.c +0 -0
  192. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_many_mixed_args.c +0 -0
  193. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_many_mixed_float_double.c +0 -0
  194. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_schar.c +0 -0
  195. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_sshort.c +0 -0
  196. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_sshortchar.c +0 -0
  197. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_uchar.c +0 -0
  198. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_ushort.c +0 -0
  199. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_ushortchar.c +0 -0
  200. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_pointer.c +0 -0
  201. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_pointer_stack.c +0 -0
  202. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_schar.c +0 -0
  203. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_sint.c +0 -0
  204. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_sshort.c +0 -0
  205. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_struct_va1.c +0 -0
  206. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uchar.c +0 -0
  207. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uchar_va.c +0 -0
  208. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uint.c +0 -0
  209. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uint_va.c +0 -0
  210. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ulong_va.c +0 -0
  211. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ulonglong.c +0 -0
  212. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ushort.c +0 -0
  213. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ushort_va.c +0 -0
  214. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/err_bad_abi.c +0 -0
  215. data/ext/ffi_c/libffi/testsuite/libffi.closures/ffitest.h +138 -0
  216. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/huge_struct.c +3 -1
  217. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct.c +0 -0
  218. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct1.c +0 -0
  219. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct10.c +0 -0
  220. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct11.c +0 -0
  221. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct2.c +0 -0
  222. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct3.c +0 -0
  223. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct4.c +0 -0
  224. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct5.c +0 -0
  225. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct6.c +0 -0
  226. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct7.c +0 -0
  227. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct8.c +0 -0
  228. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct9.c +0 -0
  229. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/problem1.c +0 -0
  230. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_large.c +0 -0
  231. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_large2.c +0 -0
  232. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_medium.c +0 -0
  233. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_medium2.c +0 -0
  234. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/testclosure.c +0 -0
  235. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/unwindtest.cc +0 -0
  236. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/unwindtest_ffi_call.cc +0 -0
  237. data/ext/ffi_c/rbffi.h +0 -2
  238. data/ffi.gemspec +13 -6
  239. data/lib/ffi.rb +10 -2
  240. data/lib/ffi/abstract_memory.rb +44 -0
  241. data/lib/ffi/autopointer.rb +1 -1
  242. data/lib/ffi/data_converter.rb +67 -0
  243. data/lib/ffi/ffi.rb +3 -0
  244. data/lib/ffi/io.rb +3 -3
  245. data/lib/ffi/library.rb +11 -7
  246. data/lib/ffi/managedstruct.rb +2 -2
  247. data/lib/ffi/platform.rb +27 -9
  248. data/lib/ffi/platform/aarch64-darwin/types.conf +130 -0
  249. data/lib/ffi/platform/aarch64-freebsd/types.conf +89 -89
  250. data/lib/ffi/platform/aarch64-freebsd12/types.conf +89 -89
  251. data/lib/ffi/platform/aarch64-linux/types.conf +81 -81
  252. data/lib/ffi/platform/aarch64-openbsd/types.conf +134 -0
  253. data/lib/ffi/platform/arm-freebsd/types.conf +87 -87
  254. data/lib/ffi/platform/arm-freebsd12/types.conf +87 -87
  255. data/lib/ffi/platform/arm-linux/types.conf +110 -82
  256. data/lib/ffi/platform/i386-cygwin/types.conf +1 -1
  257. data/lib/ffi/platform/i386-darwin/types.conf +63 -63
  258. data/lib/ffi/platform/i386-freebsd/types.conf +87 -87
  259. data/lib/ffi/platform/i386-freebsd12/types.conf +87 -87
  260. data/lib/ffi/platform/i386-gnu/types.conf +84 -84
  261. data/lib/ffi/platform/i386-linux/types.conf +77 -77
  262. data/lib/ffi/platform/i386-netbsd/types.conf +87 -87
  263. data/lib/ffi/platform/i386-openbsd/types.conf +89 -89
  264. data/lib/ffi/platform/i386-solaris/types.conf +96 -96
  265. data/lib/ffi/platform/i386-windows/types.conf +43 -96
  266. data/lib/ffi/platform/ia64-linux/types.conf +79 -79
  267. data/lib/ffi/platform/mips-linux/types.conf +79 -79
  268. data/lib/ffi/platform/mips64-linux/types.conf +81 -81
  269. data/lib/ffi/platform/mips64el-linux/types.conf +81 -81
  270. data/lib/ffi/platform/mipsel-linux/types.conf +79 -79
  271. data/lib/ffi/platform/mipsisa32r6-linux/types.conf +79 -79
  272. data/lib/ffi/platform/mipsisa32r6el-linux/types.conf +79 -79
  273. data/lib/ffi/platform/mipsisa64r6-linux/types.conf +81 -81
  274. data/lib/ffi/platform/mipsisa64r6el-linux/types.conf +81 -81
  275. data/lib/ffi/platform/powerpc-aix/types.conf +155 -155
  276. data/lib/ffi/platform/powerpc-darwin/types.conf +63 -63
  277. data/lib/ffi/platform/powerpc-linux/types.conf +108 -78
  278. data/lib/ffi/platform/powerpc-openbsd/types.conf +156 -0
  279. data/lib/ffi/platform/powerpc64-linux/types.conf +81 -81
  280. data/lib/ffi/platform/s390-linux/types.conf +79 -79
  281. data/lib/ffi/platform/s390x-linux/types.conf +79 -79
  282. data/lib/ffi/platform/sparc-linux/types.conf +79 -79
  283. data/lib/ffi/platform/sparc-solaris/types.conf +103 -103
  284. data/lib/ffi/platform/sparc64-linux/types.conf +79 -79
  285. data/lib/ffi/platform/sparcv9-openbsd/types.conf +156 -0
  286. data/lib/ffi/platform/sparcv9-solaris/types.conf +103 -103
  287. data/lib/ffi/platform/x86_64-cygwin/types.conf +1 -1
  288. data/lib/ffi/platform/x86_64-darwin/types.conf +88 -84
  289. data/lib/ffi/platform/x86_64-dragonflybsd/types.conf +130 -0
  290. data/lib/ffi/platform/x86_64-freebsd/types.conf +89 -89
  291. data/lib/ffi/platform/x86_64-freebsd12/types.conf +139 -109
  292. data/lib/ffi/platform/x86_64-haiku/types.conf +117 -0
  293. data/lib/ffi/platform/x86_64-linux/types.conf +107 -77
  294. data/lib/ffi/platform/x86_64-msys/types.conf +119 -0
  295. data/lib/ffi/platform/x86_64-netbsd/types.conf +89 -89
  296. data/lib/ffi/platform/x86_64-openbsd/types.conf +86 -86
  297. data/lib/ffi/platform/x86_64-solaris/types.conf +96 -96
  298. data/lib/ffi/platform/x86_64-windows/types.conf +42 -110
  299. data/lib/ffi/pointer.rb +22 -15
  300. data/lib/ffi/struct.rb +13 -68
  301. data/lib/ffi/struct_by_reference.rb +72 -0
  302. data/lib/ffi/struct_layout.rb +96 -0
  303. data/lib/ffi/tools/const_generator.rb +5 -4
  304. data/lib/ffi/tools/generator.rb +47 -2
  305. data/lib/ffi/tools/generator_task.rb +13 -17
  306. data/lib/ffi/tools/struct_generator.rb +4 -4
  307. data/lib/ffi/tools/types_generator.rb +7 -4
  308. data/lib/ffi/types.rb +1 -1
  309. data/lib/ffi/variadic.rb +1 -1
  310. data/lib/ffi/version.rb +1 -1
  311. data/samples/getlogin.rb +1 -1
  312. data/samples/getpid.rb +1 -1
  313. data/samples/gettimeofday.rb +8 -8
  314. data/samples/hello.rb +2 -1
  315. data/samples/inotify.rb +1 -1
  316. data/samples/pty.rb +1 -2
  317. data/samples/qsort.rb +0 -1
  318. metadata +151 -122
  319. data/.gitignore +0 -22
  320. data/.gitmodules +0 -3
  321. data/.travis.yml +0 -43
  322. data/.yardopts +0 -5
  323. data/appveyor.yml +0 -22
  324. data/ext/ffi_c/DataConverter.c +0 -91
  325. data/ext/ffi_c/StructByReference.c +0 -190
  326. data/ext/ffi_c/StructByReference.h +0 -50
  327. data/ext/ffi_c/libffi/ChangeLog.libffi +0 -584
  328. data/ext/ffi_c/libffi/ChangeLog.libgcj +0 -40
  329. data/ext/ffi_c/libffi/ChangeLog.v1 +0 -764
  330. data/ext/ffi_c/win32/stdbool.h +0 -8
  331. data/ext/ffi_c/win32/stdint.h +0 -201
  332. data/samples/sample_helper.rb +0 -6
@@ -60,7 +60,7 @@ do
60
60
  case $1
61
61
  in
62
62
  --verbose)
63
- $verbose=1
63
+ verbose=1
64
64
  shift 1
65
65
  ;;
66
66
  --version)
@@ -80,6 +80,16 @@ do
80
80
  safeseh=
81
81
  shift 1
82
82
  ;;
83
+ -marm)
84
+ ml='armasm'
85
+ safeseh=
86
+ shift 1
87
+ ;;
88
+ -marm64)
89
+ ml='armasm64'
90
+ safeseh=
91
+ shift 1
92
+ ;;
83
93
  -clang-cl)
84
94
  cl="clang-cl"
85
95
  shift 1
@@ -155,24 +165,24 @@ do
155
165
  shift 1
156
166
  ;;
157
167
  -I)
158
- p=$(cygpath -m $2)
159
- args="$args -I$p"
160
- includes="$includes -I$p"
168
+ p=$(cygpath -ma "$2")
169
+ args="$args -I\"$p\""
170
+ includes="$includes -I\"$p\""
161
171
  shift 2
162
172
  ;;
163
173
  -I*)
164
- p=$(cygpath -m ${1#-I})
165
- args="$args -I$p"
166
- includes="$includes -I$p"
174
+ p=$(cygpath -ma "${1#-I}")
175
+ args="$args -I\"$p\""
176
+ includes="$includes -I\"$p\""
167
177
  shift 1
168
178
  ;;
169
179
  -L)
170
- p=$(cygpath -m $2)
180
+ p=$(cygpath -ma $2)
171
181
  linkargs="$linkargs -LIBPATH:$p"
172
182
  shift 2
173
183
  ;;
174
184
  -L*)
175
- p=$(cygpath -m ${1#-L})
185
+ p=$(cygpath -ma ${1#-L})
176
186
  linkargs="$linkargs -LIBPATH:$p"
177
187
  shift 1
178
188
  ;;
@@ -237,6 +247,7 @@ do
237
247
  else
238
248
  output="-Fe$2"
239
249
  fi
250
+ armasm_output="-o $2"
240
251
  if [ -n "$assembly" ]; then
241
252
  args="$args $output"
242
253
  else
@@ -245,12 +256,12 @@ do
245
256
  shift 2
246
257
  ;;
247
258
  *.S)
248
- src=$1
259
+ src="$(cygpath -ma $1)"
249
260
  assembly="true"
250
261
  shift 1
251
262
  ;;
252
263
  *.c)
253
- args="$args $1"
264
+ args="$args $(cygpath -ma $1)"
254
265
  shift 1
255
266
  ;;
256
267
  *)
@@ -289,13 +300,27 @@ if [ -n "$assembly" ]; then
289
300
  fi
290
301
  ppsrc="$outdir/$(basename $src|sed 's/.S$/.asm/g')"
291
302
 
303
+ if [ $ml = "armasm" ]; then
304
+ defines="$defines -D_M_ARM"
305
+ fi
306
+
307
+ if [ $ml = "armasm64" ]; then
308
+ defines="$defines -D_M_ARM64"
309
+ fi
310
+
292
311
  if test -n "$verbose"; then
293
312
  echo "$cl -nologo -EP $includes $defines $src > $ppsrc"
294
313
  fi
295
314
 
296
- "$cl" -nologo -EP $includes $defines $src > $ppsrc || exit $?
315
+ eval "\"$cl\" -nologo -EP $includes $defines $src" > $ppsrc || exit $?
297
316
  output="$(echo $output | sed 's%/F[dpa][^ ]*%%g')"
298
- args="-nologo $safeseh $single $output $ppsrc"
317
+ if [ $ml = "armasm" ]; then
318
+ args="-nologo -g -oldit $armasm_output $ppsrc -errorReport:prompt"
319
+ elif [ $ml = "armasm64" ]; then
320
+ args="-nologo -g $armasm_output $ppsrc -errorReport:prompt"
321
+ else
322
+ args="-nologo $safeseh $single $output $ppsrc"
323
+ fi
299
324
 
300
325
  if test -n "$verbose"; then
301
326
  echo "$ml $args"
@@ -19,6 +19,7 @@ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19
19
  TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20
20
  SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
21
21
 
22
+ #if defined(__aarch64__) || defined(__arm64__)|| defined (_M_ARM64)
22
23
  #include <stdio.h>
23
24
  #include <stdlib.h>
24
25
  #include <stdint.h>
@@ -26,6 +27,9 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
26
27
  #include <ffi.h>
27
28
  #include <ffi_common.h>
28
29
  #include "internal.h"
30
+ #ifdef _WIN32
31
+ #include <windows.h> /* FlushInstructionCache */
32
+ #endif
29
33
 
30
34
  /* Force FFI_TYPE_LONGDOUBLE to be different than FFI_TYPE_DOUBLE;
31
35
  all further uses in this file will refer to the 128-bit type. */
@@ -58,6 +62,9 @@ struct call_context
58
62
  #if FFI_EXEC_TRAMPOLINE_TABLE
59
63
 
60
64
  #ifdef __MACH__
65
+ #ifdef HAVE_PTRAUTH
66
+ #include <ptrauth.h>
67
+ #endif
61
68
  #include <mach/vm_param.h>
62
69
  #endif
63
70
 
@@ -74,6 +81,8 @@ ffi_clear_cache (void *start, void *end)
74
81
  sys_icache_invalidate (start, (char *)end - (char *)start);
75
82
  #elif defined (__GNUC__)
76
83
  __builtin___clear_cache (start, end);
84
+ #elif defined (_WIN32)
85
+ FlushInstructionCache(GetCurrentProcess(), start, (char*)end - (char*)start);
77
86
  #else
78
87
  #error "Missing builtin to flush instruction cache"
79
88
  #endif
@@ -315,6 +324,9 @@ extend_integer_type (void *source, int type)
315
324
  }
316
325
  }
317
326
 
327
+ #if defined(_MSC_VER)
328
+ void extend_hfa_type (void *dest, void *src, int h);
329
+ #else
318
330
  static void
319
331
  extend_hfa_type (void *dest, void *src, int h)
320
332
  {
@@ -350,10 +362,10 @@ extend_hfa_type (void *dest, void *src, int h)
350
362
  " b 1f\n"
351
363
  " nop\n"
352
364
  " ldp q16, q17, [%3]\n" /* Q4 */
353
- " ldp q18, q19, [%3, #16]\n"
365
+ " ldp q18, q19, [%3, #32]\n"
354
366
  " b 4f\n"
355
367
  " ldp q16, q17, [%3]\n" /* Q3 */
356
- " ldr q18, [%3, #16]\n"
368
+ " ldr q18, [%3, #32]\n"
357
369
  " b 3f\n"
358
370
  " ldp q16, q17, [%3]\n" /* Q2 */
359
371
  " b 2f\n"
@@ -368,7 +380,11 @@ extend_hfa_type (void *dest, void *src, int h)
368
380
  : "r"(f * 12), "r"(dest), "r"(src)
369
381
  : "memory", "v16", "v17", "v18", "v19");
370
382
  }
383
+ #endif
371
384
 
385
+ #if defined(_MSC_VER)
386
+ void* compress_hfa_type (void *dest, void *src, int h);
387
+ #else
372
388
  static void *
373
389
  compress_hfa_type (void *dest, void *reg, int h)
374
390
  {
@@ -437,6 +453,7 @@ compress_hfa_type (void *dest, void *reg, int h)
437
453
  }
438
454
  return dest;
439
455
  }
456
+ #endif
440
457
 
441
458
  /* Either allocate an appropriate register for the argument type, or if
442
459
  none are available, allocate a stack slot and return a pointer
@@ -454,7 +471,7 @@ allocate_int_to_reg_or_stack (struct call_context *context,
454
471
  return allocate_to_stack (state, stack, size, size);
455
472
  }
456
473
 
457
- ffi_status
474
+ ffi_status FFI_HIDDEN
458
475
  ffi_prep_cif_machdep (ffi_cif *cif)
459
476
  {
460
477
  ffi_type *rtype = cif->rtype;
@@ -539,14 +556,22 @@ ffi_prep_cif_machdep (ffi_cif *cif)
539
556
 
540
557
  #if defined (__APPLE__)
541
558
  /* Perform Apple-specific cif processing for variadic calls */
542
- ffi_status ffi_prep_cif_machdep_var(ffi_cif *cif,
543
- unsigned int nfixedargs,
544
- unsigned int ntotalargs)
559
+ ffi_status FFI_HIDDEN
560
+ ffi_prep_cif_machdep_var(ffi_cif *cif, unsigned int nfixedargs,
561
+ unsigned int ntotalargs)
545
562
  {
546
563
  ffi_status status = ffi_prep_cif_machdep (cif);
547
564
  cif->aarch64_nfixedargs = nfixedargs;
548
565
  return status;
549
566
  }
567
+ #else
568
+ ffi_status FFI_HIDDEN
569
+ ffi_prep_cif_machdep_var(ffi_cif *cif, unsigned int nfixedargs, unsigned int ntotalargs)
570
+ {
571
+ ffi_status status = ffi_prep_cif_machdep (cif);
572
+ cif->flags |= AARCH64_FLAG_VARARG;
573
+ return status;
574
+ }
550
575
  #endif /* __APPLE__ */
551
576
 
552
577
  extern void ffi_call_SYSV (struct call_context *context, void *frame,
@@ -563,7 +588,7 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *orig_rvalue,
563
588
  void *stack, *frame, *rvalue;
564
589
  struct arg_state state;
565
590
  size_t stack_bytes, rtype_size, rsize;
566
- int i, nargs, flags;
591
+ int i, nargs, flags, isvariadic = 0;
567
592
  ffi_type *rtype;
568
593
 
569
594
  flags = cif->flags;
@@ -571,6 +596,12 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *orig_rvalue,
571
596
  rtype_size = rtype->size;
572
597
  stack_bytes = cif->bytes;
573
598
 
599
+ if (flags & AARCH64_FLAG_VARARG)
600
+ {
601
+ isvariadic = 1;
602
+ flags &= ~AARCH64_FLAG_VARARG;
603
+ }
604
+
574
605
  /* If the target function returns a structure via hidden pointer,
575
606
  then we cannot allow a null rvalue. Otherwise, mash a null
576
607
  rvalue to void return type. */
@@ -588,8 +619,8 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *orig_rvalue,
588
619
  /* Allocate consectutive stack for everything we'll need. */
589
620
  context = alloca (sizeof(struct call_context) + stack_bytes + 32 + rsize);
590
621
  stack = context + 1;
591
- frame = stack + stack_bytes;
592
- rvalue = (rsize ? frame + 32 : orig_rvalue);
622
+ frame = (void*)((uintptr_t)stack + (uintptr_t)stack_bytes);
623
+ rvalue = (rsize ? (void*)((uintptr_t)frame + 32) : orig_rvalue);
593
624
 
594
625
  arg_init (&state);
595
626
  for (i = 0, nargs = cif->nargs; i < nargs; i++)
@@ -650,16 +681,31 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *orig_rvalue,
650
681
  h = is_vfp_type (ty);
651
682
  if (h)
652
683
  {
653
- int elems = 4 - (h & 3);
654
- if (state.nsrn + elems <= N_V_ARG_REG)
655
- {
656
- dest = &context->v[state.nsrn];
657
- state.nsrn += elems;
658
- extend_hfa_type (dest, a, h);
659
- break;
660
- }
661
- state.nsrn = N_V_ARG_REG;
662
- dest = allocate_to_stack (&state, stack, ty->alignment, s);
684
+ int elems = 4 - (h & 3);
685
+ if (cif->abi == FFI_WIN64 && isvariadic)
686
+ {
687
+ if (state.ngrn + elems <= N_X_ARG_REG)
688
+ {
689
+ dest = &context->x[state.ngrn];
690
+ state.ngrn += elems;
691
+ extend_hfa_type(dest, a, h);
692
+ break;
693
+ }
694
+ state.nsrn = N_X_ARG_REG;
695
+ dest = allocate_to_stack(&state, stack, ty->alignment, s);
696
+ }
697
+ else
698
+ {
699
+ if (state.nsrn + elems <= N_V_ARG_REG)
700
+ {
701
+ dest = &context->v[state.nsrn];
702
+ state.nsrn += elems;
703
+ extend_hfa_type (dest, a, h);
704
+ break;
705
+ }
706
+ state.nsrn = N_V_ARG_REG;
707
+ dest = allocate_to_stack (&state, stack, ty->alignment, s);
708
+ }
663
709
  }
664
710
  else if (s > 16)
665
711
  {
@@ -681,7 +727,7 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *orig_rvalue,
681
727
  X registers, then the argument is copied into
682
728
  consecutive X registers. */
683
729
  dest = &context->x[state.ngrn];
684
- state.ngrn += n;
730
+ state.ngrn += (unsigned int)n;
685
731
  }
686
732
  else
687
733
  {
@@ -756,6 +802,9 @@ ffi_prep_closure_loc (ffi_closure *closure,
756
802
 
757
803
  #if FFI_EXEC_TRAMPOLINE_TABLE
758
804
  #ifdef __MACH__
805
+ #ifdef HAVE_PTRAUTH
806
+ codeloc = ptrauth_strip (codeloc, ptrauth_key_asia);
807
+ #endif
759
808
  void **config = (void **)((uint8_t *)codeloc - PAGE_MAX_SIZE);
760
809
  config[0] = closure;
761
810
  config[1] = start;
@@ -773,6 +822,16 @@ ffi_prep_closure_loc (ffi_closure *closure,
773
822
  *(UINT64 *)(tramp + 16) = (uintptr_t)start;
774
823
 
775
824
  ffi_clear_cache(tramp, tramp + FFI_TRAMPOLINE_SIZE);
825
+
826
+ /* Also flush the cache for code mapping. */
827
+ #ifdef _WIN32
828
+ // Not using dlmalloc.c for Windows ARM64 builds
829
+ // so calling ffi_data_to_code_pointer() isn't necessary
830
+ unsigned char *tramp_code = tramp;
831
+ #else
832
+ unsigned char *tramp_code = ffi_data_to_code_pointer (tramp);
833
+ #endif
834
+ ffi_clear_cache (tramp_code, tramp_code + FFI_TRAMPOLINE_SIZE);
776
835
  #endif
777
836
 
778
837
  closure->cif = cif;
@@ -871,55 +930,78 @@ ffi_closure_SYSV_inner (ffi_cif *cif,
871
930
  if (h)
872
931
  {
873
932
  n = 4 - (h & 3);
874
- if (state.nsrn + n <= N_V_ARG_REG)
875
- {
876
- void *reg = &context->v[state.nsrn];
877
- state.nsrn += n;
878
-
879
- /* Eeek! We need a pointer to the structure, however the
880
- homogeneous float elements are being passed in individual
881
- registers, therefore for float and double the structure
882
- is not represented as a contiguous sequence of bytes in
883
- our saved register context. We don't need the original
884
- contents of the register storage, so we reformat the
885
- structure into the same memory. */
886
- avalue[i] = compress_hfa_type (reg, reg, h);
887
- }
888
- else
889
- {
890
- state.nsrn = N_V_ARG_REG;
891
- avalue[i] = allocate_to_stack (&state, stack,
892
- ty->alignment, s);
893
- }
894
- }
895
- else if (s > 16)
896
- {
897
- /* Replace Composite type of size greater than 16 with a
898
- pointer. */
899
- avalue[i] = *(void **)
900
- allocate_int_to_reg_or_stack (context, &state, stack,
901
- sizeof (void *));
902
- }
903
- else
904
- {
905
- n = (s + 7) / 8;
906
- if (state.ngrn + n <= N_X_ARG_REG)
907
- {
908
- avalue[i] = &context->x[state.ngrn];
909
- state.ngrn += n;
910
- }
911
- else
912
- {
913
- state.ngrn = N_X_ARG_REG;
914
- avalue[i] = allocate_to_stack (&state, stack,
915
- ty->alignment, s);
916
- }
917
- }
918
- break;
919
-
920
- default:
921
- abort();
922
- }
933
+ #ifdef _WIN32 /* for handling armasm calling convention */
934
+ if (cif->is_variadic)
935
+ {
936
+ if (state.ngrn + n <= N_X_ARG_REG)
937
+ {
938
+ void *reg = &context->x[state.ngrn];
939
+ state.ngrn += (unsigned int)n;
940
+
941
+ /* Eeek! We need a pointer to the structure, however the
942
+ homogeneous float elements are being passed in individual
943
+ registers, therefore for float and double the structure
944
+ is not represented as a contiguous sequence of bytes in
945
+ our saved register context. We don't need the original
946
+ contents of the register storage, so we reformat the
947
+ structure into the same memory. */
948
+ avalue[i] = compress_hfa_type(reg, reg, h);
949
+ }
950
+ else
951
+ {
952
+ state.ngrn = N_X_ARG_REG;
953
+ state.nsrn = N_V_ARG_REG;
954
+ avalue[i] = allocate_to_stack(&state, stack,
955
+ ty->alignment, s);
956
+ }
957
+ }
958
+ else
959
+ {
960
+ #endif /* for handling armasm calling convention */
961
+ if (state.nsrn + n <= N_V_ARG_REG)
962
+ {
963
+ void *reg = &context->v[state.nsrn];
964
+ state.nsrn += (unsigned int)n;
965
+ avalue[i] = compress_hfa_type(reg, reg, h);
966
+ }
967
+ else
968
+ {
969
+ state.nsrn = N_V_ARG_REG;
970
+ avalue[i] = allocate_to_stack(&state, stack,
971
+ ty->alignment, s);
972
+ }
973
+ #ifdef _WIN32 /* for handling armasm calling convention */
974
+ }
975
+ #endif /* for handling armasm calling convention */
976
+ }
977
+ else if (s > 16)
978
+ {
979
+ /* Replace Composite type of size greater than 16 with a
980
+ pointer. */
981
+ avalue[i] = *(void **)
982
+ allocate_int_to_reg_or_stack (context, &state, stack,
983
+ sizeof (void *));
984
+ }
985
+ else
986
+ {
987
+ n = (s + 7) / 8;
988
+ if (state.ngrn + n <= N_X_ARG_REG)
989
+ {
990
+ avalue[i] = &context->x[state.ngrn];
991
+ state.ngrn += (unsigned int)n;
992
+ }
993
+ else
994
+ {
995
+ state.ngrn = N_X_ARG_REG;
996
+ avalue[i] = allocate_to_stack(&state, stack,
997
+ ty->alignment, s);
998
+ }
999
+ }
1000
+ break;
1001
+
1002
+ default:
1003
+ abort();
1004
+ }
923
1005
 
924
1006
  #if defined (__APPLE__)
925
1007
  if (i + 1 == cif->aarch64_nfixedargs)
@@ -939,3 +1021,5 @@ ffi_closure_SYSV_inner (ffi_cif *cif,
939
1021
 
940
1022
  return flags;
941
1023
  }
1024
+
1025
+ #endif /* (__aarch64__) || defined(__arm64__)|| defined (_M_ARM64)*/