ffi 1.9.18-x86-mingw32 → 1.9.21-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of ffi might be problematic. Click here for more details.
- checksums.yaml +5 -5
- data/README.md +3 -2
- data/Rakefile +14 -4
- data/ext/ffi_c/AbstractMemory.c +6 -1
- data/ext/ffi_c/Platform.c +10 -2
- data/ext/ffi_c/extconf.rb +7 -2
- data/ext/ffi_c/libffi.bsd.mk +9 -3
- data/ext/ffi_c/libffi.darwin.mk +14 -4
- data/ext/ffi_c/libffi.gnu.mk +2 -1
- data/ext/ffi_c/libffi.mk +9 -4
- data/ext/ffi_c/libffi/ChangeLog.libffi +2 -2
- data/ext/ffi_c/libffi/{ChangeLog → ChangeLog.libffi-3.1} +1402 -2
- data/ext/ffi_c/libffi/ChangeLog.v1 +1 -1
- data/ext/ffi_c/libffi/LICENSE +1 -1
- data/ext/ffi_c/libffi/Makefile.am +166 -157
- data/ext/ffi_c/libffi/Makefile.in +923 -938
- data/ext/ffi_c/libffi/README +164 -52
- data/ext/ffi_c/libffi/acinclude.m4 +381 -0
- data/ext/ffi_c/libffi/aclocal.m4 +645 -384
- data/ext/ffi_c/libffi/autogen.sh +2 -0
- data/ext/ffi_c/libffi/autom4te.cache/output.0 +21972 -0
- data/ext/ffi_c/libffi/autom4te.cache/output.1 +21972 -0
- data/ext/ffi_c/libffi/autom4te.cache/output.2 +21972 -0
- data/ext/ffi_c/libffi/autom4te.cache/output.3 +21972 -0
- data/ext/ffi_c/libffi/autom4te.cache/requests +331 -0
- data/ext/ffi_c/libffi/autom4te.cache/traces.0 +4010 -0
- data/ext/ffi_c/libffi/autom4te.cache/traces.1 +1005 -0
- data/ext/ffi_c/libffi/autom4te.cache/traces.2 +4010 -0
- data/ext/ffi_c/libffi/autom4te.cache/traces.3 +4010 -0
- data/ext/ffi_c/libffi/compile +218 -14
- data/ext/ffi_c/libffi/config.guess +329 -368
- data/ext/ffi_c/libffi/config.sub +232 -112
- data/ext/ffi_c/libffi/configure +6970 -2189
- data/ext/ffi_c/libffi/configure.ac +148 -256
- data/ext/ffi_c/libffi/configure.host +265 -4
- data/ext/ffi_c/libffi/depcomp +346 -185
- data/ext/ffi_c/libffi/doc/Makefile.am +3 -0
- data/ext/ffi_c/libffi/doc/Makefile.in +811 -0
- data/ext/ffi_c/libffi/doc/libffi.texi +430 -45
- data/ext/ffi_c/libffi/{mdate-sh → doc/mdate-sh} +40 -13
- data/ext/ffi_c/libffi/{texinfo.tex → doc/texinfo.tex} +3990 -1121
- data/ext/ffi_c/libffi/doc/version.texi +4 -4
- data/ext/ffi_c/libffi/fficonfig.h.in +24 -13
- data/ext/ffi_c/libffi/fficonfig.h.in~ +210 -0
- data/ext/ffi_c/libffi/generate-darwin-source-and-headers.py +207 -0
- data/ext/ffi_c/libffi/include/Makefile.am +3 -3
- data/ext/ffi_c/libffi/include/Makefile.in +188 -71
- data/ext/ffi_c/libffi/include/ffi.h.in +107 -50
- data/ext/ffi_c/libffi/include/ffi_cfi.h +55 -0
- data/ext/ffi_c/libffi/include/ffi_common.h +32 -11
- data/ext/ffi_c/libffi/install-sh +190 -202
- data/ext/ffi_c/libffi/libffi.map.in +80 -0
- data/ext/ffi_c/libffi/libffi.pc.in +3 -2
- data/ext/ffi_c/libffi/libffi.xcodeproj/project.pbxproj +637 -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 +3553 -2033
- data/ext/ffi_c/libffi/m4/asmcfi.m4 +13 -0
- data/ext/ffi_c/libffi/m4/ax_append_flag.m4 +69 -0
- data/ext/ffi_c/libffi/m4/ax_cc_maxopt.m4 +13 -8
- data/ext/ffi_c/libffi/m4/ax_cflags_warn_all.m4 +31 -104
- data/ext/ffi_c/libffi/m4/{ax_check_compiler_flags.m4 → ax_check_compile_flag.m4} +30 -34
- data/ext/ffi_c/libffi/m4/ax_compiler_vendor.m4 +32 -11
- data/ext/ffi_c/libffi/m4/ax_enable_builddir.m4 +6 -5
- data/ext/ffi_c/libffi/m4/ax_gcc_archflag.m4 +31 -21
- data/ext/ffi_c/libffi/m4/libtool.m4 +1691 -1135
- data/ext/ffi_c/libffi/m4/ltoptions.m4 +104 -36
- data/ext/ffi_c/libffi/m4/ltsugar.m4 +4 -3
- data/ext/ffi_c/libffi/m4/ltversion.m4 +6 -6
- data/ext/ffi_c/libffi/m4/lt~obsolete.m4 +4 -3
- data/ext/ffi_c/libffi/man/Makefile.am +2 -2
- data/ext/ffi_c/libffi/man/Makefile.in +141 -49
- 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 +150 -311
- data/ext/ffi_c/libffi/msvcc.sh +72 -9
- data/ext/ffi_c/libffi/src/aarch64/ffi.c +941 -0
- data/ext/ffi_c/libffi/src/aarch64/ffitarget.h +81 -0
- data/ext/ffi_c/libffi/src/aarch64/internal.h +67 -0
- data/ext/ffi_c/libffi/src/aarch64/sysv.S +438 -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 +597 -517
- data/ext/ffi_c/libffi/src/arm/ffitarget.h +24 -7
- data/ext/ffi_c/libffi/src/arm/internal.h +7 -0
- data/ext/ffi_c/libffi/src/arm/sysv.S +303 -417
- 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 +319 -44
- 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/debug.c +6 -1
- data/ext/ffi_c/libffi/src/dlmalloc.c +16 -11
- data/ext/ffi_c/libffi/src/frv/ffi.c +1 -1
- data/ext/ffi_c/libffi/src/frv/ffitarget.h +6 -1
- data/ext/ffi_c/libffi/src/ia64/ffi.c +11 -7
- data/ext/ffi_c/libffi/src/ia64/ffitarget.h +6 -1
- data/ext/ffi_c/libffi/src/java_raw_api.c +23 -5
- 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 +95 -28
- data/ext/ffi_c/libffi/src/mips/ffitarget.h +9 -2
- data/ext/ffi_c/libffi/src/mips/n32.S +126 -56
- data/ext/ffi_c/libffi/src/mips/o32.S +148 -27
- data/ext/ffi_c/libffi/src/moxie/eabi.S +55 -82
- data/ext/ffi_c/libffi/src/moxie/ffi.c +40 -44
- 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/ffitarget.h +8 -1
- data/ext/ffi_c/libffi/src/powerpc/aix.S +6 -6
- data/ext/ffi_c/libffi/src/powerpc/aix_closure.S +3 -1
- 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 +103 -1378
- data/ext/ffi_c/libffi/src/powerpc/ffi_darwin.c +25 -25
- data/ext/ffi_c/libffi/src/powerpc/ffi_linux64.c +945 -0
- data/ext/ffi_c/libffi/src/powerpc/ffi_powerpc.h +94 -0
- data/ext/ffi_c/libffi/src/powerpc/ffi_sysv.c +923 -0
- data/ext/ffi_c/libffi/src/powerpc/ffitarget.h +100 -44
- data/ext/ffi_c/libffi/src/powerpc/linux64.S +100 -59
- data/ext/ffi_c/libffi/src/powerpc/linux64_closure.S +360 -108
- data/ext/ffi_c/libffi/src/powerpc/ppc_closure.S +138 -68
- data/ext/ffi_c/libffi/src/powerpc/sysv.S +68 -112
- data/ext/ffi_c/libffi/src/prep_cif.c +108 -24
- data/ext/ffi_c/libffi/src/raw_api.c +18 -5
- 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 +43 -14
- 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 +589 -500
- data/ext/ffi_c/libffi/src/x86/ffi64.c +338 -116
- data/ext/ffi_c/libffi/src/x86/ffitarget.h +55 -35
- data/ext/ffi_c/libffi/src/x86/ffiw64.c +287 -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 +975 -400
- data/ext/ffi_c/libffi/src/x86/unix64.S +398 -299
- data/ext/ffi_c/libffi/src/x86/win64.S +222 -458
- data/ext/ffi_c/libffi/src/x86/win64_intel.S +237 -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 +253 -0
- data/ext/ffi_c/libffi/stamp-h.in +1 -0
- data/ext/ffi_c/libffi/testsuite/Makefile.am +78 -73
- data/ext/ffi_c/libffi/testsuite/Makefile.in +218 -111
- data/ext/ffi_c/libffi/testsuite/lib/libffi.exp +120 -25
- data/ext/ffi_c/libffi/testsuite/lib/target-libpath.exp +21 -1
- data/ext/ffi_c/libffi/testsuite/libffi.call/align_mixed.c +46 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/call.exp +4 -6
- data/ext/ffi_c/libffi/testsuite/libffi.call/{closure_stdcall.c → closure_simple.c} +7 -16
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_12byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_16byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_18byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_19byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_1_1byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_20byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_20byte1.c +4 -4
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_24byte.c +5 -5
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_2byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_3_1byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_3byte1.c +4 -4
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_3byte2.c +4 -4
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_4_1byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_4byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_5_1_byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_5byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_64byte.c +5 -5
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_6_1_byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_6byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_7_1_byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_7byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_8byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_9byte1.c +4 -4
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_9byte2.c +4 -4
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_double.c +4 -4
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_float.c +4 -4
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_longdouble.c +4 -4
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_longdouble_split.c +4 -6
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_longdouble_split2.c +4 -6
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_pointer.c +4 -4
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_sint16.c +4 -4
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_sint32.c +4 -4
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_sint64.c +4 -4
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_uint16.c +4 -4
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_uint32.c +4 -4
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_uint64.c +4 -4
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_dbls_struct.c +4 -4
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_double_va.c +10 -9
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_longdouble.c +3 -3
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_longdouble_va.c +10 -9
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_many_mixed_args.c +70 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_many_mixed_float_double.c +55 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_pointer.c +1 -1
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_pointer_stack.c +11 -9
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_struct_va1.c +114 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_uchar_va.c +44 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_uint_va.c +45 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_ulong_va.c +45 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_ulonglong.c +5 -5
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_ushort_va.c +44 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/err_bad_typedef.c +2 -2
- data/ext/ffi_c/libffi/testsuite/libffi.call/ffitest.h +23 -40
- data/ext/ffi_c/libffi/testsuite/libffi.call/float1.c +3 -1
- data/ext/ffi_c/libffi/testsuite/libffi.call/float2.c +6 -4
- 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/huge_struct.c +18 -19
- 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/nested_struct.c +6 -6
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct1.c +8 -8
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct10.c +6 -6
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct11.c +121 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct2.c +5 -5
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct3.c +5 -5
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct4.c +5 -5
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct5.c +5 -5
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct6.c +6 -6
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct7.c +5 -5
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct8.c +6 -6
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct9.c +6 -6
- 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/stret_large.c +7 -7
- data/ext/ffi_c/libffi/testsuite/libffi.call/stret_large2.c +7 -7
- data/ext/ffi_c/libffi/testsuite/libffi.call/stret_medium.c +5 -5
- data/ext/ffi_c/libffi/testsuite/libffi.call/stret_medium2.c +5 -5
- 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/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/testclosure.c +2 -2
- data/ext/ffi_c/libffi/testsuite/libffi.call/uninitialized.c +61 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.special → libffi.call}/unwindtest.cc +3 -10
- data/ext/ffi_c/libffi/testsuite/{libffi.special → libffi.call}/unwindtest_ffi_call.cc +2 -1
- 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.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/ffi.gemspec +2 -2
- data/lib/2.0/ffi_c.so +0 -0
- data/lib/2.1/ffi_c.so +0 -0
- data/lib/2.2/ffi_c.so +0 -0
- data/lib/2.3/ffi_c.so +0 -0
- data/lib/2.4/ffi_c.so +0 -0
- data/lib/2.5/ffi_c.so +0 -0
- data/lib/ffi/enum.rb +124 -0
- data/lib/ffi/library.rb +65 -13
- data/lib/ffi/platform.rb +7 -2
- data/lib/ffi/platform/sparc64-linux/types.conf +102 -0
- data/lib/ffi/platform/x86_64-windows/types.conf +113 -20
- data/lib/ffi/pointer.rb +1 -0
- data/lib/ffi/struct.rb +0 -2
- data/lib/ffi/version.rb +1 -1
- data/spec/ffi/bitmask_spec.rb +575 -0
- data/spec/ffi/embed-test/ext/Makefile +242 -0
- data/spec/ffi/fixtures/BitmaskTest.c +51 -0
- data/spec/ffi/rbx/memory_pointer_spec.rb +4 -0
- data/spec/ffi/struct_spec.rb +0 -4
- metadata +158 -32
- data/ext/ffi_c/libffi/Makefile.vc +0 -141
- data/ext/ffi_c/libffi/Makefile.vc64 +0 -141
- data/ext/ffi_c/libffi/build-ios.sh +0 -67
- 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/include/ffi.h.vc64 +0 -427
- 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
@@ -0,0 +1,55 @@
|
|
1
|
+
/* -----------------------------------------------------------------------
|
2
|
+
ffi_cfi.h - Copyright (c) 2014 Red Hat, Inc.
|
3
|
+
|
4
|
+
Conditionally assemble cfi directives. Only necessary for building libffi.
|
5
|
+
----------------------------------------------------------------------- */
|
6
|
+
|
7
|
+
#ifndef FFI_CFI_H
|
8
|
+
#define FFI_CFI_H
|
9
|
+
|
10
|
+
#ifdef HAVE_AS_CFI_PSEUDO_OP
|
11
|
+
|
12
|
+
# define cfi_startproc .cfi_startproc
|
13
|
+
# define cfi_endproc .cfi_endproc
|
14
|
+
# define cfi_def_cfa(reg, off) .cfi_def_cfa reg, off
|
15
|
+
# define cfi_def_cfa_register(reg) .cfi_def_cfa_register reg
|
16
|
+
# define cfi_def_cfa_offset(off) .cfi_def_cfa_offset off
|
17
|
+
# define cfi_adjust_cfa_offset(off) .cfi_adjust_cfa_offset off
|
18
|
+
# define cfi_offset(reg, off) .cfi_offset reg, off
|
19
|
+
# define cfi_rel_offset(reg, off) .cfi_rel_offset reg, off
|
20
|
+
# define cfi_register(r1, r2) .cfi_register r1, r2
|
21
|
+
# define cfi_return_column(reg) .cfi_return_column reg
|
22
|
+
# define cfi_restore(reg) .cfi_restore reg
|
23
|
+
# define cfi_same_value(reg) .cfi_same_value reg
|
24
|
+
# define cfi_undefined(reg) .cfi_undefined reg
|
25
|
+
# define cfi_remember_state .cfi_remember_state
|
26
|
+
# define cfi_restore_state .cfi_restore_state
|
27
|
+
# define cfi_window_save .cfi_window_save
|
28
|
+
# define cfi_personality(enc, exp) .cfi_personality enc, exp
|
29
|
+
# define cfi_lsda(enc, exp) .cfi_lsda enc, exp
|
30
|
+
# define cfi_escape(...) .cfi_escape __VA_ARGS__
|
31
|
+
|
32
|
+
#else
|
33
|
+
|
34
|
+
# define cfi_startproc
|
35
|
+
# define cfi_endproc
|
36
|
+
# define cfi_def_cfa(reg, off)
|
37
|
+
# define cfi_def_cfa_register(reg)
|
38
|
+
# define cfi_def_cfa_offset(off)
|
39
|
+
# define cfi_adjust_cfa_offset(off)
|
40
|
+
# define cfi_offset(reg, off)
|
41
|
+
# define cfi_rel_offset(reg, off)
|
42
|
+
# define cfi_register(r1, r2)
|
43
|
+
# define cfi_return_column(reg)
|
44
|
+
# define cfi_restore(reg)
|
45
|
+
# define cfi_same_value(reg)
|
46
|
+
# define cfi_undefined(reg)
|
47
|
+
# define cfi_remember_state
|
48
|
+
# define cfi_restore_state
|
49
|
+
# define cfi_window_save
|
50
|
+
# define cfi_personality(enc, exp)
|
51
|
+
# define cfi_lsda(enc, exp)
|
52
|
+
# define cfi_escape(...)
|
53
|
+
|
54
|
+
#endif /* HAVE_AS_CFI_PSEUDO_OP */
|
55
|
+
#endif /* FFI_CFI_H */
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/* -----------------------------------------------------------------------
|
2
|
-
ffi_common.h - Copyright (C) 2011 Anthony Green
|
2
|
+
ffi_common.h - Copyright (C) 2011, 2012, 2013 Anthony Green
|
3
3
|
Copyright (C) 2007 Free Software Foundation, Inc
|
4
4
|
Copyright (c) 1996 Red Hat, Inc.
|
5
5
|
|
@@ -19,10 +19,14 @@ extern "C" {
|
|
19
19
|
/* Do not move this. Some versions of AIX are very picky about where
|
20
20
|
this is positioned. */
|
21
21
|
#ifdef __GNUC__
|
22
|
-
|
23
|
-
#
|
24
|
-
#
|
25
|
-
|
22
|
+
# if HAVE_ALLOCA_H
|
23
|
+
# include <alloca.h>
|
24
|
+
# else
|
25
|
+
/* mingw64 defines this already in malloc.h. */
|
26
|
+
# ifndef alloca
|
27
|
+
# define alloca __builtin_alloca
|
28
|
+
# endif
|
29
|
+
# endif
|
26
30
|
# define MAYBE_UNUSED __attribute__((__unused__))
|
27
31
|
#else
|
28
32
|
# define MAYBE_UNUSED
|
@@ -30,17 +34,17 @@ extern "C" {
|
|
30
34
|
# include <alloca.h>
|
31
35
|
# else
|
32
36
|
# ifdef _AIX
|
33
|
-
|
37
|
+
# pragma alloca
|
34
38
|
# else
|
35
39
|
# ifndef alloca /* predefined by HP cc +Olibcalls */
|
36
40
|
# ifdef _MSC_VER
|
37
41
|
# define alloca _alloca
|
38
42
|
# else
|
39
43
|
char *alloca ();
|
40
|
-
# endif
|
41
44
|
# endif
|
42
45
|
# endif
|
43
46
|
# endif
|
47
|
+
# endif
|
44
48
|
#endif
|
45
49
|
|
46
50
|
/* Check for the existence of memcpy. */
|
@@ -70,11 +74,28 @@ void ffi_type_test(ffi_type *a, char *file, int line);
|
|
70
74
|
#define FFI_ASSERT_VALID_TYPE(x)
|
71
75
|
#endif
|
72
76
|
|
73
|
-
#define
|
77
|
+
#define FFI_ALIGN(v, a) (((((size_t) (v))-1) | ((a)-1))+1)
|
74
78
|
#define ALIGN_DOWN(v, a) (((size_t) (v)) & -a)
|
75
79
|
|
76
80
|
/* Perform machine dependent cif processing */
|
77
81
|
ffi_status ffi_prep_cif_machdep(ffi_cif *cif);
|
82
|
+
ffi_status ffi_prep_cif_machdep_var(ffi_cif *cif,
|
83
|
+
unsigned int nfixedargs, unsigned int ntotalargs);
|
84
|
+
|
85
|
+
|
86
|
+
#if HAVE_LONG_DOUBLE_VARIANT
|
87
|
+
/* Used to adjust size/alignment of ffi types. */
|
88
|
+
void ffi_prep_types (ffi_abi abi);
|
89
|
+
#endif
|
90
|
+
|
91
|
+
/* Used internally, but overridden by some architectures */
|
92
|
+
ffi_status ffi_prep_cif_core(ffi_cif *cif,
|
93
|
+
ffi_abi abi,
|
94
|
+
unsigned int isvariadic,
|
95
|
+
unsigned int nfixedargs,
|
96
|
+
unsigned int ntotalargs,
|
97
|
+
ffi_type *rtype,
|
98
|
+
ffi_type **atypes);
|
78
99
|
|
79
100
|
/* Extended cif, used in callback from assembly routine */
|
80
101
|
typedef struct
|
@@ -85,7 +106,7 @@ typedef struct
|
|
85
106
|
} extended_cif;
|
86
107
|
|
87
108
|
/* Terse sized type definitions. */
|
88
|
-
#if defined(_MSC_VER) || defined(__sgi)
|
109
|
+
#if defined(_MSC_VER) || defined(__sgi) || defined(__SUNPRO_C)
|
89
110
|
typedef unsigned char UINT8;
|
90
111
|
typedef signed char SINT8;
|
91
112
|
typedef unsigned short UINT16;
|
@@ -116,8 +137,8 @@ typedef float FLOAT32;
|
|
116
137
|
#ifndef __GNUC__
|
117
138
|
#define __builtin_expect(x, expected_value) (x)
|
118
139
|
#endif
|
119
|
-
#define LIKELY(x) __builtin_expect((x),1)
|
120
|
-
#define UNLIKELY(x) __builtin_expect((x),
|
140
|
+
#define LIKELY(x) __builtin_expect(!!(x),1)
|
141
|
+
#define UNLIKELY(x) __builtin_expect((x)!=0,0)
|
121
142
|
|
122
143
|
#ifdef __cplusplus
|
123
144
|
}
|
data/ext/ffi_c/libffi/install-sh
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/bin/sh
|
2
2
|
# install - install a program, script, or datafile
|
3
3
|
|
4
|
-
scriptversion=
|
4
|
+
scriptversion=2014-09-12.12; # UTC
|
5
5
|
|
6
6
|
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
7
7
|
# later released in X11R6 (xc/config/util/install.sh) with the
|
@@ -35,25 +35,21 @@ scriptversion=2009-04-28.21; # UTC
|
|
35
35
|
# FSF changes to this file are in the public domain.
|
36
36
|
#
|
37
37
|
# Calling this script install-sh is preferred over install.sh, to prevent
|
38
|
-
#
|
38
|
+
# 'make' implicit rules from creating a file called install from it
|
39
39
|
# when there is no Makefile.
|
40
40
|
#
|
41
41
|
# This script is compatible with the BSD install script, but was written
|
42
42
|
# from scratch.
|
43
43
|
|
44
|
+
tab=' '
|
44
45
|
nl='
|
45
46
|
'
|
46
|
-
IFS="
|
47
|
+
IFS=" $tab$nl"
|
47
48
|
|
48
|
-
#
|
49
|
+
# Set DOITPROG to "echo" to test this script.
|
49
50
|
|
50
|
-
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
51
51
|
doit=${DOITPROG-}
|
52
|
-
|
53
|
-
doit_exec=exec
|
54
|
-
else
|
55
|
-
doit_exec=$doit
|
56
|
-
fi
|
52
|
+
doit_exec=${doit:-exec}
|
57
53
|
|
58
54
|
# Put in absolute file names if you don't have them in your path;
|
59
55
|
# or use environment vars.
|
@@ -68,17 +64,6 @@ mvprog=${MVPROG-mv}
|
|
68
64
|
rmprog=${RMPROG-rm}
|
69
65
|
stripprog=${STRIPPROG-strip}
|
70
66
|
|
71
|
-
posix_glob='?'
|
72
|
-
initialize_posix_glob='
|
73
|
-
test "$posix_glob" != "?" || {
|
74
|
-
if (set -f) 2>/dev/null; then
|
75
|
-
posix_glob=
|
76
|
-
else
|
77
|
-
posix_glob=:
|
78
|
-
fi
|
79
|
-
}
|
80
|
-
'
|
81
|
-
|
82
67
|
posix_mkdir=
|
83
68
|
|
84
69
|
# Desired mode of installed file.
|
@@ -97,7 +82,7 @@ dir_arg=
|
|
97
82
|
dst_arg=
|
98
83
|
|
99
84
|
copy_on_change=false
|
100
|
-
|
85
|
+
is_target_a_directory=possibly
|
101
86
|
|
102
87
|
usage="\
|
103
88
|
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
|
@@ -137,42 +122,57 @@ while test $# -ne 0; do
|
|
137
122
|
-d) dir_arg=true;;
|
138
123
|
|
139
124
|
-g) chgrpcmd="$chgrpprog $2"
|
140
|
-
|
125
|
+
shift;;
|
141
126
|
|
142
127
|
--help) echo "$usage"; exit $?;;
|
143
128
|
|
144
129
|
-m) mode=$2
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
shift;;
|
130
|
+
case $mode in
|
131
|
+
*' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
|
132
|
+
echo "$0: invalid mode: $mode" >&2
|
133
|
+
exit 1;;
|
134
|
+
esac
|
135
|
+
shift;;
|
152
136
|
|
153
137
|
-o) chowncmd="$chownprog $2"
|
154
|
-
|
138
|
+
shift;;
|
155
139
|
|
156
140
|
-s) stripcmd=$stripprog;;
|
157
141
|
|
158
|
-
-t)
|
159
|
-
|
142
|
+
-t)
|
143
|
+
is_target_a_directory=always
|
144
|
+
dst_arg=$2
|
145
|
+
# Protect names problematic for 'test' and other utilities.
|
146
|
+
case $dst_arg in
|
147
|
+
-* | [=\(\)!]) dst_arg=./$dst_arg;;
|
148
|
+
esac
|
149
|
+
shift;;
|
160
150
|
|
161
|
-
-T)
|
151
|
+
-T) is_target_a_directory=never;;
|
162
152
|
|
163
153
|
--version) echo "$0 $scriptversion"; exit $?;;
|
164
154
|
|
165
|
-
--)
|
166
|
-
|
155
|
+
--) shift
|
156
|
+
break;;
|
167
157
|
|
168
|
-
-*)
|
169
|
-
|
158
|
+
-*) echo "$0: invalid option: $1" >&2
|
159
|
+
exit 1;;
|
170
160
|
|
171
161
|
*) break;;
|
172
162
|
esac
|
173
163
|
shift
|
174
164
|
done
|
175
165
|
|
166
|
+
# We allow the use of options -d and -T together, by making -d
|
167
|
+
# take the precedence; this is for compatibility with GNU install.
|
168
|
+
|
169
|
+
if test -n "$dir_arg"; then
|
170
|
+
if test -n "$dst_arg"; then
|
171
|
+
echo "$0: target directory not allowed when installing a directory." >&2
|
172
|
+
exit 1
|
173
|
+
fi
|
174
|
+
fi
|
175
|
+
|
176
176
|
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
|
177
177
|
# When -d is used, all remaining arguments are directories to create.
|
178
178
|
# When -t is used, the destination is already specified.
|
@@ -186,6 +186,10 @@ if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
|
|
186
186
|
fi
|
187
187
|
shift # arg
|
188
188
|
dst_arg=$arg
|
189
|
+
# Protect names problematic for 'test' and other utilities.
|
190
|
+
case $dst_arg in
|
191
|
+
-* | [=\(\)!]) dst_arg=./$dst_arg;;
|
192
|
+
esac
|
189
193
|
done
|
190
194
|
fi
|
191
195
|
|
@@ -194,13 +198,26 @@ if test $# -eq 0; then
|
|
194
198
|
echo "$0: no input file specified." >&2
|
195
199
|
exit 1
|
196
200
|
fi
|
197
|
-
# It's OK to call
|
201
|
+
# It's OK to call 'install-sh -d' without argument.
|
198
202
|
# This can happen when creating conditional directories.
|
199
203
|
exit 0
|
200
204
|
fi
|
201
205
|
|
202
206
|
if test -z "$dir_arg"; then
|
203
|
-
|
207
|
+
if test $# -gt 1 || test "$is_target_a_directory" = always; then
|
208
|
+
if test ! -d "$dst_arg"; then
|
209
|
+
echo "$0: $dst_arg: Is not a directory." >&2
|
210
|
+
exit 1
|
211
|
+
fi
|
212
|
+
fi
|
213
|
+
fi
|
214
|
+
|
215
|
+
if test -z "$dir_arg"; then
|
216
|
+
do_exit='(exit $ret); exit $ret'
|
217
|
+
trap "ret=129; $do_exit" 1
|
218
|
+
trap "ret=130; $do_exit" 2
|
219
|
+
trap "ret=141; $do_exit" 13
|
220
|
+
trap "ret=143; $do_exit" 15
|
204
221
|
|
205
222
|
# Set umask so as not to create temps with too-generous modes.
|
206
223
|
# However, 'strip' requires both read and write access to temps.
|
@@ -211,16 +228,16 @@ if test -z "$dir_arg"; then
|
|
211
228
|
|
212
229
|
*[0-7])
|
213
230
|
if test -z "$stripcmd"; then
|
214
|
-
|
231
|
+
u_plus_rw=
|
215
232
|
else
|
216
|
-
|
233
|
+
u_plus_rw='% 200'
|
217
234
|
fi
|
218
235
|
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
|
219
236
|
*)
|
220
237
|
if test -z "$stripcmd"; then
|
221
|
-
|
238
|
+
u_plus_rw=
|
222
239
|
else
|
223
|
-
|
240
|
+
u_plus_rw=,u+rw
|
224
241
|
fi
|
225
242
|
cp_umask=$mode$u_plus_rw;;
|
226
243
|
esac
|
@@ -228,9 +245,9 @@ fi
|
|
228
245
|
|
229
246
|
for src
|
230
247
|
do
|
231
|
-
# Protect names
|
248
|
+
# Protect names problematic for 'test' and other utilities.
|
232
249
|
case $src in
|
233
|
-
-*) src=./$src;;
|
250
|
+
-* | [=\(\)!]) src=./$src;;
|
234
251
|
esac
|
235
252
|
|
236
253
|
if test -n "$dir_arg"; then
|
@@ -252,51 +269,20 @@ do
|
|
252
269
|
echo "$0: no destination specified." >&2
|
253
270
|
exit 1
|
254
271
|
fi
|
255
|
-
|
256
272
|
dst=$dst_arg
|
257
|
-
# Protect names starting with `-'.
|
258
|
-
case $dst in
|
259
|
-
-*) dst=./$dst;;
|
260
|
-
esac
|
261
273
|
|
262
274
|
# If destination is a directory, append the input filename; won't work
|
263
275
|
# if double slashes aren't ignored.
|
264
276
|
if test -d "$dst"; then
|
265
|
-
if test
|
266
|
-
|
267
|
-
|
277
|
+
if test "$is_target_a_directory" = never; then
|
278
|
+
echo "$0: $dst_arg: Is a directory" >&2
|
279
|
+
exit 1
|
268
280
|
fi
|
269
281
|
dstdir=$dst
|
270
282
|
dst=$dstdir/`basename "$src"`
|
271
283
|
dstdir_status=0
|
272
284
|
else
|
273
|
-
|
274
|
-
dstdir=`
|
275
|
-
(dirname "$dst") 2>/dev/null ||
|
276
|
-
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
|
277
|
-
X"$dst" : 'X\(//\)[^/]' \| \
|
278
|
-
X"$dst" : 'X\(//\)$' \| \
|
279
|
-
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
|
280
|
-
echo X"$dst" |
|
281
|
-
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
|
282
|
-
s//\1/
|
283
|
-
q
|
284
|
-
}
|
285
|
-
/^X\(\/\/\)[^/].*/{
|
286
|
-
s//\1/
|
287
|
-
q
|
288
|
-
}
|
289
|
-
/^X\(\/\/\)$/{
|
290
|
-
s//\1/
|
291
|
-
q
|
292
|
-
}
|
293
|
-
/^X\(\/\).*/{
|
294
|
-
s//\1/
|
295
|
-
q
|
296
|
-
}
|
297
|
-
s/.*/./; q'
|
298
|
-
`
|
299
|
-
|
285
|
+
dstdir=`dirname "$dst"`
|
300
286
|
test -d "$dstdir"
|
301
287
|
dstdir_status=$?
|
302
288
|
fi
|
@@ -307,74 +293,81 @@ do
|
|
307
293
|
if test $dstdir_status != 0; then
|
308
294
|
case $posix_mkdir in
|
309
295
|
'')
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
296
|
+
# Create intermediate dirs using mode 755 as modified by the umask.
|
297
|
+
# This is like FreeBSD 'install' as of 1997-10-28.
|
298
|
+
umask=`umask`
|
299
|
+
case $stripcmd.$umask in
|
300
|
+
# Optimize common cases.
|
301
|
+
*[2367][2367]) mkdir_umask=$umask;;
|
302
|
+
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
|
303
|
+
|
304
|
+
*[0-7])
|
305
|
+
mkdir_umask=`expr $umask + 22 \
|
306
|
+
- $umask % 100 % 40 + $umask % 20 \
|
307
|
+
- $umask % 10 % 4 + $umask % 2
|
308
|
+
`;;
|
309
|
+
*) mkdir_umask=$umask,go-w;;
|
310
|
+
esac
|
311
|
+
|
312
|
+
# With -d, create the new directory with the user-specified mode.
|
313
|
+
# Otherwise, rely on $mkdir_umask.
|
314
|
+
if test -n "$dir_arg"; then
|
315
|
+
mkdir_mode=-m$mode
|
316
|
+
else
|
317
|
+
mkdir_mode=
|
318
|
+
fi
|
319
|
+
|
320
|
+
posix_mkdir=false
|
321
|
+
case $umask in
|
322
|
+
*[123567][0-7][0-7])
|
323
|
+
# POSIX mkdir -p sets u+wx bits regardless of umask, which
|
324
|
+
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
|
325
|
+
;;
|
326
|
+
*)
|
327
|
+
# $RANDOM is not portable (e.g. dash); use it when possible to
|
328
|
+
# lower collision chance
|
329
|
+
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
|
330
|
+
trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
|
331
|
+
|
332
|
+
# As "mkdir -p" follows symlinks and we work in /tmp possibly; so
|
333
|
+
# create the $tmpdir first (and fail if unsuccessful) to make sure
|
334
|
+
# that nobody tries to guess the $tmpdir name.
|
335
|
+
if (umask $mkdir_umask &&
|
336
|
+
$mkdirprog $mkdir_mode "$tmpdir" &&
|
337
|
+
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
|
338
|
+
then
|
339
|
+
if test -z "$dir_arg" || {
|
340
|
+
# Check for POSIX incompatibilities with -m.
|
341
|
+
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
|
342
|
+
# other-writable bit of parent directory when it shouldn't.
|
343
|
+
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
|
344
|
+
test_tmpdir="$tmpdir/a"
|
345
|
+
ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
|
346
|
+
case $ls_ld_tmpdir in
|
347
|
+
d????-?r-*) different_mode=700;;
|
348
|
+
d????-?--*) different_mode=755;;
|
349
|
+
*) false;;
|
350
|
+
esac &&
|
351
|
+
$mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
|
352
|
+
ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
|
353
|
+
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
|
354
|
+
}
|
355
|
+
}
|
356
|
+
then posix_mkdir=:
|
357
|
+
fi
|
358
|
+
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
|
359
|
+
else
|
360
|
+
# Remove any dirs left behind by ancient mkdir implementations.
|
361
|
+
rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
|
362
|
+
fi
|
363
|
+
trap '' 0;;
|
364
|
+
esac;;
|
372
365
|
esac
|
373
366
|
|
374
367
|
if
|
375
368
|
$posix_mkdir && (
|
376
|
-
|
377
|
-
|
369
|
+
umask $mkdir_umask &&
|
370
|
+
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
|
378
371
|
)
|
379
372
|
then :
|
380
373
|
else
|
@@ -384,53 +377,51 @@ do
|
|
384
377
|
# directory the slow way, step by step, checking for races as we go.
|
385
378
|
|
386
379
|
case $dstdir in
|
387
|
-
|
388
|
-
|
389
|
-
|
380
|
+
/*) prefix='/';;
|
381
|
+
[-=\(\)!]*) prefix='./';;
|
382
|
+
*) prefix='';;
|
390
383
|
esac
|
391
384
|
|
392
|
-
eval "$initialize_posix_glob"
|
393
|
-
|
394
385
|
oIFS=$IFS
|
395
386
|
IFS=/
|
396
|
-
|
387
|
+
set -f
|
397
388
|
set fnord $dstdir
|
398
389
|
shift
|
399
|
-
|
390
|
+
set +f
|
400
391
|
IFS=$oIFS
|
401
392
|
|
402
393
|
prefixes=
|
403
394
|
|
404
395
|
for d
|
405
396
|
do
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
397
|
+
test X"$d" = X && continue
|
398
|
+
|
399
|
+
prefix=$prefix$d
|
400
|
+
if test -d "$prefix"; then
|
401
|
+
prefixes=
|
402
|
+
else
|
403
|
+
if $posix_mkdir; then
|
404
|
+
(umask=$mkdir_umask &&
|
405
|
+
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
|
406
|
+
# Don't fail if two instances are running concurrently.
|
407
|
+
test -d "$prefix" || exit 1
|
408
|
+
else
|
409
|
+
case $prefix in
|
410
|
+
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
|
411
|
+
*) qprefix=$prefix;;
|
412
|
+
esac
|
413
|
+
prefixes="$prefixes '$qprefix'"
|
414
|
+
fi
|
415
|
+
fi
|
416
|
+
prefix=$prefix/
|
426
417
|
done
|
427
418
|
|
428
419
|
if test -n "$prefixes"; then
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
420
|
+
# Don't fail if two instances are running concurrently.
|
421
|
+
(umask $mkdir_umask &&
|
422
|
+
eval "\$doit_exec \$mkdirprog $prefixes") ||
|
423
|
+
test -d "$dstdir" || exit 1
|
424
|
+
obsolete_mkdir_used=true
|
434
425
|
fi
|
435
426
|
fi
|
436
427
|
fi
|
@@ -465,15 +456,12 @@ do
|
|
465
456
|
|
466
457
|
# If -C, don't bother to copy if it wouldn't change the file.
|
467
458
|
if $copy_on_change &&
|
468
|
-
old=`LC_ALL=C ls -dlL "$dst"
|
469
|
-
new=`LC_ALL=C ls -dlL "$dsttmp"
|
470
|
-
|
471
|
-
eval "$initialize_posix_glob" &&
|
472
|
-
$posix_glob set -f &&
|
459
|
+
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
|
460
|
+
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
|
461
|
+
set -f &&
|
473
462
|
set X $old && old=:$2:$4:$5:$6 &&
|
474
463
|
set X $new && new=:$2:$4:$5:$6 &&
|
475
|
-
|
476
|
-
|
464
|
+
set +f &&
|
477
465
|
test "$old" = "$new" &&
|
478
466
|
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
|
479
467
|
then
|
@@ -486,24 +474,24 @@ do
|
|
486
474
|
# to itself, or perhaps because mv is so ancient that it does not
|
487
475
|
# support -f.
|
488
476
|
{
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
477
|
+
# Now remove or move aside any old file at destination location.
|
478
|
+
# We try this two ways since rm can't unlink itself on some
|
479
|
+
# systems and the destination file might be busy for other
|
480
|
+
# reasons. In this case, the final cleanup might fail but the new
|
481
|
+
# file should still install successfully.
|
482
|
+
{
|
483
|
+
test ! -f "$dst" ||
|
484
|
+
$doit $rmcmd -f "$dst" 2>/dev/null ||
|
485
|
+
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
|
486
|
+
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
|
487
|
+
} ||
|
488
|
+
{ echo "$0: cannot unlink or rename $dst" >&2
|
489
|
+
(exit 1); exit 1
|
490
|
+
}
|
491
|
+
} &&
|
492
|
+
|
493
|
+
# Now rename the file to the real destination.
|
494
|
+
$doit $mvcmd "$dsttmp" "$dst"
|
507
495
|
}
|
508
496
|
fi || exit 1
|
509
497
|
|