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.
- checksums.yaml +7 -0
- checksums.yaml.gz.sig +4 -0
- data/CHANGELOG.md +465 -0
- data/COPYING +49 -0
- data/Gemfile +21 -0
- data/LICENSE +21 -11
- data/LICENSE.SPECS +22 -0
- data/README.md +137 -0
- data/Rakefile +165 -148
- data/ext/ffi_c/AbstractMemory.c +716 -97
- data/ext/ffi_c/AbstractMemory.h +38 -17
- data/ext/ffi_c/ArrayType.c +102 -33
- data/ext/ffi_c/ArrayType.h +20 -18
- data/ext/ffi_c/Buffer.c +229 -54
- data/ext/ffi_c/Call.c +211 -100
- data/ext/ffi_c/Call.h +46 -28
- data/ext/ffi_c/ClosurePool.c +110 -81
- data/ext/ffi_c/ClosurePool.h +31 -1
- data/ext/ffi_c/DynamicLibrary.c +216 -54
- data/ext/ffi_c/DynamicLibrary.h +76 -0
- data/ext/ffi_c/Function.c +527 -164
- data/ext/ffi_c/Function.h +24 -20
- data/ext/ffi_c/FunctionInfo.c +151 -50
- data/ext/ffi_c/LastError.c +112 -28
- data/ext/ffi_c/LastError.h +29 -0
- data/ext/ffi_c/LongDouble.c +65 -0
- data/ext/ffi_c/LongDouble.h +47 -0
- data/ext/ffi_c/MappedType.c +107 -42
- data/ext/ffi_c/MappedType.h +20 -20
- data/ext/ffi_c/MemoryPointer.c +108 -46
- data/ext/ffi_c/MemoryPointer.h +33 -4
- data/ext/ffi_c/MethodHandle.c +71 -67
- data/ext/ffi_c/MethodHandle.h +26 -23
- data/ext/ffi_c/Platform.c +42 -25
- data/ext/ffi_c/Platform.h +32 -3
- data/ext/ffi_c/Pointer.c +324 -51
- data/ext/ffi_c/Pointer.h +29 -18
- data/ext/ffi_c/Struct.c +434 -161
- data/ext/ffi_c/Struct.h +47 -27
- data/ext/ffi_c/StructByValue.c +74 -37
- data/ext/ffi_c/StructByValue.h +20 -18
- data/ext/ffi_c/StructLayout.c +358 -87
- data/ext/ffi_c/Thread.c +129 -0
- data/ext/ffi_c/Thread.h +76 -0
- data/ext/ffi_c/Type.c +241 -76
- data/ext/ffi_c/Type.h +27 -11
- data/ext/ffi_c/Types.c +54 -34
- data/ext/ffi_c/Types.h +24 -24
- data/ext/ffi_c/Variadic.c +151 -55
- data/ext/ffi_c/compat.h +48 -38
- data/ext/ffi_c/extconf.rb +106 -34
- data/ext/ffi_c/ffi.c +35 -26
- data/ext/ffi_c/libffi/.allow-ai-service +0 -0
- data/ext/ffi_c/libffi/.appveyor/site.exp +16 -0
- data/ext/ffi_c/libffi/.appveyor/unix-noexec.exp +7 -0
- data/ext/ffi_c/libffi/.appveyor.yml +84 -0
- data/ext/ffi_c/libffi/.ci/ar-lib +270 -0
- data/ext/ffi_c/libffi/.ci/bfin-sim.exp +58 -0
- data/ext/ffi_c/libffi/.ci/build-cross-in-container.sh +18 -0
- data/ext/ffi_c/libffi/.ci/build-in-container.sh +10 -0
- data/ext/ffi_c/libffi/.ci/build.sh +124 -0
- data/ext/ffi_c/libffi/.ci/compile +351 -0
- data/ext/ffi_c/libffi/.ci/install.sh +78 -0
- data/ext/ffi_c/libffi/.ci/m32r-sim.exp +58 -0
- data/ext/ffi_c/libffi/.ci/moxie-sim.exp +60 -0
- data/ext/ffi_c/libffi/.ci/msvs-detect +1103 -0
- data/ext/ffi_c/libffi/.ci/or1k-sim.exp +58 -0
- data/ext/ffi_c/libffi/.ci/powerpc-eabisim.exp +58 -0
- data/ext/ffi_c/libffi/.ci/site.exp +29 -0
- data/ext/ffi_c/libffi/.ci/wine-sim.exp +55 -0
- data/ext/ffi_c/libffi/.circleci/config.yml +156 -0
- data/ext/ffi_c/libffi/.gitattributes +4 -0
- data/ext/ffi_c/libffi/.github/issue_template.md +10 -0
- data/ext/ffi_c/libffi/.github/workflows/build.yml +479 -0
- data/ext/ffi_c/libffi/.github/workflows/emscripten.yml +172 -0
- data/ext/ffi_c/libffi/.gitignore +46 -0
- data/ext/ffi_c/libffi/{ChangeLog → ChangeLog.old} +6528 -3180
- data/ext/ffi_c/libffi/LICENSE +3 -3
- data/ext/ffi_c/libffi/LICENSE-BUILDTOOLS +353 -0
- data/ext/ffi_c/libffi/Makefile.am +132 -162
- data/ext/ffi_c/libffi/Makefile.in +1339 -1003
- data/ext/ffi_c/libffi/README.md +531 -0
- data/ext/ffi_c/libffi/acinclude.m4 +289 -4
- data/ext/ffi_c/libffi/autogen.sh +2 -0
- data/ext/ffi_c/libffi/compile +227 -21
- data/ext/ffi_c/libffi/config.guess +1034 -778
- data/ext/ffi_c/libffi/config.sub +1394 -1204
- data/ext/ffi_c/libffi/configure +14327 -8503
- data/ext/ffi_c/libffi/configure.ac +294 -247
- data/ext/ffi_c/libffi/configure.host +330 -4
- data/ext/ffi_c/libffi/doc/Makefile.am +3 -0
- data/ext/ffi_c/libffi/doc/Makefile.in +818 -0
- data/ext/ffi_c/libffi/doc/libffi.texi +572 -67
- data/ext/ffi_c/libffi/doc/version.texi +4 -4
- data/ext/ffi_c/libffi/fficonfig.h.in +53 -46
- data/ext/ffi_c/libffi/generate-darwin-source-and-headers.py +312 -0
- data/ext/ffi_c/libffi/include/Makefile.am +3 -3
- data/ext/ffi_c/libffi/include/Makefile.in +219 -79
- data/ext/ffi_c/libffi/include/ffi.h.in +230 -111
- data/ext/ffi_c/libffi/include/ffi_cfi.h +76 -0
- data/ext/ffi_c/libffi/include/ffi_common.h +78 -16
- data/ext/ffi_c/libffi/include/tramp.h +45 -0
- data/ext/ffi_c/libffi/install-sh +402 -184
- data/ext/ffi_c/libffi/libffi.map.in +81 -0
- data/ext/ffi_c/libffi/libffi.pc.in +3 -2
- data/ext/ffi_c/libffi/libffi.xcodeproj/project.pbxproj +997 -0
- data/ext/ffi_c/libffi/libtool-ldflags +106 -0
- data/ext/ffi_c/libffi/libtool-version +2 -2
- data/ext/ffi_c/libffi/ltmain.sh +5752 -2722
- data/ext/ffi_c/libffi/m4/asmcfi.m4 +13 -0
- data/ext/ffi_c/libffi/m4/ax_append_flag.m4 +50 -0
- data/ext/ffi_c/libffi/m4/ax_cc_maxopt.m4 +198 -0
- data/ext/ffi_c/libffi/m4/ax_cflags_warn_all.m4 +158 -0
- data/ext/ffi_c/libffi/m4/ax_check_compile_flag.m4 +53 -0
- data/ext/ffi_c/libffi/m4/ax_compiler_vendor.m4 +119 -0
- data/ext/ffi_c/libffi/m4/ax_configure_args.m4 +49 -0
- data/ext/ffi_c/libffi/m4/ax_enable_builddir.m4 +302 -0
- data/ext/ffi_c/libffi/m4/ax_gcc_archflag.m4 +267 -0
- data/ext/ffi_c/libffi/m4/ax_gcc_x86_cpuid.m4 +89 -0
- data/ext/ffi_c/libffi/m4/ax_prepend_flag.m4 +51 -0
- data/ext/ffi_c/libffi/m4/ax_require_defined.m4 +37 -0
- data/ext/ffi_c/libffi/make_sunver.pl +333 -0
- data/ext/ffi_c/libffi/man/Makefile.am +2 -2
- data/ext/ffi_c/libffi/man/Makefile.in +174 -57
- data/ext/ffi_c/libffi/man/ffi.3 +10 -0
- data/ext/ffi_c/libffi/man/ffi_prep_cif.3 +6 -4
- data/ext/ffi_c/libffi/man/ffi_prep_cif_var.3 +73 -0
- data/ext/ffi_c/libffi/missing +155 -300
- data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.sln +33 -0
- data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj +130 -0
- data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj.filters +57 -0
- data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj.user +4 -0
- data/ext/ffi_c/libffi/msvc_build/aarch64/aarch64_include/ffi.h +511 -0
- data/ext/ffi_c/libffi/msvc_build/aarch64/aarch64_include/fficonfig.h +219 -0
- data/ext/ffi_c/libffi/msvcc.sh +353 -0
- data/ext/ffi_c/libffi/src/aarch64/ffi.c +1142 -0
- data/ext/ffi_c/libffi/src/aarch64/ffitarget.h +97 -0
- data/ext/ffi_c/libffi/src/aarch64/internal.h +100 -0
- data/ext/ffi_c/libffi/src/aarch64/sysv.S +695 -0
- data/ext/ffi_c/libffi/src/aarch64/win64_armasm.S +506 -0
- data/ext/ffi_c/libffi/src/alpha/ffi.c +335 -98
- data/ext/ffi_c/libffi/src/alpha/ffitarget.h +10 -1
- data/ext/ffi_c/libffi/src/alpha/internal.h +23 -0
- data/ext/ffi_c/libffi/src/alpha/osf.S +162 -246
- data/ext/ffi_c/libffi/src/arc/arcompact.S +210 -0
- data/ext/ffi_c/libffi/src/arc/ffi.c +443 -0
- data/ext/ffi_c/libffi/src/arc/ffitarget.h +67 -0
- data/ext/ffi_c/libffi/src/arm/ffi.c +806 -194
- data/ext/ffi_c/libffi/src/arm/ffitarget.h +43 -3
- data/ext/ffi_c/libffi/src/arm/internal.h +17 -0
- data/ext/ffi_c/libffi/src/arm/sysv.S +381 -231
- data/ext/ffi_c/libffi/src/arm/sysv_msvc_arm32.S +311 -0
- data/ext/ffi_c/libffi/src/avr32/ffi.c +4 -2
- data/ext/ffi_c/libffi/src/avr32/ffitarget.h +8 -3
- data/ext/ffi_c/libffi/src/bfin/ffi.c +196 -0
- data/ext/ffi_c/libffi/src/bfin/ffitarget.h +43 -0
- data/ext/ffi_c/libffi/src/bfin/sysv.S +179 -0
- data/ext/ffi_c/libffi/src/closures.c +574 -100
- data/ext/ffi_c/libffi/src/cris/ffi.c +11 -8
- data/ext/ffi_c/libffi/src/cris/ffitarget.h +8 -3
- data/ext/ffi_c/libffi/src/csky/ffi.c +395 -0
- data/ext/ffi_c/libffi/src/csky/ffitarget.h +63 -0
- data/ext/ffi_c/libffi/src/csky/sysv.S +371 -0
- data/ext/ffi_c/libffi/src/debug.c +8 -3
- data/ext/ffi_c/libffi/src/dlmalloc.c +89 -17
- data/ext/ffi_c/libffi/src/frv/ffi.c +2 -2
- data/ext/ffi_c/libffi/src/frv/ffitarget.h +8 -7
- data/ext/ffi_c/libffi/src/ia64/ffi.c +48 -12
- data/ext/ffi_c/libffi/src/ia64/ffitarget.h +10 -4
- data/ext/ffi_c/libffi/src/ia64/unix.S +28 -3
- data/ext/ffi_c/libffi/src/java_raw_api.c +24 -6
- data/ext/ffi_c/libffi/src/kvx/asm.h +5 -0
- data/ext/ffi_c/libffi/src/kvx/ffi.c +273 -0
- data/ext/ffi_c/libffi/src/kvx/ffitarget.h +75 -0
- data/ext/ffi_c/libffi/src/kvx/sysv.S +127 -0
- data/ext/ffi_c/libffi/src/loongarch64/ffi.c +624 -0
- data/ext/ffi_c/libffi/src/loongarch64/ffitarget.h +82 -0
- data/ext/ffi_c/libffi/src/loongarch64/sysv.S +327 -0
- data/ext/ffi_c/libffi/src/m32r/ffi.c +32 -15
- data/ext/ffi_c/libffi/src/m32r/ffitarget.h +8 -3
- data/ext/ffi_c/libffi/src/m68k/ffi.c +97 -13
- data/ext/ffi_c/libffi/src/m68k/ffitarget.h +8 -3
- data/ext/ffi_c/libffi/src/m68k/sysv.S +148 -25
- data/ext/ffi_c/libffi/src/m88k/ffi.c +400 -0
- data/ext/ffi_c/libffi/src/m88k/ffitarget.h +49 -0
- data/ext/ffi_c/libffi/src/m88k/obsd.S +209 -0
- data/ext/ffi_c/libffi/src/metag/ffi.c +330 -0
- data/ext/ffi_c/libffi/src/metag/ffitarget.h +53 -0
- data/ext/ffi_c/libffi/src/metag/sysv.S +311 -0
- data/ext/ffi_c/libffi/src/microblaze/ffi.c +321 -0
- data/ext/ffi_c/libffi/src/microblaze/ffitarget.h +53 -0
- data/ext/ffi_c/libffi/src/microblaze/sysv.S +302 -0
- data/ext/ffi_c/libffi/src/mips/ffi.c +392 -104
- data/ext/ffi_c/libffi/src/mips/ffitarget.h +40 -24
- data/ext/ffi_c/libffi/src/mips/n32.S +325 -93
- data/ext/ffi_c/libffi/src/mips/o32.S +211 -31
- data/ext/ffi_c/libffi/src/moxie/eabi.S +101 -0
- data/ext/ffi_c/libffi/src/moxie/ffi.c +310 -0
- data/ext/ffi_c/libffi/src/moxie/ffitarget.h +52 -0
- data/ext/ffi_c/libffi/src/nios2/ffi.c +304 -0
- data/ext/ffi_c/libffi/src/nios2/ffitarget.h +52 -0
- data/ext/ffi_c/libffi/src/nios2/sysv.S +136 -0
- data/ext/ffi_c/libffi/src/or1k/ffi.c +341 -0
- data/ext/ffi_c/libffi/src/or1k/ffitarget.h +58 -0
- data/ext/ffi_c/libffi/src/or1k/sysv.S +107 -0
- data/ext/ffi_c/libffi/src/pa/ffi.c +68 -111
- data/ext/ffi_c/libffi/src/pa/ffi64.c +614 -0
- data/ext/ffi_c/libffi/src/pa/ffitarget.h +34 -17
- data/ext/ffi_c/libffi/src/pa/hpux32.S +87 -38
- data/ext/ffi_c/libffi/src/pa/hpux64.S +681 -0
- data/ext/ffi_c/libffi/src/pa/linux.S +109 -39
- data/ext/ffi_c/libffi/src/powerpc/aix.S +250 -8
- data/ext/ffi_c/libffi/src/powerpc/aix_closure.S +255 -4
- data/ext/ffi_c/libffi/src/powerpc/asm.h +3 -3
- data/ext/ffi_c/libffi/src/powerpc/darwin.S +211 -78
- data/ext/ffi_c/libffi/src/powerpc/darwin_closure.S +356 -102
- data/ext/ffi_c/libffi/src/powerpc/ffi.c +108 -1375
- data/ext/ffi_c/libffi/src/powerpc/ffi_darwin.c +746 -210
- data/ext/ffi_c/libffi/src/powerpc/ffi_linux64.c +1153 -0
- data/ext/ffi_c/libffi/src/powerpc/ffi_powerpc.h +105 -0
- data/ext/ffi_c/libffi/src/powerpc/ffi_sysv.c +923 -0
- data/ext/ffi_c/libffi/src/powerpc/ffitarget.h +126 -48
- data/ext/ffi_c/libffi/src/powerpc/linux64.S +191 -85
- data/ext/ffi_c/libffi/src/powerpc/linux64_closure.S +438 -108
- data/ext/ffi_c/libffi/src/powerpc/ppc_closure.S +138 -68
- data/ext/ffi_c/libffi/src/powerpc/sysv.S +73 -119
- data/ext/ffi_c/libffi/src/powerpc/t-aix +5 -0
- data/ext/ffi_c/libffi/src/prep_cif.c +141 -32
- data/ext/ffi_c/libffi/src/raw_api.c +18 -5
- data/ext/ffi_c/libffi/src/riscv/ffi.c +514 -0
- data/ext/ffi_c/libffi/src/riscv/ffitarget.h +69 -0
- data/ext/ffi_c/libffi/src/riscv/sysv.S +293 -0
- data/ext/ffi_c/libffi/src/s390/ffi.c +294 -318
- data/ext/ffi_c/libffi/src/s390/ffitarget.h +13 -3
- data/ext/ffi_c/libffi/src/s390/internal.h +11 -0
- data/ext/ffi_c/libffi/src/s390/sysv.S +257 -366
- data/ext/ffi_c/libffi/src/sh/ffi.c +4 -3
- data/ext/ffi_c/libffi/src/sh/ffitarget.h +8 -3
- data/ext/ffi_c/libffi/src/sh64/ffi.c +3 -2
- data/ext/ffi_c/libffi/src/sh64/ffitarget.h +8 -3
- data/ext/ffi_c/libffi/src/sparc/ffi.c +334 -491
- data/ext/ffi_c/libffi/src/sparc/ffi64.c +630 -0
- data/ext/ffi_c/libffi/src/sparc/ffitarget.h +20 -5
- data/ext/ffi_c/libffi/src/sparc/internal.h +26 -0
- data/ext/ffi_c/libffi/src/sparc/v8.S +364 -234
- data/ext/ffi_c/libffi/src/sparc/v9.S +340 -207
- data/ext/ffi_c/libffi/src/tile/ffi.c +355 -0
- data/ext/ffi_c/libffi/src/tile/ffitarget.h +65 -0
- data/ext/ffi_c/libffi/src/tile/tile.S +360 -0
- data/ext/ffi_c/libffi/src/tramp.c +716 -0
- data/ext/ffi_c/libffi/src/types.c +48 -19
- data/ext/ffi_c/libffi/src/vax/elfbsd.S +195 -0
- data/ext/ffi_c/libffi/src/vax/ffi.c +276 -0
- data/ext/ffi_c/libffi/src/vax/ffitarget.h +49 -0
- data/ext/ffi_c/libffi/src/wasm32/ffi.c +947 -0
- data/ext/ffi_c/libffi/src/wasm32/ffitarget.h +62 -0
- data/ext/ffi_c/libffi/src/x86/asmnames.h +30 -0
- data/ext/ffi_c/libffi/src/x86/ffi.c +690 -540
- data/ext/ffi_c/libffi/src/x86/ffi64.c +450 -126
- data/ext/ffi_c/libffi/src/x86/ffitarget.h +86 -42
- data/ext/ffi_c/libffi/src/x86/ffiw64.c +361 -0
- data/ext/ffi_c/libffi/src/x86/internal.h +43 -0
- data/ext/ffi_c/libffi/src/x86/internal64.h +36 -0
- data/ext/ffi_c/libffi/src/x86/sysv.S +1199 -381
- data/ext/ffi_c/libffi/src/x86/sysv_intel.S +998 -0
- data/ext/ffi_c/libffi/src/x86/unix64.S +587 -298
- data/ext/ffi_c/libffi/src/x86/win64.S +251 -457
- data/ext/ffi_c/libffi/src/x86/win64_intel.S +238 -0
- data/ext/ffi_c/libffi/src/xtensa/ffi.c +306 -0
- data/ext/ffi_c/libffi/src/xtensa/ffitarget.h +57 -0
- data/ext/ffi_c/libffi/src/xtensa/sysv.S +268 -0
- data/ext/ffi_c/libffi/stamp-h.in +1 -0
- data/ext/ffi_c/libffi/testsuite/Makefile.am +80 -73
- data/ext/ffi_c/libffi/testsuite/Makefile.in +251 -117
- data/ext/ffi_c/libffi/testsuite/emscripten/build-tests.sh +54 -0
- data/ext/ffi_c/libffi/testsuite/emscripten/build.sh +63 -0
- data/ext/ffi_c/libffi/testsuite/emscripten/conftest.py +86 -0
- data/ext/ffi_c/libffi/testsuite/emscripten/node-tests.sh +48 -0
- data/ext/ffi_c/libffi/testsuite/emscripten/test.html +7 -0
- data/ext/ffi_c/libffi/testsuite/emscripten/test_libffi.py +51 -0
- data/ext/ffi_c/libffi/testsuite/lib/libffi.exp +682 -0
- data/ext/ffi_c/libffi/testsuite/lib/target-libpath.exp +22 -2
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/Makefile +28 -0
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/README +78 -0
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/alignof.h +50 -0
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/bhaible.exp +63 -0
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-call.c +1746 -0
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-callback.c +2885 -0
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/testcases.c +747 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/align_mixed.c +46 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/align_stdcall.c +46 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/bpo_38748.c +41 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/call.exp +28 -10
- data/ext/ffi_c/libffi/testsuite/libffi.call/callback.c +99 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/callback2.c +108 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/callback3.c +114 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/callback4.c +119 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/err_bad_typedef.c +4 -3
- data/ext/ffi_c/libffi/testsuite/libffi.call/ffitest.h +88 -42
- data/ext/ffi_c/libffi/testsuite/libffi.call/float1.c +3 -1
- data/ext/ffi_c/libffi/testsuite/libffi.call/float2.c +15 -12
- data/ext/ffi_c/libffi/testsuite/libffi.call/float3.c +4 -2
- data/ext/ffi_c/libffi/testsuite/libffi.call/float_va.c +110 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/many.c +6 -16
- data/ext/ffi_c/libffi/testsuite/libffi.call/many2.c +57 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/many_double.c +70 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/many_mixed.c +78 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/negint.c +0 -1
- data/ext/ffi_c/libffi/testsuite/libffi.call/offsets.c +46 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/pr1172638.c +127 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl.c +1 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_ldl.c +1 -1
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_ll1.c +6 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_sc.c +1 -1
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_sl.c +4 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_uc.c +1 -1
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_ul.c +4 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/s55.c +60 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen.c +9 -10
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen2.c +49 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen3.c +49 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen4.c +55 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct1.c +9 -7
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct10.c +57 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct2.c +7 -7
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct3.c +7 -6
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct4.c +9 -8
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct5.c +9 -8
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct6.c +9 -9
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct7.c +9 -9
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct8.c +9 -8
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct9.c +9 -8
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_2.c +63 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_3.c +65 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_3f.c +65 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_4.c +67 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_4f.c +67 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_big.c +93 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_small.c +61 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_return_2H.c +63 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_return_8H.c +90 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/uninitialized.c +61 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c +78 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_2.c +220 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_3.c +154 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct1.c +134 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct2.c +134 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct3.c +140 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/closure.exp +67 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn0.c +3 -2
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn1.c +2 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn2.c +2 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn3.c +21 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn4.c +2 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn5.c +2 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn6.c +2 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_loc_fn0.c +7 -6
- data/ext/ffi_c/libffi/testsuite/{libffi.call/closure_stdcall.c → libffi.closures/closure_simple.c} +13 -16
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_12byte.c +22 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_16byte.c +26 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_18byte.c +28 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_19byte.c +33 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_1_1byte.c +8 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_20byte.c +23 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_20byte1.c +25 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_24byte.c +40 -8
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_2byte.c +17 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3_1byte.c +23 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3byte1.c +17 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3byte2.c +17 -4
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3float.c +113 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_4_1byte.c +26 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_4byte.c +17 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_5_1_byte.c +33 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_5byte.c +23 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_64byte.c +29 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_6_1_byte.c +32 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_6byte.c +28 -6
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_7_1_byte.c +43 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_7byte.c +29 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_8byte.c +18 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_9byte1.c +18 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_9byte2.c +18 -6
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_double.c +23 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_float.c +23 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble.c +24 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble_split.c +44 -31
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble_split2.c +44 -9
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_pointer.c +23 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint16.c +22 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint32.c +22 -7
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint64.c +23 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint16.c +22 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint32.c +23 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint64.c +24 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_dbls_struct.c +7 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_double_va.c +21 -9
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_float.c +4 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_longdouble.c +13 -3
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_longdouble_va.c +34 -11
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_many_mixed_args.c +70 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_many_mixed_float_double.c +55 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_schar.c +5 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_sshort.c +6 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_sshortchar.c +9 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_uchar.c +9 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_ushort.c +6 -2
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_ushortchar.c +9 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_pointer.c +7 -2
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_pointer_stack.c +22 -10
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_schar.c +3 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_sint.c +2 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_sshort.c +3 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_struct_va1.c +125 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uchar.c +3 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uint.c +4 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uint_va.c +49 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ulong_va.c +49 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ulonglong.c +8 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ushort.c +3 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/err_bad_abi.c +2 -3
- data/ext/ffi_c/libffi/testsuite/libffi.closures/ffitest.h +1 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/huge_struct.c +57 -56
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct.c +38 -15
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct1.c +9 -9
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct10.c +19 -6
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct11.c +137 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct12.c +86 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct13.c +115 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct2.c +15 -6
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct3.c +15 -6
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct4.c +14 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct5.c +14 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct6.c +17 -6
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct7.c +14 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct8.c +17 -6
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct9.c +17 -6
- data/ext/ffi_c/libffi/testsuite/libffi.closures/single_entry_structs1.c +86 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/single_entry_structs2.c +102 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/single_entry_structs3.c +101 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_large.c +7 -7
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_large2.c +7 -7
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_medium.c +6 -6
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_medium2.c +7 -6
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/testclosure.c +8 -3
- data/ext/ffi_c/libffi/testsuite/{libffi.special → libffi.closures}/unwindtest.cc +4 -10
- data/ext/ffi_c/libffi/testsuite/{libffi.special → libffi.closures}/unwindtest_ffi_call.cc +4 -2
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex.inc +91 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex.inc +42 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct.inc +71 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va.inc +80 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_float.c +16 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.special/special.exp → libffi.complex/complex.exp} +9 -10
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex.inc +51 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_double.inc +7 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_float.inc +7 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_longdouble.inc +7 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_int.c +86 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/ffitest.h +1 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex.inc +78 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex.inc +37 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1.inc +41 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2.inc +44 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.go/aa-direct.c +34 -0
- data/ext/ffi_c/libffi/testsuite/libffi.go/closure1.c +28 -0
- data/ext/ffi_c/libffi/testsuite/libffi.go/ffitest.h +1 -0
- data/ext/ffi_c/libffi/testsuite/libffi.go/go.exp +36 -0
- data/ext/ffi_c/libffi/testsuite/libffi.go/static-chain.h +19 -0
- data/ext/ffi_c/libffi.bsd.mk +14 -8
- data/ext/ffi_c/libffi.darwin.mk +56 -26
- data/ext/ffi_c/libffi.gnu.mk +9 -6
- data/ext/ffi_c/libffi.mk +13 -8
- data/ext/ffi_c/libffi.vc.mk +26 -0
- data/ext/ffi_c/libffi.vc64.mk +26 -0
- data/ext/ffi_c/rbffi.h +34 -6
- data/ext/ffi_c/{endian.h → rbffi_endian.h} +21 -2
- data/ffi.gemspec +42 -0
- data/lib/ffi/abstract_memory.rb +44 -0
- data/lib/ffi/autopointer.rb +111 -52
- data/lib/ffi/compat.rb +43 -0
- data/lib/ffi/data_converter.rb +67 -0
- data/lib/ffi/dynamic_library.rb +118 -0
- data/lib/ffi/enum.rb +203 -22
- data/lib/ffi/errno.rb +27 -12
- data/lib/ffi/ffi.rb +88 -11
- data/lib/ffi/function.rb +71 -0
- data/lib/ffi/io.rb +35 -14
- data/lib/ffi/library.rb +382 -96
- data/lib/ffi/library_path.rb +109 -0
- data/lib/ffi/managedstruct.rb +64 -35
- data/lib/ffi/memorypointer.rb +1 -33
- data/lib/ffi/platform/aarch64-darwin/types.conf +130 -0
- data/lib/ffi/platform/aarch64-freebsd/types.conf +128 -0
- data/lib/ffi/platform/aarch64-freebsd12/types.conf +181 -0
- data/lib/ffi/platform/aarch64-linux/types.conf +175 -0
- data/lib/ffi/platform/aarch64-openbsd/types.conf +134 -0
- data/lib/ffi/platform/aarch64-windows/types.conf +52 -0
- data/lib/ffi/platform/arm-freebsd/types.conf +152 -0
- data/lib/ffi/platform/arm-freebsd12/types.conf +152 -0
- data/lib/ffi/platform/arm-linux/types.conf +132 -0
- data/lib/ffi/platform/hppa1.1-linux/types.conf +178 -0
- data/lib/ffi/platform/hppa2.0-linux/types.conf +178 -0
- data/lib/ffi/platform/i386-cygwin/types.conf +3 -0
- data/lib/ffi/platform/i386-darwin/types.conf +100 -0
- data/lib/ffi/platform/i386-freebsd/types.conf +152 -0
- data/lib/ffi/platform/i386-freebsd12/types.conf +152 -0
- data/lib/ffi/platform/i386-gnu/types.conf +107 -0
- data/lib/ffi/platform/i386-linux/types.conf +103 -0
- data/lib/ffi/platform/i386-netbsd/types.conf +126 -0
- data/lib/ffi/platform/i386-openbsd/types.conf +128 -0
- data/lib/ffi/platform/i386-solaris/types.conf +122 -0
- data/lib/ffi/platform/i386-windows/types.conf +52 -0
- data/lib/ffi/platform/ia64-linux/types.conf +104 -0
- data/lib/ffi/platform/loongarch64-linux/types.conf +141 -0
- data/lib/ffi/platform/mips-linux/types.conf +102 -0
- data/lib/ffi/platform/mips64-linux/types.conf +104 -0
- data/lib/ffi/platform/mips64el-linux/types.conf +104 -0
- data/lib/ffi/platform/mipsel-linux/types.conf +102 -0
- data/lib/ffi/platform/mipsisa32r6-linux/types.conf +102 -0
- data/lib/ffi/platform/mipsisa32r6el-linux/types.conf +102 -0
- data/lib/ffi/platform/mipsisa64r6-linux/types.conf +104 -0
- data/lib/ffi/platform/mipsisa64r6el-linux/types.conf +104 -0
- data/lib/ffi/platform/powerpc-aix/types.conf +180 -0
- data/lib/ffi/platform/powerpc-darwin/types.conf +100 -0
- data/lib/ffi/platform/powerpc-linux/types.conf +130 -0
- data/lib/ffi/platform/powerpc-openbsd/types.conf +156 -0
- data/lib/ffi/platform/powerpc64-linux/types.conf +104 -0
- data/lib/ffi/platform/powerpc64le-linux/types.conf +100 -0
- data/lib/ffi/platform/riscv64-linux/types.conf +104 -0
- data/lib/ffi/platform/s390-linux/types.conf +102 -0
- data/lib/ffi/platform/s390x-linux/types.conf +102 -0
- data/lib/ffi/platform/sparc-linux/types.conf +102 -0
- data/lib/ffi/platform/sparc-solaris/types.conf +128 -0
- data/lib/ffi/platform/sparcv9-linux/types.conf +102 -0
- data/lib/ffi/platform/sparcv9-openbsd/types.conf +156 -0
- data/lib/ffi/platform/sparcv9-solaris/types.conf +128 -0
- data/lib/ffi/platform/sw_64-linux/types.conf +141 -0
- data/lib/ffi/platform/x86_64-cygwin/types.conf +3 -0
- data/lib/ffi/platform/x86_64-darwin/types.conf +130 -0
- data/lib/ffi/platform/x86_64-dragonflybsd/types.conf +130 -0
- data/lib/ffi/platform/x86_64-freebsd/types.conf +128 -0
- data/lib/ffi/platform/x86_64-freebsd12/types.conf +158 -0
- data/lib/ffi/platform/x86_64-haiku/types.conf +117 -0
- data/lib/ffi/platform/x86_64-linux/types.conf +132 -0
- data/lib/ffi/platform/x86_64-msys/types.conf +119 -0
- data/lib/ffi/platform/x86_64-netbsd/types.conf +128 -0
- data/lib/ffi/platform/x86_64-openbsd/types.conf +134 -0
- data/lib/ffi/platform/x86_64-solaris/types.conf +122 -0
- data/lib/ffi/platform/x86_64-windows/types.conf +52 -0
- data/lib/ffi/platform.rb +110 -34
- data/lib/ffi/pointer.rb +117 -90
- data/lib/ffi/struct.rb +101 -70
- data/lib/ffi/struct_by_reference.rb +72 -0
- data/lib/ffi/struct_layout.rb +96 -0
- data/lib/ffi/struct_layout_builder.rb +90 -21
- data/lib/ffi/tools/const_generator.rb +86 -31
- data/lib/ffi/tools/generator.rb +49 -2
- data/lib/ffi/tools/generator_task.rb +13 -16
- data/lib/ffi/tools/struct_generator.rb +6 -5
- data/lib/ffi/tools/types_generator.rb +25 -11
- data/lib/ffi/types.rb +105 -36
- data/lib/ffi/union.rb +23 -12
- data/lib/ffi/variadic.rb +44 -29
- data/lib/ffi/version.rb +3 -0
- data/lib/ffi.rb +25 -9
- data/rakelib/ffi_gem_helper.rb +65 -0
- data/samples/getlogin.rb +8 -0
- data/samples/getpid.rb +8 -0
- data/samples/gettimeofday.rb +18 -0
- data/samples/hello.rb +8 -0
- data/samples/hello_ractor.rb +11 -0
- data/samples/inotify.rb +60 -0
- data/samples/pty.rb +75 -0
- data/samples/qsort.rb +20 -0
- data/samples/qsort_ractor.rb +28 -0
- data/sig/ffi/abstract_memory.rbs +165 -0
- data/sig/ffi/auto_pointer.rbs +26 -0
- data/sig/ffi/buffer.rbs +18 -0
- data/sig/ffi/data_converter.rbs +10 -0
- data/sig/ffi/dynamic_library.rbs +9 -0
- data/sig/ffi/enum.rbs +38 -0
- data/sig/ffi/function.rbs +39 -0
- data/sig/ffi/library.rbs +42 -0
- data/sig/ffi/native_type.rbs +86 -0
- data/sig/ffi/pointer.rbs +42 -0
- data/sig/ffi/struct.rbs +76 -0
- data/sig/ffi/struct_by_reference.rbs +11 -0
- data/sig/ffi/struct_by_value.rbs +7 -0
- data/sig/ffi/struct_layout.rbs +9 -0
- data/sig/ffi/struct_layout_builder.rbs +5 -0
- data/sig/ffi/type.rbs +39 -0
- data/sig/ffi.rbs +26 -0
- data.tar.gz.sig +0 -0
- metadata +547 -248
- metadata.gz.sig +0 -0
- data/History.txt +0 -109
- data/README.rdoc +0 -70
- data/ext/ffi_c/DataConverter.c +0 -62
- data/ext/ffi_c/StructByReference.c +0 -150
- data/ext/ffi_c/StructByReference.h +0 -50
- data/ext/ffi_c/libffi/ChangeLog.libffi +0 -658
- data/ext/ffi_c/libffi/ChangeLog.libgcj +0 -40
- data/ext/ffi_c/libffi/ChangeLog.v1 +0 -764
- data/ext/ffi_c/libffi/README +0 -306
- data/ext/ffi_c/libffi/aclocal.m4 +0 -8998
- data/ext/ffi_c/libffi/depcomp +0 -584
- data/ext/ffi_c/libffi/doc/libffi.info +0 -533
- data/ext/ffi_c/libffi/doc/stamp-vti +0 -4
- data/ext/ffi_c/libffi/m4/libtool.m4 +0 -7360
- data/ext/ffi_c/libffi/m4/ltoptions.m4 +0 -368
- data/ext/ffi_c/libffi/m4/ltsugar.m4 +0 -123
- data/ext/ffi_c/libffi/m4/ltversion.m4 +0 -23
- data/ext/ffi_c/libffi/m4/lt~obsolete.m4 +0 -92
- data/ext/ffi_c/libffi/mdate-sh +0 -201
- data/ext/ffi_c/libffi/src/x86/darwin.S +0 -444
- data/ext/ffi_c/libffi/src/x86/darwin64.S +0 -416
- data/ext/ffi_c/libffi/src/x86/freebsd.S +0 -458
- data/ext/ffi_c/libffi/src/x86/win32.S +0 -877
- data/ext/ffi_c/libffi/testsuite/lib/libffi-dg.exp +0 -300
- data/ext/ffi_c/libffi/testsuite/libffi.call/many_win32.c +0 -63
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen_win32.c +0 -44
- data/ext/ffi_c/libffi/testsuite/libffi.special/ffitestcxx.h +0 -96
- data/ext/ffi_c/libffi/texinfo.tex +0 -7210
- data/gen/Rakefile +0 -14
- data/spec/ffi/async_callback_spec.rb +0 -23
- data/spec/ffi/bool_spec.rb +0 -24
- data/spec/ffi/buffer_spec.rb +0 -202
- data/spec/ffi/callback_spec.rb +0 -653
- data/spec/ffi/custom_param_type.rb +0 -31
- data/spec/ffi/custom_type_spec.rb +0 -73
- data/spec/ffi/enum_spec.rb +0 -183
- data/spec/ffi/errno_spec.rb +0 -13
- data/spec/ffi/ffi_spec.rb +0 -24
- data/spec/ffi/function_spec.rb +0 -73
- data/spec/ffi/library_spec.rb +0 -174
- data/spec/ffi/managed_struct_spec.rb +0 -56
- data/spec/ffi/number_spec.rb +0 -231
- data/spec/ffi/pointer_spec.rb +0 -210
- data/spec/ffi/rbx/attach_function_spec.rb +0 -28
- data/spec/ffi/rbx/memory_pointer_spec.rb +0 -109
- data/spec/ffi/rbx/spec_helper.rb +0 -1
- data/spec/ffi/rbx/struct_spec.rb +0 -13
- data/spec/ffi/spec_helper.rb +0 -21
- data/spec/ffi/string_spec.rb +0 -103
- data/spec/ffi/strptr_spec.rb +0 -36
- data/spec/ffi/struct_callback_spec.rb +0 -64
- data/spec/ffi/struct_initialize_spec.rb +0 -30
- data/spec/ffi/struct_packed_spec.rb +0 -46
- data/spec/ffi/struct_spec.rb +0 -638
- data/spec/ffi/typedef_spec.rb +0 -62
- data/spec/ffi/union_spec.rb +0 -60
- data/spec/ffi/variadic_spec.rb +0 -84
- data/spec/spec.opts +0 -4
- data/tasks/ann.rake +0 -80
- data/tasks/extension.rake +0 -25
- data/tasks/gem.rake +0 -200
- data/tasks/git.rake +0 -41
- data/tasks/notes.rake +0 -27
- data/tasks/post_load.rake +0 -34
- data/tasks/rdoc.rake +0 -50
- data/tasks/rubyforge.rake +0 -55
- data/tasks/setup.rb +0 -301
- data/tasks/spec.rake +0 -54
- data/tasks/svn.rake +0 -47
- data/tasks/test.rake +0 -40
- /data/ext/ffi_c/libffi/testsuite/libffi.call/{pyobjc-tc.c → pyobjc_tc.c} +0 -0
- /data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_double.c +0 -0
- /data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/problem1.c +0 -0
@@ -1,7 +1,8 @@
|
|
1
1
|
\input texinfo @c -*-texinfo-*-
|
2
2
|
@c %**start of header
|
3
3
|
@setfilename libffi.info
|
4
|
-
@
|
4
|
+
@include version.texi
|
5
|
+
@settitle libffi: the portable foreign function interface library
|
5
6
|
@setchapternewpage off
|
6
7
|
@c %**end of header
|
7
8
|
|
@@ -12,32 +13,43 @@
|
|
12
13
|
@syncodeindex pg cp
|
13
14
|
@syncodeindex tp cp
|
14
15
|
|
15
|
-
@include version.texi
|
16
|
-
|
17
16
|
@copying
|
18
17
|
|
19
|
-
This manual is for
|
18
|
+
This manual is for libffi, a portable foreign function interface
|
20
19
|
library.
|
21
20
|
|
22
|
-
Copyright @copyright{} 2008 Red Hat, Inc.
|
21
|
+
Copyright @copyright{} 2008--2024 Anthony Green and Red Hat, Inc.
|
23
22
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
23
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
24
|
+
a copy of this software and associated documentation files (the
|
25
|
+
``Software''), to deal in the Software without restriction, including
|
26
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
27
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
28
|
+
permit persons to whom the Software is furnished to do so, subject to
|
29
|
+
the following conditions:
|
30
|
+
|
31
|
+
The above copyright notice and this permission notice shall be
|
32
|
+
included in all copies or substantial portions of the Software.
|
33
|
+
|
34
|
+
THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
|
35
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
36
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
37
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
38
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
39
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
40
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
30
41
|
|
31
|
-
@end quotation
|
32
42
|
@end copying
|
33
43
|
|
34
44
|
@dircategory Development
|
35
45
|
@direntry
|
36
|
-
* libffi: (libffi). Portable foreign
|
46
|
+
* libffi: (libffi). Portable foreign function interface library.
|
37
47
|
@end direntry
|
38
48
|
|
39
49
|
@titlepage
|
40
|
-
@title
|
50
|
+
@title libffi: a foreign function interface library
|
51
|
+
@subtitle For Version @value{VERSION} of libffi
|
52
|
+
@author Anthony Green
|
41
53
|
@page
|
42
54
|
@vskip 0pt plus 1filll
|
43
55
|
@insertcopying
|
@@ -53,6 +65,7 @@ section entitled ``GNU General Public License''.
|
|
53
65
|
@menu
|
54
66
|
* Introduction:: What is libffi?
|
55
67
|
* Using libffi:: How to use libffi.
|
68
|
+
* Memory Usage:: Where memory for closures comes from.
|
56
69
|
* Missing Features:: Things libffi can't do.
|
57
70
|
* Index:: Index.
|
58
71
|
@end menu
|
@@ -78,10 +91,10 @@ sometimes called the @dfn{ABI} or @dfn{Application Binary Interface}.
|
|
78
91
|
Some programs may not know at the time of compilation what arguments
|
79
92
|
are to be passed to a function. For instance, an interpreter may be
|
80
93
|
told at run-time about the number and types of arguments used to call
|
81
|
-
a given function. @
|
94
|
+
a given function. @code{libffi} can be used in such programs to
|
82
95
|
provide a bridge from the interpreter program to compiled code.
|
83
96
|
|
84
|
-
The @
|
97
|
+
The @code{libffi} library provides a portable, high level programming
|
85
98
|
interface to various calling conventions. This allows a programmer to
|
86
99
|
call any function specified by a call interface description at run
|
87
100
|
time.
|
@@ -89,9 +102,9 @@ time.
|
|
89
102
|
@acronym{FFI} stands for Foreign Function Interface. A foreign
|
90
103
|
function interface is the popular name for the interface that allows
|
91
104
|
code written in one language to call code written in another language.
|
92
|
-
The @
|
105
|
+
The @code{libffi} library really only provides the lowest, machine
|
93
106
|
dependent layer of a fully featured foreign function interface. A
|
94
|
-
layer must exist above @
|
107
|
+
layer must exist above @code{libffi} that handles type conversions for
|
95
108
|
values passed between the two languages.
|
96
109
|
@cindex FFI
|
97
110
|
@cindex Foreign Function Interface
|
@@ -106,13 +119,15 @@ values passed between the two languages.
|
|
106
119
|
* Types:: libffi type descriptions.
|
107
120
|
* Multiple ABIs:: Different passing styles on one platform.
|
108
121
|
* The Closure API:: Writing a generic function.
|
122
|
+
* Closure Example:: A closure example.
|
123
|
+
* Thread Safety:: Thread safety.
|
109
124
|
@end menu
|
110
125
|
|
111
126
|
|
112
127
|
@node The Basics
|
113
128
|
@section The Basics
|
114
129
|
|
115
|
-
@
|
130
|
+
@code{libffi} assumes that you have a pointer to the function you wish
|
116
131
|
to call and that you know the number and types of arguments to pass
|
117
132
|
it, as well as the return type of the function.
|
118
133
|
|
@@ -132,8 +147,6 @@ This initializes @var{cif} according to the given parameters.
|
|
132
147
|
you want. @ref{Multiple ABIs} for more information.
|
133
148
|
|
134
149
|
@var{nargs} is the number of arguments that this function accepts.
|
135
|
-
@samp{libffi} does not yet handle varargs functions; see @ref{Missing
|
136
|
-
Features} for more information.
|
137
150
|
|
138
151
|
@var{rtype} is a pointer to an @code{ffi_type} structure that
|
139
152
|
describes the return type of the function. @xref{Types}.
|
@@ -149,6 +162,39 @@ objects is incorrect; or @code{FFI_BAD_ABI} if the @var{abi} parameter
|
|
149
162
|
is invalid.
|
150
163
|
@end defun
|
151
164
|
|
165
|
+
If the function being called is variadic (varargs) then
|
166
|
+
@code{ffi_prep_cif_var} must be used instead of @code{ffi_prep_cif}.
|
167
|
+
|
168
|
+
@findex ffi_prep_cif_var
|
169
|
+
@defun ffi_status ffi_prep_cif_var (ffi_cif *@var{cif}, ffi_abi @var{abi}, unsigned int @var{nfixedargs}, unsigned int @var{ntotalargs}, ffi_type *@var{rtype}, ffi_type **@var{argtypes})
|
170
|
+
This initializes @var{cif} according to the given parameters for
|
171
|
+
a call to a variadic function. In general its operation is the
|
172
|
+
same as for @code{ffi_prep_cif} except that:
|
173
|
+
|
174
|
+
@var{nfixedargs} is the number of fixed arguments, prior to any
|
175
|
+
variadic arguments. It must be greater than zero.
|
176
|
+
|
177
|
+
@var{ntotalargs} the total number of arguments, including variadic
|
178
|
+
and fixed arguments. @var{argtypes} must have this many elements.
|
179
|
+
|
180
|
+
@code{ffi_prep_cif_var} will return @code{FFI_BAD_ARGTYPE} if any of
|
181
|
+
the variable argument types are @code{ffi_type_float} (promote to
|
182
|
+
@code{ffi_type_double} first), or any integer type small than an int
|
183
|
+
(promote to an int-sized type first).
|
184
|
+
|
185
|
+
Note that, different cif's must be prepped for calls to the same
|
186
|
+
function when different numbers of arguments are passed.
|
187
|
+
|
188
|
+
Also note that a call to @code{ffi_prep_cif_var} with
|
189
|
+
@var{nfixedargs}=@var{nototalargs} is NOT equivalent to a call to
|
190
|
+
@code{ffi_prep_cif}.
|
191
|
+
|
192
|
+
@end defun
|
193
|
+
|
194
|
+
Note that the resulting @code{ffi_cif} holds pointers to all the
|
195
|
+
@code{ffi_type} objects that were used during initialization. You
|
196
|
+
must ensure that these type objects have a lifetime at least as long
|
197
|
+
as that of the @code{ffi_cif}.
|
152
198
|
|
153
199
|
To call a function using an initialized @code{ffi_cif}, use the
|
154
200
|
@code{ffi_call} function:
|
@@ -161,16 +207,33 @@ This calls the function @var{fn} according to the description given in
|
|
161
207
|
|
162
208
|
@var{rvalue} is a pointer to a chunk of memory that will hold the
|
163
209
|
result of the function call. This must be large enough to hold the
|
164
|
-
result
|
210
|
+
result, no smaller than the system register size (generally 32 or 64
|
211
|
+
bits), and must be suitably aligned; it is the caller's responsibility
|
165
212
|
to ensure this. If @var{cif} declares that the function returns
|
166
213
|
@code{void} (using @code{ffi_type_void}), then @var{rvalue} is
|
167
|
-
ignored.
|
168
|
-
|
214
|
+
ignored.
|
215
|
+
|
216
|
+
In most situations, @code{libffi} will handle promotion according to
|
217
|
+
the ABI. However, for historical reasons, there is a special case
|
218
|
+
with return values that must be handled by your code. In particular,
|
219
|
+
for integral (not @code{struct}) types that are narrower than the
|
220
|
+
system register size, the return value will be widened by
|
221
|
+
@code{libffi}. @code{libffi} provides a type, @code{ffi_arg}, that
|
222
|
+
can be used as the return type. For example, if the CIF was defined
|
223
|
+
with a return type of @code{char}, @code{libffi} will try to store a
|
224
|
+
full @code{ffi_arg} into the return value.
|
169
225
|
|
170
226
|
@var{avalues} is a vector of @code{void *} pointers that point to the
|
171
227
|
memory locations holding the argument values for a call. If @var{cif}
|
172
228
|
declares that the function has no arguments (i.e., @var{nargs} was 0),
|
173
229
|
then @var{avalues} is ignored.
|
230
|
+
|
231
|
+
Note that while the return value must be register-sized, arguments
|
232
|
+
should exactly match their declared type. For example, if an argument
|
233
|
+
is a @code{short}, then the entry in @var{avalues} should point to an
|
234
|
+
object declared as @code{short}; but if the return type is
|
235
|
+
@code{short}, then @var{rvalue} should point to an object declared as
|
236
|
+
a larger type -- usually @code{ffi_arg}.
|
174
237
|
@end defun
|
175
238
|
|
176
239
|
|
@@ -189,27 +252,27 @@ int main()
|
|
189
252
|
ffi_type *args[1];
|
190
253
|
void *values[1];
|
191
254
|
char *s;
|
192
|
-
|
193
|
-
|
194
|
-
/* Initialize the argument info vectors */
|
255
|
+
ffi_arg rc;
|
256
|
+
|
257
|
+
/* Initialize the argument info vectors */
|
195
258
|
args[0] = &ffi_type_pointer;
|
196
259
|
values[0] = &s;
|
197
|
-
|
260
|
+
|
198
261
|
/* Initialize the cif */
|
199
|
-
if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
|
200
|
-
&
|
262
|
+
if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
|
263
|
+
&ffi_type_sint, args) == FFI_OK)
|
201
264
|
@{
|
202
265
|
s = "Hello World!";
|
203
266
|
ffi_call(&cif, puts, &rc, values);
|
204
267
|
/* rc now holds the result of the call to puts */
|
205
|
-
|
206
|
-
/* values holds a pointer to the function's arg, so to
|
207
|
-
call puts() again all we need to do is change the
|
268
|
+
|
269
|
+
/* values holds a pointer to the function's arg, so to
|
270
|
+
call puts() again all we need to do is change the
|
208
271
|
value of s */
|
209
272
|
s = "This is cool!";
|
210
273
|
ffi_call(&cif, puts, &rc, values);
|
211
274
|
@}
|
212
|
-
|
275
|
+
|
213
276
|
return 0;
|
214
277
|
@}
|
215
278
|
@end example
|
@@ -221,7 +284,11 @@ int main()
|
|
221
284
|
@menu
|
222
285
|
* Primitive Types:: Built-in types.
|
223
286
|
* Structures:: Structure types.
|
287
|
+
* Size and Alignment:: Size and alignment of types.
|
288
|
+
* Arrays Unions Enums:: Arrays, unions, and enumerations.
|
224
289
|
* Type Example:: Structure type example.
|
290
|
+
* Complex:: Complex types.
|
291
|
+
* Complex Type Example:: Complex type example.
|
225
292
|
@end menu
|
226
293
|
|
227
294
|
@node Primitive Types
|
@@ -320,6 +387,20 @@ On other platforms, it is not.
|
|
320
387
|
@tindex ffi_type_pointer
|
321
388
|
A generic @code{void *} pointer. You should use this for all
|
322
389
|
pointers, regardless of their real type.
|
390
|
+
|
391
|
+
@item ffi_type_complex_float
|
392
|
+
@tindex ffi_type_complex_float
|
393
|
+
The C @code{_Complex float} type.
|
394
|
+
|
395
|
+
@item ffi_type_complex_double
|
396
|
+
@tindex ffi_type_complex_double
|
397
|
+
The C @code{_Complex double} type.
|
398
|
+
|
399
|
+
@item ffi_type_complex_longdouble
|
400
|
+
@tindex ffi_type_complex_longdouble
|
401
|
+
The C @code{_Complex long double} type.
|
402
|
+
On platforms that have a C @code{long double} type, this is defined.
|
403
|
+
On other platforms, it is not.
|
323
404
|
@end table
|
324
405
|
|
325
406
|
Each of these is of type @code{ffi_type}, so you must take the address
|
@@ -329,13 +410,12 @@ when passing to @code{ffi_prep_cif}.
|
|
329
410
|
@node Structures
|
330
411
|
@subsection Structures
|
331
412
|
|
332
|
-
|
333
|
-
|
334
|
-
You must first describe the structure to @samp{libffi} by creating a
|
413
|
+
@code{libffi} is perfectly happy passing structures back and forth.
|
414
|
+
You must first describe the structure to @code{libffi} by creating a
|
335
415
|
new @code{ffi_type} object for it.
|
336
416
|
|
337
417
|
@tindex ffi_type
|
338
|
-
@deftp ffi_type
|
418
|
+
@deftp {Data type} ffi_type
|
339
419
|
The @code{ffi_type} has the following members:
|
340
420
|
@table @code
|
341
421
|
@item size_t size
|
@@ -350,9 +430,166 @@ For a structure, this should be set to @code{FFI_TYPE_STRUCT}.
|
|
350
430
|
@item ffi_type **elements
|
351
431
|
This is a @samp{NULL}-terminated array of pointers to @code{ffi_type}
|
352
432
|
objects. There is one element per field of the struct.
|
433
|
+
|
434
|
+
Note that @code{libffi} has no special support for bit-fields. You
|
435
|
+
must manage these manually.
|
353
436
|
@end table
|
354
437
|
@end deftp
|
355
438
|
|
439
|
+
The @code{size} and @code{alignment} fields will be filled in by
|
440
|
+
@code{ffi_prep_cif} or @code{ffi_prep_cif_var}, as needed.
|
441
|
+
|
442
|
+
@node Size and Alignment
|
443
|
+
@subsection Size and Alignment
|
444
|
+
|
445
|
+
@code{libffi} will set the @code{size} and @code{alignment} fields of
|
446
|
+
an @code{ffi_type} object for you. It does so using its knowledge of
|
447
|
+
the ABI.
|
448
|
+
|
449
|
+
You might expect that you can simply read these fields for a type that
|
450
|
+
has been laid out by @code{libffi}. However, there are some caveats.
|
451
|
+
|
452
|
+
@itemize @bullet
|
453
|
+
@item
|
454
|
+
The size or alignment of some of the built-in types may vary depending
|
455
|
+
on the chosen ABI.
|
456
|
+
|
457
|
+
@item
|
458
|
+
The size and alignment of a new structure type will not be set by
|
459
|
+
@code{libffi} until it has been passed to @code{ffi_prep_cif} or
|
460
|
+
@code{ffi_get_struct_offsets}.
|
461
|
+
|
462
|
+
@item
|
463
|
+
A structure type cannot be shared across ABIs. Instead each ABI needs
|
464
|
+
its own copy of the structure type.
|
465
|
+
@end itemize
|
466
|
+
|
467
|
+
So, before examining these fields, it is safest to pass the
|
468
|
+
@code{ffi_type} object to @code{ffi_prep_cif} or
|
469
|
+
@code{ffi_get_struct_offsets} first. This function will do all the
|
470
|
+
needed setup.
|
471
|
+
|
472
|
+
@example
|
473
|
+
ffi_type *desired_type;
|
474
|
+
ffi_abi desired_abi;
|
475
|
+
@dots{}
|
476
|
+
ffi_cif cif;
|
477
|
+
if (ffi_prep_cif (&cif, desired_abi, 0, desired_type, NULL) == FFI_OK)
|
478
|
+
@{
|
479
|
+
size_t size = desired_type->size;
|
480
|
+
unsigned short alignment = desired_type->alignment;
|
481
|
+
@}
|
482
|
+
@end example
|
483
|
+
|
484
|
+
@code{libffi} also provides a way to get the offsets of the members of
|
485
|
+
a structure.
|
486
|
+
|
487
|
+
@findex ffi_get_struct_offsets
|
488
|
+
@defun ffi_status ffi_get_struct_offsets (ffi_abi abi, ffi_type *struct_type, size_t *offsets)
|
489
|
+
Compute the offset of each element of the given structure type.
|
490
|
+
@var{abi} is the ABI to use; this is needed because in some cases the
|
491
|
+
layout depends on the ABI.
|
492
|
+
|
493
|
+
@var{offsets} is an out parameter. The caller is responsible for
|
494
|
+
providing enough space for all the results to be written -- one
|
495
|
+
element per element type in @var{struct_type}. If @var{offsets} is
|
496
|
+
@code{NULL}, then the type will be laid out but not otherwise
|
497
|
+
modified. This can be useful for accessing the type's size or layout,
|
498
|
+
as mentioned above.
|
499
|
+
|
500
|
+
This function returns @code{FFI_OK} on success; @code{FFI_BAD_ABI} if
|
501
|
+
@var{abi} is invalid; or @code{FFI_BAD_TYPEDEF} if @var{struct_type}
|
502
|
+
is invalid in some way. Note that only @code{FFI_STRUCT} types are
|
503
|
+
valid here.
|
504
|
+
@end defun
|
505
|
+
|
506
|
+
@node Arrays Unions Enums
|
507
|
+
@subsection Arrays, Unions, and Enumerations
|
508
|
+
|
509
|
+
@subsubsection Arrays
|
510
|
+
|
511
|
+
@code{libffi} does not have direct support for arrays or unions.
|
512
|
+
However, they can be emulated using structures.
|
513
|
+
|
514
|
+
To emulate an array, simply create an @code{ffi_type} using
|
515
|
+
@code{FFI_TYPE_STRUCT} with as many members as there are elements in
|
516
|
+
the array.
|
517
|
+
|
518
|
+
@example
|
519
|
+
ffi_type array_type;
|
520
|
+
ffi_type **elements
|
521
|
+
int i;
|
522
|
+
|
523
|
+
elements = malloc ((n + 1) * sizeof (ffi_type *));
|
524
|
+
for (i = 0; i < n; ++i)
|
525
|
+
elements[i] = array_element_type;
|
526
|
+
elements[n] = NULL;
|
527
|
+
|
528
|
+
array_type.size = array_type.alignment = 0;
|
529
|
+
array_type.type = FFI_TYPE_STRUCT;
|
530
|
+
array_type.elements = elements;
|
531
|
+
@end example
|
532
|
+
|
533
|
+
Note that arrays cannot be passed or returned by value in C --
|
534
|
+
structure types created like this should only be used to refer to
|
535
|
+
members of real @code{FFI_TYPE_STRUCT} objects.
|
536
|
+
|
537
|
+
However, a phony array type like this will not cause any errors from
|
538
|
+
@code{libffi} if you use it as an argument or return type. This may
|
539
|
+
be confusing.
|
540
|
+
|
541
|
+
@subsubsection Unions
|
542
|
+
|
543
|
+
A union can also be emulated using @code{FFI_TYPE_STRUCT}. In this
|
544
|
+
case, however, you must make sure that the size and alignment match
|
545
|
+
the real requirements of the union.
|
546
|
+
|
547
|
+
One simple way to do this is to ensue that each element type is laid
|
548
|
+
out. Then, give the new structure type a single element; the size of
|
549
|
+
the largest element; and the largest alignment seen as well.
|
550
|
+
|
551
|
+
This example uses the @code{ffi_prep_cif} trick to ensure that each
|
552
|
+
element type is laid out.
|
553
|
+
|
554
|
+
@example
|
555
|
+
ffi_abi desired_abi;
|
556
|
+
ffi_type union_type;
|
557
|
+
ffi_type **union_elements;
|
558
|
+
|
559
|
+
int i;
|
560
|
+
ffi_type element_types[2];
|
561
|
+
|
562
|
+
element_types[1] = NULL;
|
563
|
+
|
564
|
+
union_type.size = union_type.alignment = 0;
|
565
|
+
union_type.type = FFI_TYPE_STRUCT;
|
566
|
+
union_type.elements = element_types;
|
567
|
+
|
568
|
+
for (i = 0; union_elements[i]; ++i)
|
569
|
+
@{
|
570
|
+
ffi_cif cif;
|
571
|
+
if (ffi_prep_cif (&cif, desired_abi, 0, union_elements[i], NULL) == FFI_OK)
|
572
|
+
@{
|
573
|
+
if (union_elements[i]->size > union_type.size)
|
574
|
+
@{
|
575
|
+
union_type.size = union_elements[i];
|
576
|
+
size = union_elements[i]->size;
|
577
|
+
@}
|
578
|
+
if (union_elements[i]->alignment > union_type.alignment)
|
579
|
+
union_type.alignment = union_elements[i]->alignment;
|
580
|
+
@}
|
581
|
+
@}
|
582
|
+
@end example
|
583
|
+
|
584
|
+
@subsubsection Enumerations
|
585
|
+
|
586
|
+
@code{libffi} does not have any special support for C @code{enum}s.
|
587
|
+
Although any given @code{enum} is implemented using a specific
|
588
|
+
underlying integral type, exactly which type will be used cannot be
|
589
|
+
determined by @code{libffi} -- it may depend on the values in the
|
590
|
+
enumeration or on compiler flags such as @option{-fshort-enums}.
|
591
|
+
@xref{Structures unions enumerations and bit-fields implementation, , , gcc},
|
592
|
+
for more information about how GCC handles enumerations.
|
356
593
|
|
357
594
|
@node Type Example
|
358
595
|
@subsection Type Example
|
@@ -389,8 +626,9 @@ Here is the corresponding code to describe this struct to
|
|
389
626
|
int i;
|
390
627
|
|
391
628
|
tm_type.size = tm_type.alignment = 0;
|
629
|
+
tm_type.type = FFI_TYPE_STRUCT;
|
392
630
|
tm_type.elements = &tm_type_elements;
|
393
|
-
|
631
|
+
|
394
632
|
for (i = 0; i < 9; i++)
|
395
633
|
tm_type_elements[i] = &ffi_type_sint;
|
396
634
|
|
@@ -403,6 +641,135 @@ Here is the corresponding code to describe this struct to
|
|
403
641
|
@}
|
404
642
|
@end example
|
405
643
|
|
644
|
+
@node Complex
|
645
|
+
@subsection Complex Types
|
646
|
+
|
647
|
+
@code{libffi} supports the complex types defined by the C99
|
648
|
+
standard (@code{_Complex float}, @code{_Complex double} and
|
649
|
+
@code{_Complex long double} with the built-in type descriptors
|
650
|
+
@code{ffi_type_complex_float}, @code{ffi_type_complex_double} and
|
651
|
+
@code{ffi_type_complex_longdouble}.
|
652
|
+
|
653
|
+
Custom complex types like @code{_Complex int} can also be used.
|
654
|
+
An @code{ffi_type} object has to be defined to describe the
|
655
|
+
complex type to @code{libffi}.
|
656
|
+
|
657
|
+
@tindex ffi_type
|
658
|
+
@deftp {Data type} ffi_type
|
659
|
+
@table @code
|
660
|
+
@item size_t size
|
661
|
+
This must be manually set to the size of the complex type.
|
662
|
+
|
663
|
+
@item unsigned short alignment
|
664
|
+
This must be manually set to the alignment of the complex type.
|
665
|
+
|
666
|
+
@item unsigned short type
|
667
|
+
For a complex type, this must be set to @code{FFI_TYPE_COMPLEX}.
|
668
|
+
|
669
|
+
@item ffi_type **elements
|
670
|
+
|
671
|
+
This is a @samp{NULL}-terminated array of pointers to
|
672
|
+
@code{ffi_type} objects. The first element is set to the
|
673
|
+
@code{ffi_type} of the complex's base type. The second element
|
674
|
+
must be set to @code{NULL}.
|
675
|
+
@end table
|
676
|
+
@end deftp
|
677
|
+
|
678
|
+
The section @ref{Complex Type Example} shows a way to determine
|
679
|
+
the @code{size} and @code{alignment} members in a platform
|
680
|
+
independent way.
|
681
|
+
|
682
|
+
For platforms that have no complex support in @code{libffi} yet,
|
683
|
+
the functions @code{ffi_prep_cif} and @code{ffi_prep_args} abort
|
684
|
+
the program if they encounter a complex type.
|
685
|
+
|
686
|
+
@node Complex Type Example
|
687
|
+
@subsection Complex Type Example
|
688
|
+
|
689
|
+
This example demonstrates how to use complex types:
|
690
|
+
|
691
|
+
@example
|
692
|
+
#include <stdio.h>
|
693
|
+
#include <ffi.h>
|
694
|
+
#include <complex.h>
|
695
|
+
|
696
|
+
void complex_fn(_Complex float cf,
|
697
|
+
_Complex double cd,
|
698
|
+
_Complex long double cld)
|
699
|
+
@{
|
700
|
+
printf("cf=%f+%fi\ncd=%f+%fi\ncld=%f+%fi\n",
|
701
|
+
(float)creal (cf), (float)cimag (cf),
|
702
|
+
(float)creal (cd), (float)cimag (cd),
|
703
|
+
(float)creal (cld), (float)cimag (cld));
|
704
|
+
@}
|
705
|
+
|
706
|
+
int main()
|
707
|
+
@{
|
708
|
+
ffi_cif cif;
|
709
|
+
ffi_type *args[3];
|
710
|
+
void *values[3];
|
711
|
+
_Complex float cf;
|
712
|
+
_Complex double cd;
|
713
|
+
_Complex long double cld;
|
714
|
+
|
715
|
+
/* Initialize the argument info vectors */
|
716
|
+
args[0] = &ffi_type_complex_float;
|
717
|
+
args[1] = &ffi_type_complex_double;
|
718
|
+
args[2] = &ffi_type_complex_longdouble;
|
719
|
+
values[0] = &cf;
|
720
|
+
values[1] = &cd;
|
721
|
+
values[2] = &cld;
|
722
|
+
|
723
|
+
/* Initialize the cif */
|
724
|
+
if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3,
|
725
|
+
&ffi_type_void, args) == FFI_OK)
|
726
|
+
@{
|
727
|
+
cf = 1.0 + 20.0 * I;
|
728
|
+
cd = 300.0 + 4000.0 * I;
|
729
|
+
cld = 50000.0 + 600000.0 * I;
|
730
|
+
/* Call the function */
|
731
|
+
ffi_call(&cif, (void (*)(void))complex_fn, 0, values);
|
732
|
+
@}
|
733
|
+
|
734
|
+
return 0;
|
735
|
+
@}
|
736
|
+
@end example
|
737
|
+
|
738
|
+
This is an example for defining a custom complex type descriptor
|
739
|
+
for compilers that support them:
|
740
|
+
|
741
|
+
@example
|
742
|
+
/*
|
743
|
+
* This macro can be used to define new complex type descriptors
|
744
|
+
* in a platform independent way.
|
745
|
+
*
|
746
|
+
* name: Name of the new descriptor is ffi_type_complex_<name>.
|
747
|
+
* type: The C base type of the complex type.
|
748
|
+
*/
|
749
|
+
#define FFI_COMPLEX_TYPEDEF(name, type, ffitype) \
|
750
|
+
static ffi_type *ffi_elements_complex_##name [2] = @{ \
|
751
|
+
(ffi_type *)(&ffitype), NULL \
|
752
|
+
@}; \
|
753
|
+
struct struct_align_complex_##name @{ \
|
754
|
+
char c; \
|
755
|
+
_Complex type x; \
|
756
|
+
@}; \
|
757
|
+
ffi_type ffi_type_complex_##name = @{ \
|
758
|
+
sizeof(_Complex type), \
|
759
|
+
offsetof(struct struct_align_complex_##name, x), \
|
760
|
+
FFI_TYPE_COMPLEX, \
|
761
|
+
(ffi_type **)ffi_elements_complex_##name \
|
762
|
+
@}
|
763
|
+
|
764
|
+
/* Define new complex type descriptors using the macro: */
|
765
|
+
/* ffi_type_complex_sint */
|
766
|
+
FFI_COMPLEX_TYPEDEF(sint, int, ffi_type_sint);
|
767
|
+
/* ffi_type_complex_uchar */
|
768
|
+
FFI_COMPLEX_TYPEDEF(uchar, unsigned char, ffi_type_uint8);
|
769
|
+
@end example
|
770
|
+
|
771
|
+
The new type descriptors can then be used like one of the built-in
|
772
|
+
type descriptors in the previous example.
|
406
773
|
|
407
774
|
@node Multiple ABIs
|
408
775
|
@section Multiple ABIs
|
@@ -437,7 +804,7 @@ require special allocation on platforms that have a non-executable
|
|
437
804
|
heap. Memory management for closures is handled by a pair of
|
438
805
|
functions:
|
439
806
|
|
440
|
-
@findex
|
807
|
+
@findex ffi_closure_alloc
|
441
808
|
@defun void *ffi_closure_alloc (size_t @var{size}, void **@var{code})
|
442
809
|
Allocate a chunk of memory holding @var{size} bytes. This returns a
|
443
810
|
pointer to the writable address, and sets *@var{code} to the
|
@@ -452,37 +819,53 @@ Free memory allocated using @code{ffi_closure_alloc}. The argument is
|
|
452
819
|
the writable address that was returned.
|
453
820
|
@end defun
|
454
821
|
|
455
|
-
|
456
822
|
Once you have allocated the memory for a closure, you must construct a
|
457
823
|
@code{ffi_cif} describing the function call. Finally you can prepare
|
458
824
|
the closure function:
|
459
825
|
|
460
826
|
@findex ffi_prep_closure_loc
|
461
827
|
@defun ffi_status ffi_prep_closure_loc (ffi_closure *@var{closure}, ffi_cif *@var{cif}, void (*@var{fun}) (ffi_cif *@var{cif}, void *@var{ret}, void **@var{args}, void *@var{user_data}), void *@var{user_data}, void *@var{codeloc})
|
462
|
-
Prepare a closure function.
|
828
|
+
Prepare a closure function. The arguments to
|
829
|
+
@code{ffi_prep_closure_loc} are:
|
463
830
|
|
464
|
-
@
|
465
|
-
|
831
|
+
@table @var
|
832
|
+
@item closure
|
833
|
+
The address of a @code{ffi_closure} object; this is the writable
|
834
|
+
address returned by @code{ffi_closure_alloc}.
|
466
835
|
|
467
|
-
@
|
836
|
+
@item cif
|
837
|
+
The @code{ffi_cif} describing the function parameters. Note that this
|
838
|
+
object, and the types to which it refers, must be kept alive until the
|
839
|
+
closure itself is freed.
|
468
840
|
|
469
|
-
@
|
470
|
-
to your closure
|
841
|
+
@item user_data
|
842
|
+
An arbitrary datum that is passed, uninterpreted, to your closure
|
843
|
+
function.
|
844
|
+
|
845
|
+
@item codeloc
|
846
|
+
The executable address returned by @code{ffi_closure_alloc}.
|
471
847
|
|
472
|
-
@
|
473
|
-
|
848
|
+
@item fun
|
849
|
+
The function which will be called when the closure is invoked. It is
|
850
|
+
called with the arguments:
|
474
851
|
|
475
|
-
@var{fun} is the function which will be called when the closure is
|
476
|
-
invoked. It is called with the arguments:
|
477
852
|
@table @var
|
478
853
|
@item cif
|
479
854
|
The @code{ffi_cif} passed to @code{ffi_prep_closure_loc}.
|
480
855
|
|
481
856
|
@item ret
|
482
857
|
A pointer to the memory used for the function's return value.
|
483
|
-
|
484
|
-
@code{void}
|
485
|
-
|
858
|
+
|
859
|
+
If the function is declared as returning @code{void}, then this value
|
860
|
+
is garbage and should not be used.
|
861
|
+
|
862
|
+
Otherwise, @var{fun} must fill the object to which this points,
|
863
|
+
following the same special promotion behavior as @code{ffi_call}.
|
864
|
+
That is, in most cases, @var{ret} points to an object of exactly the
|
865
|
+
size of the type specified when @var{cif} was constructed. However,
|
866
|
+
integral types narrower than the system register size are widened. In
|
867
|
+
these cases your program may assume that @var{ret} points to an
|
868
|
+
@code{ffi_arg} object.
|
486
869
|
|
487
870
|
@item args
|
488
871
|
A vector of pointers to memory holding the arguments to the function.
|
@@ -491,21 +874,148 @@ A vector of pointers to memory holding the arguments to the function.
|
|
491
874
|
The same @var{user_data} that was passed to
|
492
875
|
@code{ffi_prep_closure_loc}.
|
493
876
|
@end table
|
877
|
+
@end table
|
494
878
|
|
495
879
|
@code{ffi_prep_closure_loc} will return @code{FFI_OK} if everything
|
496
|
-
went ok, and
|
497
|
-
@c FIXME: what?
|
880
|
+
went ok, and one of the other @code{ffi_status} values on error.
|
498
881
|
|
499
882
|
After calling @code{ffi_prep_closure_loc}, you can cast @var{codeloc}
|
500
883
|
to the appropriate pointer-to-function type.
|
501
884
|
@end defun
|
502
885
|
|
503
|
-
@c FIXME: example
|
504
|
-
|
505
886
|
You may see old code referring to @code{ffi_prep_closure}. This
|
506
887
|
function is deprecated, as it cannot handle the need for separate
|
507
888
|
writable and executable addresses.
|
508
889
|
|
890
|
+
@node Closure Example
|
891
|
+
@section Closure Example
|
892
|
+
|
893
|
+
A trivial example that creates a new @code{puts} by binding
|
894
|
+
@code{fputs} with @code{stdout}.
|
895
|
+
|
896
|
+
@example
|
897
|
+
#include <stdio.h>
|
898
|
+
#include <ffi.h>
|
899
|
+
|
900
|
+
/* Acts like puts with the file given at time of enclosure. */
|
901
|
+
void puts_binding(ffi_cif *cif, void *ret, void* args[],
|
902
|
+
void *stream)
|
903
|
+
@{
|
904
|
+
*(ffi_arg *)ret = fputs(*(char **)args[0], (FILE *)stream);
|
905
|
+
@}
|
906
|
+
|
907
|
+
typedef int (*puts_t)(char *);
|
908
|
+
|
909
|
+
int main()
|
910
|
+
@{
|
911
|
+
ffi_cif cif;
|
912
|
+
ffi_type *args[1];
|
913
|
+
ffi_closure *closure;
|
914
|
+
|
915
|
+
void *bound_puts;
|
916
|
+
int rc;
|
917
|
+
|
918
|
+
/* Allocate closure and bound_puts */
|
919
|
+
closure = ffi_closure_alloc(sizeof(ffi_closure), &bound_puts);
|
920
|
+
|
921
|
+
if (closure)
|
922
|
+
@{
|
923
|
+
/* Initialize the argument info vectors */
|
924
|
+
args[0] = &ffi_type_pointer;
|
925
|
+
|
926
|
+
/* Initialize the cif */
|
927
|
+
if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
|
928
|
+
&ffi_type_sint, args) == FFI_OK)
|
929
|
+
@{
|
930
|
+
/* Initialize the closure, setting stream to stdout */
|
931
|
+
if (ffi_prep_closure_loc(closure, &cif, puts_binding,
|
932
|
+
stdout, bound_puts) == FFI_OK)
|
933
|
+
@{
|
934
|
+
rc = ((puts_t)bound_puts)("Hello World!");
|
935
|
+
/* rc now holds the result of the call to fputs */
|
936
|
+
@}
|
937
|
+
@}
|
938
|
+
@}
|
939
|
+
|
940
|
+
/* Deallocate both closure, and bound_puts */
|
941
|
+
ffi_closure_free(closure);
|
942
|
+
|
943
|
+
return 0;
|
944
|
+
@}
|
945
|
+
|
946
|
+
@end example
|
947
|
+
|
948
|
+
@node Thread Safety
|
949
|
+
@section Thread Safety
|
950
|
+
|
951
|
+
@code{libffi} is not completely thread-safe. However, many parts are,
|
952
|
+
and if you follow some simple rules, you can use it safely in a
|
953
|
+
multi-threaded program.
|
954
|
+
|
955
|
+
@itemize @bullet
|
956
|
+
@item
|
957
|
+
@code{ffi_prep_cif} may modify the @code{ffi_type} objects passed to
|
958
|
+
it. It is best to ensure that only a single thread prepares a given
|
959
|
+
@code{ffi_cif} at a time.
|
960
|
+
|
961
|
+
@item
|
962
|
+
On some platforms, @code{ffi_prep_cif} may modify the size and
|
963
|
+
alignment of some types, depending on the chosen ABI. On these
|
964
|
+
platforms, if you switch between ABIs, you must ensure that there is
|
965
|
+
only one call to @code{ffi_prep_cif} at a time.
|
966
|
+
|
967
|
+
Currently the only affected platform is PowerPC and the only affected
|
968
|
+
type is @code{long double}.
|
969
|
+
@end itemize
|
970
|
+
|
971
|
+
@node Memory Usage
|
972
|
+
@chapter Memory Usage
|
973
|
+
|
974
|
+
Note that memory allocated by @code{ffi_closure_alloc} and freed by
|
975
|
+
@code{ffi_closure_free} does not come from the same general pool of
|
976
|
+
memory that @code{malloc} and @code{free} use. To accomodate security
|
977
|
+
settings, @code{libffi} may aquire memory, for example, by mapping
|
978
|
+
temporary files into multiple places in the address space (once to
|
979
|
+
write out the closure, a second to execute it). The search follows
|
980
|
+
this list, using the first that works:
|
981
|
+
|
982
|
+
@itemize @bullet
|
983
|
+
|
984
|
+
@item
|
985
|
+
A anonymous mapping (i.e. not file-backed)
|
986
|
+
|
987
|
+
@item
|
988
|
+
@code{memfd_create()}, if the kernel supports it.
|
989
|
+
|
990
|
+
@item
|
991
|
+
A file created in the directory referenced by the environment variable
|
992
|
+
@code{LIBFFI_TMPDIR}.
|
993
|
+
|
994
|
+
@item
|
995
|
+
Likewise for the environment variable @code{TMPDIR}.
|
996
|
+
|
997
|
+
@item
|
998
|
+
A file created in @code{/tmp}.
|
999
|
+
|
1000
|
+
@item
|
1001
|
+
A file created in @code{/var/tmp}.
|
1002
|
+
|
1003
|
+
@item
|
1004
|
+
A file created in @code{/dev/shm}.
|
1005
|
+
|
1006
|
+
@item
|
1007
|
+
A file created in the user's home directory (@code{$HOME}).
|
1008
|
+
|
1009
|
+
@item
|
1010
|
+
A file created in any directory listed in @code{/etc/mtab}.
|
1011
|
+
|
1012
|
+
@item
|
1013
|
+
A file created in any directory listed in @code{/proc/mounts}.
|
1014
|
+
|
1015
|
+
@end itemize
|
1016
|
+
|
1017
|
+
If security settings prohibit using any of these for closures,
|
1018
|
+
@code{ffi_closure_alloc} will fail.
|
509
1019
|
|
510
1020
|
@node Missing Features
|
511
1021
|
@chapter Missing Features
|
@@ -515,23 +1025,18 @@ support for these.
|
|
515
1025
|
|
516
1026
|
@itemize @bullet
|
517
1027
|
@item
|
518
|
-
|
519
|
-
some platforms, depending on how the ABI is defined, but it is not
|
520
|
-
reliable.
|
1028
|
+
Variadic closures.
|
521
1029
|
|
522
1030
|
@item
|
523
1031
|
There is no support for bit fields in structures.
|
524
1032
|
|
525
|
-
@item
|
526
|
-
The closure API is
|
527
|
-
|
528
1033
|
@item
|
529
1034
|
The ``raw'' API is undocumented.
|
530
|
-
@c argument promotion?
|
531
|
-
@c unions?
|
532
1035
|
@c anything else?
|
533
|
-
@end itemize
|
534
1036
|
|
1037
|
+
@item
|
1038
|
+
The Go API is undocumented.
|
1039
|
+
@end itemize
|
535
1040
|
|
536
1041
|
@node Index
|
537
1042
|
@unnumbered Index
|