ffi 1.1.5 → 1.15.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +338 -0
- data/COPYING +49 -0
- data/Gemfile +14 -0
- data/LICENSE +21 -11
- data/LICENSE.SPECS +22 -0
- data/README.md +136 -0
- data/Rakefile +149 -154
- data/ext/ffi_c/AbstractMemory.c +133 -57
- data/ext/ffi_c/AbstractMemory.h +21 -12
- data/ext/ffi_c/ArrayType.c +27 -14
- data/ext/ffi_c/ArrayType.h +21 -12
- data/ext/ffi_c/Buffer.c +29 -25
- data/ext/ffi_c/Call.c +154 -125
- data/ext/ffi_c/Call.h +43 -20
- data/ext/ffi_c/ClosurePool.c +100 -42
- data/ext/ffi_c/ClosurePool.h +24 -13
- data/ext/ffi_c/DynamicLibrary.c +47 -28
- data/ext/ffi_c/DynamicLibrary.h +70 -12
- data/ext/ffi_c/Function.c +119 -167
- data/ext/ffi_c/Function.h +23 -19
- data/ext/ffi_c/FunctionInfo.c +55 -25
- data/ext/ffi_c/LastError.c +70 -21
- data/ext/ffi_c/LastError.h +21 -12
- data/ext/ffi_c/LongDouble.c +15 -9
- data/ext/ffi_c/LongDouble.h +21 -16
- data/ext/ffi_c/MappedType.c +22 -15
- data/ext/ffi_c/MappedType.h +21 -12
- data/ext/ffi_c/MemoryPointer.c +58 -33
- data/ext/ffi_c/MemoryPointer.h +22 -19
- data/ext/ffi_c/MethodHandle.c +49 -50
- data/ext/ffi_c/MethodHandle.h +24 -14
- data/ext/ffi_c/Platform.c +28 -62
- data/ext/ffi_c/Platform.h +21 -12
- data/ext/ffi_c/Pointer.c +63 -46
- data/ext/ffi_c/Pointer.h +22 -19
- data/ext/ffi_c/Struct.c +198 -80
- data/ext/ffi_c/Struct.h +33 -18
- data/ext/ffi_c/StructByValue.c +23 -20
- data/ext/ffi_c/StructByValue.h +21 -12
- data/ext/ffi_c/StructLayout.c +184 -39
- data/ext/ffi_c/Thread.c +73 -270
- data/ext/ffi_c/Thread.h +32 -35
- data/ext/ffi_c/Type.c +26 -32
- data/ext/ffi_c/Type.h +24 -10
- data/ext/ffi_c/Types.c +28 -20
- data/ext/ffi_c/Types.h +25 -16
- data/ext/ffi_c/Variadic.c +78 -39
- data/ext/ffi_c/compat.h +25 -17
- data/ext/ffi_c/extconf.rb +68 -31
- data/ext/ffi_c/ffi.c +27 -20
- data/ext/ffi_c/libffi/.appveyor.yml +66 -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/.gitignore +38 -0
- data/ext/ffi_c/libffi/.travis/ar-lib +270 -0
- data/ext/ffi_c/libffi/.travis/bfin-sim.exp +58 -0
- data/ext/ffi_c/libffi/.travis/build-cross-in-container.sh +14 -0
- data/ext/ffi_c/libffi/.travis/build-in-container.sh +12 -0
- data/ext/ffi_c/libffi/.travis/build.sh +142 -0
- data/ext/ffi_c/libffi/.travis/compile +351 -0
- data/ext/ffi_c/libffi/.travis/install.sh +71 -0
- data/ext/ffi_c/libffi/.travis/m32r-sim.exp +58 -0
- data/ext/ffi_c/libffi/.travis/moxie-sim.exp +60 -0
- data/ext/ffi_c/libffi/.travis/or1k-sim.exp +58 -0
- data/ext/ffi_c/libffi/.travis/powerpc-eabisim.exp +58 -0
- data/ext/ffi_c/libffi/.travis/site.exp +27 -0
- data/ext/ffi_c/libffi/.travis/wine-sim.exp +55 -0
- data/ext/ffi_c/libffi/.travis.yml +83 -0
- data/ext/ffi_c/libffi/{ChangeLog → ChangeLog.old} +6366 -3559
- data/ext/ffi_c/libffi/LICENSE +1 -1
- data/ext/ffi_c/libffi/LICENSE-BUILDTOOLS +353 -0
- data/ext/ffi_c/libffi/Makefile.am +123 -169
- data/ext/ffi_c/libffi/Makefile.in +1243 -1003
- data/ext/ffi_c/libffi/README.md +486 -0
- data/ext/ffi_c/libffi/acinclude.m4 +387 -0
- data/ext/ffi_c/libffi/autogen.sh +2 -0
- data/ext/ffi_c/libffi/config.guess +690 -504
- data/ext/ffi_c/libffi/config.sub +1353 -1207
- data/ext/ffi_c/libffi/configure +7308 -2449
- data/ext/ffi_c/libffi/configure.ac +178 -259
- data/ext/ffi_c/libffi/configure.host +311 -4
- data/ext/ffi_c/libffi/doc/Makefile.am +3 -0
- data/ext/ffi_c/libffi/doc/Makefile.in +815 -0
- data/ext/ffi_c/libffi/doc/libffi.texi +455 -58
- data/ext/ffi_c/libffi/doc/version.texi +4 -4
- data/ext/ffi_c/libffi/fficonfig.h.in +37 -13
- data/ext/ffi_c/libffi/generate-darwin-source-and-headers.py +201 -0
- data/ext/ffi_c/libffi/include/Makefile.am +3 -3
- data/ext/ffi_c/libffi/include/Makefile.in +196 -75
- data/ext/ffi_c/libffi/include/ffi.h.in +163 -67
- data/ext/ffi_c/libffi/include/ffi_cfi.h +55 -0
- data/ext/ffi_c/libffi/include/ffi_common.h +39 -12
- data/ext/ffi_c/libffi/install-sh +207 -209
- data/ext/ffi_c/libffi/libffi.map.in +76 -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 +1 -1
- data/ext/ffi_c/libffi/ltmain.sh +3641 -2026
- 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 +32 -14
- data/ext/ffi_c/libffi/m4/ax_cflags_warn_all.m4 +33 -106
- data/ext/ffi_c/libffi/m4/ax_check_compile_flag.m4 +53 -0
- data/ext/ffi_c/libffi/m4/ax_compiler_vendor.m4 +38 -13
- data/ext/ffi_c/libffi/m4/ax_configure_args.m4 +8 -29
- data/ext/ffi_c/libffi/m4/ax_enable_builddir.m4 +11 -9
- data/ext/ffi_c/libffi/m4/ax_gcc_archflag.m4 +104 -52
- data/ext/ffi_c/libffi/m4/ax_gcc_x86_cpuid.m4 +18 -8
- 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 +151 -55
- 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 +153 -314
- 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/{include/ffi.h.vc64 → msvc_build/aarch64/aarch64_include/ffi.h} +151 -67
- data/ext/ffi_c/libffi/msvc_build/aarch64/aarch64_include/fficonfig.h +219 -0
- data/ext/ffi_c/libffi/msvcc.sh +176 -20
- data/ext/ffi_c/libffi/src/aarch64/ffi.c +1025 -0
- data/ext/ffi_c/libffi/src/aarch64/ffitarget.h +97 -0
- data/ext/ffi_c/libffi/src/aarch64/internal.h +68 -0
- data/ext/ffi_c/libffi/src/aarch64/sysv.S +451 -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 +161 -266
- data/ext/ffi_c/libffi/src/arc/arcompact.S +135 -0
- data/ext/ffi_c/libffi/src/arc/ffi.c +266 -0
- data/ext/ffi_c/libffi/src/arc/ffitarget.h +53 -0
- data/ext/ffi_c/libffi/src/arm/ffi.c +663 -515
- data/ext/ffi_c/libffi/src/arm/ffitarget.h +32 -8
- data/ext/ffi_c/libffi/src/arm/internal.h +7 -0
- data/ext/ffi_c/libffi/src/arm/sysv.S +305 -417
- data/ext/ffi_c/libffi/src/arm/sysv_msvc_arm32.S +311 -0
- data/ext/ffi_c/libffi/src/avr32/ffitarget.h +6 -1
- 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 +465 -59
- data/ext/ffi_c/libffi/src/cris/ffi.c +10 -7
- data/ext/ffi_c/libffi/src/cris/ffitarget.h +6 -1
- 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 +6 -1
- data/ext/ffi_c/libffi/src/dlmalloc.c +17 -12
- data/ext/ffi_c/libffi/src/frv/ffi.c +2 -2
- data/ext/ffi_c/libffi/src/frv/ffitarget.h +6 -1
- data/ext/ffi_c/libffi/src/ia64/ffi.c +35 -13
- data/ext/ffi_c/libffi/src/ia64/ffitarget.h +8 -2
- data/ext/ffi_c/libffi/src/ia64/unix.S +8 -1
- data/ext/ffi_c/libffi/src/java_raw_api.c +23 -5
- 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/m32r/ffi.c +1 -1
- data/ext/ffi_c/libffi/src/m32r/ffitarget.h +6 -1
- data/ext/ffi_c/libffi/src/m68k/ffi.c +87 -13
- data/ext/ffi_c/libffi/src/m68k/ffitarget.h +6 -1
- data/ext/ffi_c/libffi/src/m68k/sysv.S +119 -32
- 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/{fficonfig.hw → src/metag/ffitarget.h} +22 -26
- 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 +135 -37
- data/ext/ffi_c/libffi/src/mips/ffitarget.h +16 -14
- data/ext/ffi_c/libffi/src/mips/n32.S +128 -56
- data/ext/ffi_c/libffi/src/mips/o32.S +150 -27
- data/ext/ffi_c/libffi/src/moxie/eabi.S +55 -82
- data/ext/ffi_c/libffi/src/moxie/ffi.c +55 -46
- 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 +328 -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 +46 -91
- data/ext/ffi_c/libffi/src/pa/ffitarget.h +9 -7
- data/ext/ffi_c/libffi/src/pa/hpux32.S +4 -2
- data/ext/ffi_c/libffi/src/pa/linux.S +27 -4
- data/ext/ffi_c/libffi/src/powerpc/aix.S +245 -7
- data/ext/ffi_c/libffi/src/powerpc/aix_closure.S +253 -4
- data/ext/ffi_c/libffi/src/powerpc/asm.h +2 -2
- data/ext/ffi_c/libffi/src/powerpc/darwin.S +2 -7
- data/ext/ffi_c/libffi/src/powerpc/darwin_closure.S +22 -26
- data/ext/ffi_c/libffi/src/powerpc/ffi.c +105 -1378
- data/ext/ffi_c/libffi/src/powerpc/ffi_darwin.c +123 -30
- 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 +110 -45
- data/ext/ffi_c/libffi/src/powerpc/linux64.S +189 -85
- data/ext/ffi_c/libffi/src/powerpc/linux64_closure.S +436 -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/prep_cif.c +111 -25
- data/ext/ffi_c/libffi/src/raw_api.c +18 -5
- data/ext/ffi_c/libffi/src/riscv/ffi.c +481 -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 +9 -1
- 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 +6 -1
- data/ext/ffi_c/libffi/src/sh64/ffi.c +3 -2
- data/ext/ffi_c/libffi/src/sh64/ffitarget.h +6 -1
- data/ext/ffi_c/libffi/src/sparc/ffi.c +326 -527
- data/ext/ffi_c/libffi/src/sparc/ffi64.c +608 -0
- data/ext/ffi_c/libffi/src/sparc/ffitarget.h +20 -7
- 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/types.c +46 -15
- 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/x86/asmnames.h +30 -0
- data/ext/ffi_c/libffi/src/x86/ffi.c +624 -498
- data/ext/ffi_c/libffi/src/x86/ffi64.c +379 -119
- data/ext/ffi_c/libffi/src/x86/ffitarget.h +74 -35
- data/ext/ffi_c/libffi/src/x86/ffiw64.c +318 -0
- data/ext/ffi_c/libffi/src/x86/internal.h +29 -0
- data/ext/ffi_c/libffi/src/x86/internal64.h +22 -0
- data/ext/ffi_c/libffi/src/x86/sysv.S +1070 -400
- data/ext/ffi_c/libffi/src/x86/sysv_intel.S +995 -0
- data/ext/ffi_c/libffi/src/x86/unix64.S +494 -299
- data/ext/ffi_c/libffi/src/x86/win64.S +231 -458
- data/ext/ffi_c/libffi/src/x86/win64_intel.S +238 -0
- data/ext/ffi_c/libffi/src/xtensa/ffi.c +298 -0
- data/ext/ffi_c/libffi/src/xtensa/ffitarget.h +53 -0
- data/ext/ffi_c/libffi/src/xtensa/sysv.S +258 -0
- data/ext/ffi_c/libffi/stamp-h.in +1 -0
- data/ext/ffi_c/libffi/testsuite/Makefile.am +115 -73
- data/ext/ffi_c/libffi/testsuite/Makefile.in +262 -114
- data/ext/ffi_c/libffi/testsuite/lib/libffi.exp +334 -24
- data/ext/ffi_c/libffi/testsuite/lib/target-libpath.exp +21 -1
- 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 +1745 -0
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-callback.c +2885 -0
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/testcases.c +743 -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/call.exp +28 -6
- data/ext/ffi_c/libffi/testsuite/libffi.call/err_bad_typedef.c +2 -2
- data/ext/ffi_c/libffi/testsuite/libffi.call/ffitest.h +25 -40
- 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 +107 -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_sc.c +1 -1
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_uc.c +1 -1
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen.c +2 -2
- 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/uninitialized.c +61 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c +196 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct1.c +121 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct2.c +123 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct3.c +125 -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 +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn1.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn2.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn3.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn4.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn5.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn6.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_loc_fn0.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call/closure_stdcall.c → libffi.closures/closure_simple.c} +7 -16
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_12byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_16byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_18byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_19byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_1_1byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_20byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_20byte1.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_24byte.c +5 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_2byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3_1byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3byte1.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3byte2.c +4 -4
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3float.c +95 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_4_1byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_4byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_5_1_byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_5byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_64byte.c +5 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_6_1_byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_6byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_7_1_byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_7byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_8byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_9byte1.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_9byte2.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_double.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_float.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble_split.c +4 -6
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble_split2.c +4 -6
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_pointer.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint16.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint32.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint64.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint16.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint32.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint64.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_dbls_struct.c +4 -4
- 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}/cls_double_va.c +10 -9
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_float.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_longdouble.c +3 -3
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_longdouble_va.c +10 -9
- 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 +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_sshort.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_sshortchar.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_uchar.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_ushort.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_ushortchar.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_pointer.c +1 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_pointer_stack.c +11 -9
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_schar.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_sint.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_sshort.c +0 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_struct_va1.c +114 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uchar.c +0 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uchar_va.c +44 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uint.c +0 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uint_va.c +45 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ulong_va.c +45 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ulonglong.c +5 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ushort.c +0 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ushort_va.c +44 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/err_bad_abi.c +0 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/ffitest.h +138 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/huge_struct.c +20 -19
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct.c +6 -6
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct1.c +8 -8
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct10.c +7 -6
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct11.c +121 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct2.c +5 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct3.c +5 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct4.c +5 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct5.c +5 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct6.c +6 -6
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct7.c +5 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct8.c +6 -6
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct9.c +6 -6
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/problem1.c +0 -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 +5 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_medium2.c +5 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/testclosure.c +2 -2
- data/ext/ffi_c/libffi/testsuite/{libffi.special → libffi.closures}/unwindtest.cc +3 -10
- data/ext/ffi_c/libffi/testsuite/{libffi.special → libffi.closures}/unwindtest_ffi_call.cc +3 -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 -8
- 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 +12 -6
- data/ext/ffi_c/libffi.darwin.mk +21 -9
- data/ext/ffi_c/libffi.gnu.mk +3 -2
- data/ext/ffi_c/libffi.mk +11 -6
- data/ext/ffi_c/libffi.vc.mk +1 -1
- data/ext/ffi_c/libffi.vc64.mk +1 -1
- data/ext/ffi_c/rbffi.h +22 -14
- data/ext/ffi_c/rbffi_endian.h +11 -2
- data/ffi.gemspec +42 -0
- data/lib/ffi/abstract_memory.rb +44 -0
- data/lib/ffi/autopointer.rb +70 -50
- data/lib/ffi/data_converter.rb +67 -0
- data/lib/ffi/enum.rb +159 -24
- data/lib/ffi/errno.rb +21 -11
- data/lib/ffi/ffi.rb +25 -11
- data/lib/ffi/io.rb +24 -14
- data/lib/ffi/library.rb +174 -67
- data/lib/ffi/managedstruct.rb +63 -34
- 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 +104 -0
- data/lib/ffi/platform/aarch64-openbsd/types.conf +134 -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 +110 -82
- data/lib/ffi/platform/i386-cygwin/types.conf +3 -0
- data/lib/ffi/platform/i386-darwin/types.conf +63 -63
- data/lib/ffi/platform/i386-freebsd/types.conf +89 -89
- data/lib/ffi/platform/i386-freebsd12/types.conf +152 -0
- data/lib/ffi/platform/{i486-gnu → i386-gnu}/types.conf +84 -84
- data/lib/ffi/platform/i386-linux/types.conf +77 -77
- data/lib/ffi/platform/i386-netbsd/types.conf +87 -87
- data/lib/ffi/platform/i386-openbsd/types.conf +89 -87
- data/lib/ffi/platform/i386-solaris/types.conf +96 -96
- data/lib/ffi/platform/i386-windows/types.conf +43 -96
- data/lib/ffi/platform/ia64-linux/types.conf +79 -79
- data/lib/ffi/platform/mips-linux/types.conf +79 -79
- 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 +79 -79
- 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 +155 -155
- data/lib/ffi/platform/powerpc-darwin/types.conf +63 -63
- data/lib/ffi/platform/powerpc-linux/types.conf +108 -78
- 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 +79 -79
- data/lib/ffi/platform/s390x-linux/types.conf +79 -79
- data/lib/ffi/platform/sparc-linux/types.conf +79 -79
- data/lib/ffi/platform/sparc-solaris/types.conf +103 -103
- data/lib/ffi/platform/sparc64-linux/types.conf +102 -0
- data/lib/ffi/platform/sparcv9-openbsd/types.conf +156 -0
- data/lib/ffi/platform/sparcv9-solaris/types.conf +103 -103
- data/lib/ffi/platform/x86_64-cygwin/types.conf +3 -0
- data/lib/ffi/platform/x86_64-darwin/types.conf +93 -63
- data/lib/ffi/platform/x86_64-dragonflybsd/types.conf +130 -0
- data/lib/ffi/platform/x86_64-freebsd/types.conf +90 -88
- 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 +107 -77
- data/lib/ffi/platform/x86_64-msys/types.conf +119 -0
- data/lib/ffi/platform/x86_64-netbsd/types.conf +89 -87
- data/lib/ffi/platform/x86_64-openbsd/types.conf +100 -92
- data/lib/ffi/platform/x86_64-solaris/types.conf +96 -96
- data/lib/ffi/platform/x86_64-windows/types.conf +52 -0
- data/lib/ffi/platform.rb +81 -26
- data/lib/ffi/pointer.rb +72 -27
- data/lib/ffi/struct.rb +99 -66
- data/lib/ffi/struct_by_reference.rb +72 -0
- data/lib/ffi/struct_layout.rb +96 -0
- data/lib/ffi/struct_layout_builder.rb +82 -17
- data/lib/ffi/tools/const_generator.rb +11 -8
- data/lib/ffi/tools/generator.rb +48 -1
- 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 +14 -10
- data/lib/ffi/types.rb +31 -14
- data/lib/ffi/union.rb +23 -12
- data/lib/ffi/variadic.rb +25 -21
- data/lib/ffi/version.rb +3 -0
- data/lib/ffi.rb +20 -8
- 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/inotify.rb +60 -0
- data/samples/pty.rb +75 -0
- data/samples/qsort.rb +20 -0
- metadata +413 -263
- data/History.txt +0 -1
- data/README.rdoc +0 -102
- data/ext/ffi_c/DataConverter.c +0 -91
- data/ext/ffi_c/Ffi_c.iml +0 -12
- data/ext/ffi_c/StructByReference.c +0 -158
- data/ext/ffi_c/StructByReference.h +0 -50
- data/ext/ffi_c/libffi/ChangeLog.libffi +0 -584
- data/ext/ffi_c/libffi/ChangeLog.libgcj +0 -40
- data/ext/ffi_c/libffi/ChangeLog.v1 +0 -764
- data/ext/ffi_c/libffi/Makefile.vc +0 -141
- data/ext/ffi_c/libffi/Makefile.vc64 +0 -141
- data/ext/ffi_c/libffi/README +0 -342
- data/ext/ffi_c/libffi/aclocal.m4 +0 -1873
- data/ext/ffi_c/libffi/build-ios.sh +0 -67
- data/ext/ffi_c/libffi/compile +0 -143
- data/ext/ffi_c/libffi/depcomp +0 -630
- data/ext/ffi_c/libffi/doc/libffi.info +0 -593
- data/ext/ffi_c/libffi/doc/stamp-vti +0 -4
- data/ext/ffi_c/libffi/include/ffi.h.vc +0 -427
- data/ext/ffi_c/libffi/m4/ax_check_compiler_flags.m4 +0 -76
- data/ext/ffi_c/libffi/m4/libtool.m4 +0 -7831
- data/ext/ffi_c/libffi/m4/ltoptions.m4 +0 -369
- 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 -98
- data/ext/ffi_c/libffi/mdate-sh +0 -201
- data/ext/ffi_c/libffi/src/arm/gentramp.sh +0 -118
- data/ext/ffi_c/libffi/src/arm/trampoline.S +0 -4450
- 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 -1065
- 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/ext/ffi_c/win32/stdint.h +0 -199
- data/gen/Rakefile +0 -30
- data/gen/log +0 -1
- data/lib/Lib.iml +0 -13
- data/spec/ffi/Ffi.iml +0 -12
- data/spec/ffi/async_callback_spec.rb +0 -46
- data/spec/ffi/bool_spec.rb +0 -40
- data/spec/ffi/buffer_spec.rb +0 -215
- data/spec/ffi/callback_spec.rb +0 -668
- data/spec/ffi/custom_param_type.rb +0 -47
- data/spec/ffi/custom_type_spec.rb +0 -85
- data/spec/ffi/dup_spec.rb +0 -65
- data/spec/ffi/enum_spec.rb +0 -227
- data/spec/ffi/errno_spec.rb +0 -29
- data/spec/ffi/ffi_spec.rb +0 -40
- data/spec/ffi/function_spec.rb +0 -87
- data/spec/ffi/library_spec.rb +0 -208
- data/spec/ffi/long_double.rb +0 -41
- data/spec/ffi/managed_struct_spec.rb +0 -72
- data/spec/ffi/number_spec.rb +0 -247
- data/spec/ffi/pointer_spec.rb +0 -214
- data/spec/ffi/rbx/attach_function_spec.rb +0 -28
- data/spec/ffi/rbx/memory_pointer_spec.rb +0 -115
- 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 -35
- data/spec/ffi/string_spec.rb +0 -119
- data/spec/ffi/strptr_spec.rb +0 -61
- data/spec/ffi/struct_callback_spec.rb +0 -80
- data/spec/ffi/struct_initialize_spec.rb +0 -46
- data/spec/ffi/struct_packed_spec.rb +0 -62
- data/spec/ffi/struct_spec.rb +0 -719
- data/spec/ffi/typedef_spec.rb +0 -89
- data/spec/ffi/union_spec.rb +0 -76
- data/spec/ffi/variadic_spec.rb +0 -103
- data/spec/spec.opts +0 -4
- data/tasks/ann.rake +0 -80
- data/tasks/extension.rake +0 -32
- data/tasks/gem.rake +0 -199
- 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/tasks/yard.rake +0 -11
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2003, 2005, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
|
1
|
+
# Copyright (C) 2003, 2005, 2008, 2009, 2010, 2011, 2014, 2019 Free Software Foundation, Inc.
|
2
2
|
|
3
3
|
# This program is free software; you can redistribute it and/or modify
|
4
4
|
# it under the terms of the GNU General Public License as published by
|
@@ -24,6 +24,183 @@ load_lib libgloss.exp
|
|
24
24
|
load_gcc_lib target-libpath.exp
|
25
25
|
load_gcc_lib wrapper.exp
|
26
26
|
|
27
|
+
proc check_effective_target_gccbug { } {
|
28
|
+
global has_gccbug
|
29
|
+
return $has_gccbug
|
30
|
+
}
|
31
|
+
|
32
|
+
# Return 1 if the target matches the effective target 'arg', 0 otherwise.
|
33
|
+
# This can be used with any check_* proc that takes no argument and
|
34
|
+
# returns only 1 or 0. It could be used with check_* procs that take
|
35
|
+
# arguments with keywords that pass particular arguments.
|
36
|
+
|
37
|
+
proc is-effective-target { arg } {
|
38
|
+
global et_index
|
39
|
+
set selected 0
|
40
|
+
if { ![info exists et_index] } {
|
41
|
+
# Initialize the effective target index that is used in some
|
42
|
+
# check_effective_target_* procs.
|
43
|
+
set et_index 0
|
44
|
+
}
|
45
|
+
if { [info procs check_effective_target_${arg}] != [list] } {
|
46
|
+
set selected [check_effective_target_${arg}]
|
47
|
+
} else {
|
48
|
+
error "unknown effective target keyword `$arg'"
|
49
|
+
}
|
50
|
+
verbose "is-effective-target: $arg $selected" 2
|
51
|
+
return $selected
|
52
|
+
}
|
53
|
+
|
54
|
+
proc is-effective-target-keyword { arg } {
|
55
|
+
if { [info procs check_effective_target_${arg}] != [list] } {
|
56
|
+
return 1
|
57
|
+
} else {
|
58
|
+
return 0
|
59
|
+
}
|
60
|
+
}
|
61
|
+
|
62
|
+
# Intercept the call to the DejaGnu version of dg-process-target to
|
63
|
+
# support use of an effective-target keyword in place of a list of
|
64
|
+
# target triplets to xfail or skip a test.
|
65
|
+
#
|
66
|
+
# The argument to dg-process-target is the keyword "target" or "xfail"
|
67
|
+
# followed by a selector:
|
68
|
+
# target-triplet-1 ...
|
69
|
+
# effective-target-keyword
|
70
|
+
# selector-expression
|
71
|
+
#
|
72
|
+
# For a target list the result is "S" if the target is selected, "N" otherwise.
|
73
|
+
# For an xfail list the result is "F" if the target is affected, "P" otherwise.
|
74
|
+
|
75
|
+
# In contexts that allow either "target" or "xfail" the argument can be
|
76
|
+
# target selector1 xfail selector2
|
77
|
+
# which returns "N" if selector1 is not selected, otherwise the result of
|
78
|
+
# "xfail selector2".
|
79
|
+
#
|
80
|
+
# A selector expression appears within curly braces and uses a single logical
|
81
|
+
# operator: !, &&, or ||. An operand is another selector expression, an
|
82
|
+
# effective-target keyword, or a list of target triplets within quotes or
|
83
|
+
# curly braces.
|
84
|
+
|
85
|
+
if { [info procs saved-dg-process-target] == [list] } {
|
86
|
+
rename dg-process-target saved-dg-process-target
|
87
|
+
|
88
|
+
# Evaluate an operand within a selector expression.
|
89
|
+
proc selector_opd { op } {
|
90
|
+
set selector "target"
|
91
|
+
lappend selector $op
|
92
|
+
set answer [ expr { [dg-process-target $selector] == "S" } ]
|
93
|
+
verbose "selector_opd: `$op' $answer" 2
|
94
|
+
return $answer
|
95
|
+
}
|
96
|
+
|
97
|
+
# Evaluate a target triplet list within a selector expression.
|
98
|
+
# Unlike other operands, this needs to be expanded from a list to
|
99
|
+
# the same string as "target".
|
100
|
+
proc selector_list { op } {
|
101
|
+
set selector "target [join $op]"
|
102
|
+
set answer [ expr { [dg-process-target $selector] == "S" } ]
|
103
|
+
verbose "selector_list: `$op' $answer" 2
|
104
|
+
return $answer
|
105
|
+
}
|
106
|
+
|
107
|
+
# Evaluate a selector expression.
|
108
|
+
proc selector_expression { exp } {
|
109
|
+
if { [llength $exp] == 2 } {
|
110
|
+
if [string match "!" [lindex $exp 0]] {
|
111
|
+
set op1 [lindex $exp 1]
|
112
|
+
set answer [expr { ! [selector_opd $op1] }]
|
113
|
+
} else {
|
114
|
+
# Assume it's a list of target triplets.
|
115
|
+
set answer [selector_list $exp]
|
116
|
+
}
|
117
|
+
} elseif { [llength $exp] == 3 } {
|
118
|
+
set op1 [lindex $exp 0]
|
119
|
+
set opr [lindex $exp 1]
|
120
|
+
set op2 [lindex $exp 2]
|
121
|
+
if [string match "&&" $opr] {
|
122
|
+
set answer [expr { [selector_opd $op1] && [selector_opd $op2] }]
|
123
|
+
} elseif [string match "||" $opr] {
|
124
|
+
set answer [expr { [selector_opd $op1] || [selector_opd $op2] }]
|
125
|
+
} else {
|
126
|
+
# Assume it's a list of target triplets.
|
127
|
+
set answer [selector_list $exp]
|
128
|
+
}
|
129
|
+
} else {
|
130
|
+
# Assume it's a list of target triplets.
|
131
|
+
set answer [selector_list $exp]
|
132
|
+
}
|
133
|
+
|
134
|
+
verbose "selector_expression: `$exp' $answer" 2
|
135
|
+
return $answer
|
136
|
+
}
|
137
|
+
|
138
|
+
# Evaluate "target selector" or "xfail selector".
|
139
|
+
|
140
|
+
proc dg-process-target-1 { args } {
|
141
|
+
verbose "dg-process-target-1: `$args'" 2
|
142
|
+
|
143
|
+
# Extract the 'what' keyword from the argument list.
|
144
|
+
set selector [string trim [lindex $args 0]]
|
145
|
+
if [regexp "^xfail " $selector] {
|
146
|
+
set what "xfail"
|
147
|
+
} elseif [regexp "^target " $selector] {
|
148
|
+
set what "target"
|
149
|
+
} else {
|
150
|
+
error "syntax error in target selector \"$selector\""
|
151
|
+
}
|
152
|
+
|
153
|
+
# Extract the rest of the list, which might be a keyword.
|
154
|
+
regsub "^${what}" $selector "" rest
|
155
|
+
set rest [string trim $rest]
|
156
|
+
|
157
|
+
if [is-effective-target-keyword $rest] {
|
158
|
+
# The selector is an effective target keyword.
|
159
|
+
if [is-effective-target $rest] {
|
160
|
+
return [expr { $what == "xfail" ? "F" : "S" }]
|
161
|
+
} else {
|
162
|
+
return [expr { $what == "xfail" ? "P" : "N" }]
|
163
|
+
}
|
164
|
+
}
|
165
|
+
|
166
|
+
if [string match "{*}" $rest] {
|
167
|
+
if [selector_expression [lindex $rest 0]] {
|
168
|
+
return [expr { $what == "xfail" ? "F" : "S" }]
|
169
|
+
} else {
|
170
|
+
return [expr { $what == "xfail" ? "P" : "N" }]
|
171
|
+
}
|
172
|
+
}
|
173
|
+
|
174
|
+
# The selector is not an effective-target keyword, so process
|
175
|
+
# the list of target triplets.
|
176
|
+
return [saved-dg-process-target $selector]
|
177
|
+
}
|
178
|
+
|
179
|
+
# Intercept calls to the DejaGnu function. In addition to
|
180
|
+
# processing "target selector" or "xfail selector", handle
|
181
|
+
# "target selector1 xfail selector2".
|
182
|
+
|
183
|
+
proc dg-process-target { args } {
|
184
|
+
verbose "replacement dg-process-target: `$args'" 2
|
185
|
+
|
186
|
+
set selector [string trim [lindex $args 0]]
|
187
|
+
|
188
|
+
# If the argument list contains both 'target' and 'xfail',
|
189
|
+
# process 'target' and, if that succeeds, process 'xfail'.
|
190
|
+
if [regexp "^target .* xfail .*" $selector] {
|
191
|
+
set xfail_index [string first "xfail" $selector]
|
192
|
+
set xfail_selector [string range $selector $xfail_index end]
|
193
|
+
set target_selector [string range $selector 0 [expr $xfail_index-1]]
|
194
|
+
set target_selector [string trim $target_selector]
|
195
|
+
if { [dg-process-target-1 $target_selector] == "N" } {
|
196
|
+
return "N"
|
197
|
+
}
|
198
|
+
return [dg-process-target-1 $xfail_selector]
|
199
|
+
|
200
|
+
}
|
201
|
+
return [dg-process-target-1 $selector]
|
202
|
+
}
|
203
|
+
}
|
27
204
|
|
28
205
|
# Define libffi callbacks for dg.exp.
|
29
206
|
|
@@ -89,6 +266,12 @@ proc libffi-dg-test { prog do_what extra_tool_flags } {
|
|
89
266
|
return [libffi-dg-test-1 target_compile $prog $do_what $extra_tool_flags]
|
90
267
|
}
|
91
268
|
|
269
|
+
proc libffi-dg-prune { target_triplet text } {
|
270
|
+
# We get this with some qemu emulated systems (eg. ppc64le-linux-gnu)
|
271
|
+
regsub -all "(^|\n)\[^\n\]*unable to perform all requested operations" $text "" text
|
272
|
+
return $text
|
273
|
+
}
|
274
|
+
|
92
275
|
proc libffi-init { args } {
|
93
276
|
global gluefile wrap_flags;
|
94
277
|
global srcdir
|
@@ -100,33 +283,44 @@ proc libffi-init { args } {
|
|
100
283
|
global libffi_link_flags
|
101
284
|
global tool_root_dir
|
102
285
|
global ld_library_path
|
286
|
+
global compiler_vendor
|
103
287
|
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
|
108
|
-
if {$gccdir != ""} {
|
109
|
-
set gccdir [file dirname $gccdir]
|
288
|
+
if ![info exists blddirffi] {
|
289
|
+
set blddirffi [pwd]/..
|
110
290
|
}
|
111
|
-
verbose "gccdir $gccdir"
|
112
291
|
|
113
|
-
|
114
|
-
append ld_library_path ":${gccdir}"
|
292
|
+
verbose "libffi $blddirffi"
|
115
293
|
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
294
|
+
# Which compiler are we building with?
|
295
|
+
set tmp [grep "$blddirffi/config.log" "^ax_cv_c_compiler_vendor.*$"]
|
296
|
+
regexp -- {^[^=]*=(.*)$} $tmp nil compiler_vendor
|
297
|
+
|
298
|
+
if { [string match $compiler_vendor "gnu"] } {
|
299
|
+
set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
|
300
|
+
if {$gccdir != ""} {
|
301
|
+
set gccdir [file dirname $gccdir]
|
302
|
+
}
|
303
|
+
verbose "gccdir $gccdir"
|
304
|
+
|
305
|
+
set ld_library_path "."
|
306
|
+
append ld_library_path ":${gccdir}"
|
307
|
+
|
308
|
+
set compiler "${gccdir}/xgcc"
|
309
|
+
if { [is_remote host] == 0 && [which $compiler] != 0 } {
|
310
|
+
foreach i "[exec $compiler --print-multi-lib]" {
|
311
|
+
set mldir ""
|
312
|
+
regexp -- "\[a-z0-9=_/\.-\]*;" $i mldir
|
313
|
+
set mldir [string trimright $mldir "\;@"]
|
314
|
+
if { "$mldir" == "." } {
|
315
|
+
continue
|
316
|
+
}
|
317
|
+
if { [llength [glob -nocomplain ${gccdir}/${mldir}/libgcc_s*.so.*]] >= 1 } {
|
318
|
+
append ld_library_path ":${gccdir}/${mldir}"
|
319
|
+
}
|
127
320
|
}
|
128
|
-
|
321
|
+
}
|
129
322
|
}
|
323
|
+
|
130
324
|
# add the library path for libffi.
|
131
325
|
append ld_library_path ":${blddirffi}/.libs"
|
132
326
|
|
@@ -164,7 +358,7 @@ proc libffi_target_compile { source dest type options } {
|
|
164
358
|
global libffi_link_flags
|
165
359
|
global libffi_include
|
166
360
|
global target_triplet
|
167
|
-
|
361
|
+
global compiler_vendor
|
168
362
|
|
169
363
|
if { [target_info needs_status_wrapper]!="" && [info exists gluefile] } {
|
170
364
|
lappend options "libs=${gluefile}"
|
@@ -174,7 +368,7 @@ proc libffi_target_compile { source dest type options } {
|
|
174
368
|
# TOOL_OPTIONS must come first, so that it doesn't override testcase
|
175
369
|
# specific options.
|
176
370
|
if [info exists TOOL_OPTIONS] {
|
177
|
-
lappend options
|
371
|
+
lappend options "additional_flags=$TOOL_OPTIONS"
|
178
372
|
}
|
179
373
|
|
180
374
|
# search for ffi_mips.h in srcdir, too
|
@@ -203,10 +397,42 @@ proc libffi_target_compile { source dest type options } {
|
|
203
397
|
|
204
398
|
lappend options "libs= -lffi"
|
205
399
|
|
400
|
+
if { [string match "aarch64*-*-linux*" $target_triplet] } {
|
401
|
+
lappend options "libs= -lpthread"
|
402
|
+
}
|
403
|
+
|
404
|
+
# this may be required for g++, but just confused clang.
|
405
|
+
if { [string match "*.cc" $source] } {
|
406
|
+
lappend options "c++"
|
407
|
+
}
|
408
|
+
|
409
|
+
if { [string match "arc*-*-linux*" $target_triplet] } {
|
410
|
+
lappend options "libs= -lpthread"
|
411
|
+
}
|
412
|
+
|
206
413
|
verbose "options: $options"
|
207
414
|
return [target_compile $source $dest $type $options]
|
208
415
|
}
|
209
416
|
|
417
|
+
# TEST should be a preprocessor condition. Returns true if it holds.
|
418
|
+
proc libffi_feature_test { test } {
|
419
|
+
set src "ffitest[pid].c"
|
420
|
+
|
421
|
+
set f [open $src "w"]
|
422
|
+
puts $f "#include <ffi.h>"
|
423
|
+
puts $f $test
|
424
|
+
puts $f "/* OK */"
|
425
|
+
puts $f "#else"
|
426
|
+
puts $f "# error Failed $test"
|
427
|
+
puts $f "#endif"
|
428
|
+
close $f
|
429
|
+
|
430
|
+
set lines [libffi_target_compile $src /dev/null assembly ""]
|
431
|
+
file delete $src
|
432
|
+
|
433
|
+
return [string match "" $lines]
|
434
|
+
}
|
435
|
+
|
210
436
|
# Utility routines.
|
211
437
|
|
212
438
|
#
|
@@ -254,6 +480,90 @@ proc libffi-dg-runtest { testcases default-extra-flags } {
|
|
254
480
|
}
|
255
481
|
}
|
256
482
|
|
483
|
+
proc run-many-tests { testcases extra_flags } {
|
484
|
+
global compiler_vendor
|
485
|
+
global has_gccbug
|
486
|
+
global env
|
487
|
+
switch $compiler_vendor {
|
488
|
+
"clang" {
|
489
|
+
set common "-W -Wall"
|
490
|
+
if [info exists env(LIBFFI_TEST_OPTIMIZATION)] {
|
491
|
+
set optimizations [ list $env(LIBFFI_TEST_OPTIMIZATION) ]
|
492
|
+
} else {
|
493
|
+
set optimizations { "-O0" "-O2" }
|
494
|
+
}
|
495
|
+
}
|
496
|
+
"gnu" {
|
497
|
+
set common "-W -Wall -Wno-psabi"
|
498
|
+
if [info exists env(LIBFFI_TEST_OPTIMIZATION)] {
|
499
|
+
set optimizations [ list $env(LIBFFI_TEST_OPTIMIZATION) ]
|
500
|
+
} else {
|
501
|
+
set optimizations { "-O0" "-O2" }
|
502
|
+
}
|
503
|
+
}
|
504
|
+
default {
|
505
|
+
# Assume we are using the vendor compiler.
|
506
|
+
set common ""
|
507
|
+
if [info exists env(LIBFFI_TEST_OPTIMIZATION)] {
|
508
|
+
set optimizations [ list $env(LIBFFI_TEST_OPTIMIZATION) ]
|
509
|
+
} else {
|
510
|
+
set optimizations { "" }
|
511
|
+
}
|
512
|
+
}
|
513
|
+
}
|
514
|
+
|
515
|
+
info exists env(LD_LIBRARY_PATH)
|
516
|
+
|
517
|
+
set targetabis { "" }
|
518
|
+
if [string match $compiler_vendor "gnu"] {
|
519
|
+
if [libffi_feature_test "#ifdef __i386__"] {
|
520
|
+
set targetabis {
|
521
|
+
""
|
522
|
+
"-DABI_NUM=FFI_STDCALL -DABI_ATTR=__STDCALL__"
|
523
|
+
"-DABI_NUM=FFI_THISCALL -DABI_ATTR=__THISCALL__"
|
524
|
+
"-DABI_NUM=FFI_FASTCALL -DABI_ATTR=__FASTCALL__"
|
525
|
+
}
|
526
|
+
} elseif { [istarget "x86_64-*-*"] \
|
527
|
+
&& [libffi_feature_test "#if !defined __ILP32__ \
|
528
|
+
&& !defined __i386__"] } {
|
529
|
+
set targetabis {
|
530
|
+
""
|
531
|
+
"-DABI_NUM=FFI_GNUW64 -DABI_ATTR=__MSABI__"
|
532
|
+
}
|
533
|
+
}
|
534
|
+
}
|
535
|
+
|
536
|
+
set common [ concat $common $extra_flags ]
|
537
|
+
foreach test $testcases {
|
538
|
+
set testname [file tail $test]
|
539
|
+
if [search_for $test "ABI_NUM"] {
|
540
|
+
set abis $targetabis
|
541
|
+
} else {
|
542
|
+
set abis { "" }
|
543
|
+
}
|
544
|
+
foreach opt $optimizations {
|
545
|
+
foreach abi $abis {
|
546
|
+
set options [concat $common $opt $abi]
|
547
|
+
set has_gccbug false;
|
548
|
+
if { [string match $compiler_vendor "gnu"] \
|
549
|
+
&& [string match "*MSABI*" $abi] \
|
550
|
+
&& ( ( [string match "*DGTEST=57 *" $common] \
|
551
|
+
&& [string match "*call.c*" $testname] ) \
|
552
|
+
|| ( [string match "*DGTEST=54 *" $common] \
|
553
|
+
&& [string match "*callback*" $testname] ) \
|
554
|
+
|| [string match "*DGTEST=55 *" $common] \
|
555
|
+
|| [string match "*DGTEST=56 *" $common] ) } then {
|
556
|
+
if [libffi_feature_test "#if (__GNUC__ < 9) || ((__GNUC__ == 9) && (__GNUC_MINOR__ < 3))"] {
|
557
|
+
set has_gccbug true;
|
558
|
+
}
|
559
|
+
}
|
560
|
+
verbose "Testing $testname, $options" 1
|
561
|
+
verbose "has_gccbug = $has_gccbug" 1
|
562
|
+
dg-test $test $options ""
|
563
|
+
}
|
564
|
+
}
|
565
|
+
}
|
566
|
+
}
|
257
567
|
|
258
568
|
# Like check_conditional_xfail, but callable from a dg test.
|
259
569
|
|
@@ -25,7 +25,7 @@ set orig_ld_library64_path_saved 0
|
|
25
25
|
set orig_ld_library_path_32_saved 0
|
26
26
|
set orig_ld_library_path_64_saved 0
|
27
27
|
set orig_dyld_library_path_saved 0
|
28
|
-
|
28
|
+
set orig_path_saved 0
|
29
29
|
|
30
30
|
#######################################
|
31
31
|
# proc set_ld_library_path_env_vars { }
|
@@ -42,6 +42,7 @@ proc set_ld_library_path_env_vars { } {
|
|
42
42
|
global orig_ld_library_path_32_saved
|
43
43
|
global orig_ld_library_path_64_saved
|
44
44
|
global orig_dyld_library_path_saved
|
45
|
+
global orig_path_saved
|
45
46
|
global orig_ld_library_path
|
46
47
|
global orig_ld_run_path
|
47
48
|
global orig_shlib_path
|
@@ -50,6 +51,7 @@ proc set_ld_library_path_env_vars { } {
|
|
50
51
|
global orig_ld_library_path_32
|
51
52
|
global orig_ld_library_path_64
|
52
53
|
global orig_dyld_library_path
|
54
|
+
global orig_path
|
53
55
|
global GCC_EXEC_PREFIX
|
54
56
|
|
55
57
|
# Set the relocated compiler prefix, but only if the user hasn't specified one.
|
@@ -100,6 +102,10 @@ proc set_ld_library_path_env_vars { } {
|
|
100
102
|
set orig_dyld_library_path "$env(DYLD_LIBRARY_PATH)"
|
101
103
|
set orig_dyld_library_path_saved 1
|
102
104
|
}
|
105
|
+
if [info exists env(PATH)] {
|
106
|
+
set orig_path "$env(PATH)"
|
107
|
+
set orig_path_saved 1
|
108
|
+
}
|
103
109
|
}
|
104
110
|
|
105
111
|
# We need to set ld library path in the environment. Currently,
|
@@ -169,6 +175,13 @@ proc set_ld_library_path_env_vars { } {
|
|
169
175
|
} else {
|
170
176
|
setenv DYLD_LIBRARY_PATH "$ld_library_path"
|
171
177
|
}
|
178
|
+
if { [istarget *-*-cygwin*] || [istarget *-*-mingw*] } {
|
179
|
+
if { $orig_path_saved } {
|
180
|
+
setenv PATH "$ld_library_path:$orig_path"
|
181
|
+
} else {
|
182
|
+
setenv PATH "$ld_library_path"
|
183
|
+
}
|
184
|
+
}
|
172
185
|
|
173
186
|
verbose -log "set_ld_library_path_env_vars: ld_library_path=$ld_library_path"
|
174
187
|
}
|
@@ -187,6 +200,7 @@ proc restore_ld_library_path_env_vars { } {
|
|
187
200
|
global orig_ld_library_path_32_saved
|
188
201
|
global orig_ld_library_path_64_saved
|
189
202
|
global orig_dyld_library_path_saved
|
203
|
+
global orig_path_saved
|
190
204
|
global orig_ld_library_path
|
191
205
|
global orig_ld_run_path
|
192
206
|
global orig_shlib_path
|
@@ -195,6 +209,7 @@ proc restore_ld_library_path_env_vars { } {
|
|
195
209
|
global orig_ld_library_path_32
|
196
210
|
global orig_ld_library_path_64
|
197
211
|
global orig_dyld_library_path
|
212
|
+
global orig_path
|
198
213
|
|
199
214
|
if { $orig_environment_saved == 0 } {
|
200
215
|
return
|
@@ -240,6 +255,11 @@ proc restore_ld_library_path_env_vars { } {
|
|
240
255
|
} elseif [info exists env(DYLD_LIBRARY_PATH)] {
|
241
256
|
unsetenv DYLD_LIBRARY_PATH
|
242
257
|
}
|
258
|
+
if { $orig_path_saved } {
|
259
|
+
setenv PATH "$orig_path"
|
260
|
+
} elseif [info exists env(PATH)] {
|
261
|
+
unsetenv PATH
|
262
|
+
}
|
243
263
|
}
|
244
264
|
|
245
265
|
#######################################
|
@@ -0,0 +1,28 @@
|
|
1
|
+
CC = gcc
|
2
|
+
CFLAGS = -O2 -Wall
|
3
|
+
prefix =
|
4
|
+
includedir = $(prefix)/include
|
5
|
+
libdir = $(prefix)/lib
|
6
|
+
CPPFLAGS = -I$(includedir)
|
7
|
+
LDFLAGS = -L$(libdir) -Wl,-rpath,$(libdir)
|
8
|
+
|
9
|
+
all: check-call check-callback
|
10
|
+
|
11
|
+
test-call: test-call.c testcases.c
|
12
|
+
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o test-call test-call.c -lffi
|
13
|
+
|
14
|
+
test-callback: test-callback.c testcases.c
|
15
|
+
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o test-callback test-callback.c -lffi
|
16
|
+
|
17
|
+
check-call: test-call
|
18
|
+
./test-call > test-call.out
|
19
|
+
LC_ALL=C uniq -u < test-call.out > failed-call
|
20
|
+
test '!' -s failed-call
|
21
|
+
|
22
|
+
check-callback: test-callback
|
23
|
+
./test-callback > test-callback.out
|
24
|
+
LC_ALL=C uniq -u < test-callback.out > failed-callback
|
25
|
+
test '!' -s failed-callback
|
26
|
+
|
27
|
+
clean:
|
28
|
+
rm -f test-call test-callback test-call.out test-callback.out failed-call failed-callback
|
@@ -0,0 +1,78 @@
|
|
1
|
+
This package contains a test suite for libffi.
|
2
|
+
|
3
|
+
This test suite can be compiled with a C compiler. No need for 'expect'
|
4
|
+
or some other package that is often not installed.
|
5
|
+
|
6
|
+
The test suite consists of 81 C functions, each with a different signature.
|
7
|
+
* test-call verifies that calling each function directly produces the same
|
8
|
+
results as calling the function indirectly through 'ffi_call'.
|
9
|
+
* test-callback verifies that calling each function directly produces the same
|
10
|
+
results as calling a function that is a callback (object build by
|
11
|
+
'ffi_prep_closure_loc') and simulates the original function.
|
12
|
+
|
13
|
+
Each direct or indirect invocation should produce one line of output to
|
14
|
+
stdout. A correct output consists of paired lines, such as
|
15
|
+
|
16
|
+
void f(void):
|
17
|
+
void f(void):
|
18
|
+
int f(void):->99
|
19
|
+
int f(void):->99
|
20
|
+
int f(int):(1)->2
|
21
|
+
int f(int):(1)->2
|
22
|
+
int f(2*int):(1,2)->3
|
23
|
+
int f(2*int):(1,2)->3
|
24
|
+
...
|
25
|
+
|
26
|
+
The Makefile then creates two files:
|
27
|
+
* failed-call, which consists of the non-paired lines of output of
|
28
|
+
'test-call',
|
29
|
+
* failed-callback, which consists of the non-paired lines of output of
|
30
|
+
'test-callback'.
|
31
|
+
|
32
|
+
The test suite passes if both failed-call and failed-callback come out
|
33
|
+
as empty.
|
34
|
+
|
35
|
+
|
36
|
+
How to use the test suite
|
37
|
+
-------------------------
|
38
|
+
|
39
|
+
1. Modify the Makefile's variables
|
40
|
+
prefix = the directory in which libffi was installed
|
41
|
+
CC = the C compiler, often with options such as "-m32" or "-m64"
|
42
|
+
that enforce a certain ABI,
|
43
|
+
CFLAGS = optimization options (need to change them only for non-GCC
|
44
|
+
compilers)
|
45
|
+
2. Run "make". If it fails already in "test-call", run also
|
46
|
+
"make check-callback".
|
47
|
+
3. If this failed, inspect the output files.
|
48
|
+
|
49
|
+
|
50
|
+
How to interpret the results
|
51
|
+
----------------------------
|
52
|
+
|
53
|
+
The failed-call and failed-callback files consist of paired lines:
|
54
|
+
The first line is the result of the direct invocation.
|
55
|
+
The second line is the result of invocation through libffi.
|
56
|
+
|
57
|
+
For example, this output
|
58
|
+
|
59
|
+
uchar f(uchar,ushort,uint,ulong):(97,2,3,4)->255
|
60
|
+
uchar f(uchar,ushort,uint,ulong):(97,2,3,4)->0
|
61
|
+
|
62
|
+
indicates that the arguments were passed correctly, but the return
|
63
|
+
value came out wrong.
|
64
|
+
|
65
|
+
And this output
|
66
|
+
|
67
|
+
float f(17*float,3*int,L):(0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,6,7,8,561,1105,1729,2465,2821,6601)->15319.1
|
68
|
+
float f(17*float,3*int,L):(0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,-140443648,10,268042216,-72537980,-140443648,-140443648,-140443648,-140443648,-140443648)->-6.47158e+08
|
69
|
+
|
70
|
+
indicates that integer arguments that come after 17 floating-point arguments
|
71
|
+
were not passed correctly.
|
72
|
+
|
73
|
+
|
74
|
+
Credits
|
75
|
+
-------
|
76
|
+
|
77
|
+
The test suite is based on the one of GNU libffcall-2.0.
|
78
|
+
Authors: Bill Triggs, Bruno Haible
|
@@ -0,0 +1,50 @@
|
|
1
|
+
/* Determine alignment of types.
|
2
|
+
Copyright (C) 2003-2004, 2006, 2009-2017 Free Software Foundation, Inc.
|
3
|
+
|
4
|
+
This program is free software; you can redistribute it and/or modify
|
5
|
+
it under the terms of the GNU General Public License as published by
|
6
|
+
the Free Software Foundation; either version 2, or (at your option)
|
7
|
+
any later version.
|
8
|
+
|
9
|
+
This program is distributed in the hope that it will be useful,
|
10
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
+
GNU General Public License for more details.
|
13
|
+
|
14
|
+
You should have received a copy of the GNU General Public License
|
15
|
+
along with this program; if not, see <https://www.gnu.org/licenses/>. */
|
16
|
+
|
17
|
+
#ifndef _ALIGNOF_H
|
18
|
+
#define _ALIGNOF_H
|
19
|
+
|
20
|
+
#include <stddef.h>
|
21
|
+
|
22
|
+
/* alignof_slot (TYPE)
|
23
|
+
Determine the alignment of a structure slot (field) of a given type,
|
24
|
+
at compile time. Note that the result depends on the ABI.
|
25
|
+
This is the same as alignof (TYPE) and _Alignof (TYPE), defined in
|
26
|
+
<stdalign.h> if __alignof_is_defined is 1.
|
27
|
+
Note: The result cannot be used as a value for an 'enum' constant,
|
28
|
+
due to bugs in HP-UX 10.20 cc and AIX 3.2.5 xlc. */
|
29
|
+
#if defined __cplusplus
|
30
|
+
template <class type> struct alignof_helper { char __slot1; type __slot2; };
|
31
|
+
# define alignof_slot(type) offsetof (alignof_helper<type>, __slot2)
|
32
|
+
#else
|
33
|
+
# define alignof_slot(type) offsetof (struct { char __slot1; type __slot2; }, __slot2)
|
34
|
+
#endif
|
35
|
+
|
36
|
+
/* alignof_type (TYPE)
|
37
|
+
Determine the good alignment of an object of the given type at compile time.
|
38
|
+
Note that this is not necessarily the same as alignof_slot(type).
|
39
|
+
For example, with GNU C on x86 platforms: alignof_type(double) = 8, but
|
40
|
+
- when -malign-double is not specified: alignof_slot(double) = 4,
|
41
|
+
- when -malign-double is specified: alignof_slot(double) = 8.
|
42
|
+
Note: The result cannot be used as a value for an 'enum' constant,
|
43
|
+
due to bugs in HP-UX 10.20 cc and AIX 3.2.5 xlc. */
|
44
|
+
#if defined __GNUC__ || defined __IBM__ALIGNOF__
|
45
|
+
# define alignof_type __alignof__
|
46
|
+
#else
|
47
|
+
# define alignof_type alignof_slot
|
48
|
+
#endif
|
49
|
+
|
50
|
+
#endif /* _ALIGNOF_H */
|