ffi 1.9.18-x64-mingw32 → 1.9.21-x64-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.

Files changed (384) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +3 -2
  3. data/Rakefile +14 -4
  4. data/ext/ffi_c/AbstractMemory.c +6 -1
  5. data/ext/ffi_c/Platform.c +10 -2
  6. data/ext/ffi_c/extconf.rb +7 -2
  7. data/ext/ffi_c/libffi.bsd.mk +9 -3
  8. data/ext/ffi_c/libffi.darwin.mk +14 -4
  9. data/ext/ffi_c/libffi.gnu.mk +2 -1
  10. data/ext/ffi_c/libffi.mk +9 -4
  11. data/ext/ffi_c/libffi/ChangeLog.libffi +2 -2
  12. data/ext/ffi_c/libffi/{ChangeLog → ChangeLog.libffi-3.1} +1402 -2
  13. data/ext/ffi_c/libffi/ChangeLog.v1 +1 -1
  14. data/ext/ffi_c/libffi/LICENSE +1 -1
  15. data/ext/ffi_c/libffi/Makefile.am +166 -157
  16. data/ext/ffi_c/libffi/Makefile.in +923 -938
  17. data/ext/ffi_c/libffi/README +164 -52
  18. data/ext/ffi_c/libffi/acinclude.m4 +381 -0
  19. data/ext/ffi_c/libffi/aclocal.m4 +645 -384
  20. data/ext/ffi_c/libffi/autogen.sh +2 -0
  21. data/ext/ffi_c/libffi/autom4te.cache/output.0 +21972 -0
  22. data/ext/ffi_c/libffi/autom4te.cache/output.1 +21972 -0
  23. data/ext/ffi_c/libffi/autom4te.cache/output.2 +21972 -0
  24. data/ext/ffi_c/libffi/autom4te.cache/output.3 +21972 -0
  25. data/ext/ffi_c/libffi/autom4te.cache/requests +331 -0
  26. data/ext/ffi_c/libffi/autom4te.cache/traces.0 +4010 -0
  27. data/ext/ffi_c/libffi/autom4te.cache/traces.1 +1005 -0
  28. data/ext/ffi_c/libffi/autom4te.cache/traces.2 +4010 -0
  29. data/ext/ffi_c/libffi/autom4te.cache/traces.3 +4010 -0
  30. data/ext/ffi_c/libffi/compile +218 -14
  31. data/ext/ffi_c/libffi/config.guess +329 -368
  32. data/ext/ffi_c/libffi/config.sub +232 -112
  33. data/ext/ffi_c/libffi/configure +6970 -2189
  34. data/ext/ffi_c/libffi/configure.ac +148 -256
  35. data/ext/ffi_c/libffi/configure.host +265 -4
  36. data/ext/ffi_c/libffi/depcomp +346 -185
  37. data/ext/ffi_c/libffi/doc/Makefile.am +3 -0
  38. data/ext/ffi_c/libffi/doc/Makefile.in +811 -0
  39. data/ext/ffi_c/libffi/doc/libffi.texi +430 -45
  40. data/ext/ffi_c/libffi/{mdate-sh → doc/mdate-sh} +40 -13
  41. data/ext/ffi_c/libffi/{texinfo.tex → doc/texinfo.tex} +3990 -1121
  42. data/ext/ffi_c/libffi/doc/version.texi +4 -4
  43. data/ext/ffi_c/libffi/fficonfig.h.in +24 -13
  44. data/ext/ffi_c/libffi/fficonfig.h.in~ +210 -0
  45. data/ext/ffi_c/libffi/generate-darwin-source-and-headers.py +207 -0
  46. data/ext/ffi_c/libffi/include/Makefile.am +3 -3
  47. data/ext/ffi_c/libffi/include/Makefile.in +188 -71
  48. data/ext/ffi_c/libffi/include/ffi.h.in +107 -50
  49. data/ext/ffi_c/libffi/include/ffi_cfi.h +55 -0
  50. data/ext/ffi_c/libffi/include/ffi_common.h +32 -11
  51. data/ext/ffi_c/libffi/install-sh +190 -202
  52. data/ext/ffi_c/libffi/libffi.map.in +80 -0
  53. data/ext/ffi_c/libffi/libffi.pc.in +3 -2
  54. data/ext/ffi_c/libffi/libffi.xcodeproj/project.pbxproj +637 -0
  55. data/ext/ffi_c/libffi/libtool-ldflags +106 -0
  56. data/ext/ffi_c/libffi/libtool-version +1 -1
  57. data/ext/ffi_c/libffi/ltmain.sh +3553 -2033
  58. data/ext/ffi_c/libffi/m4/asmcfi.m4 +13 -0
  59. data/ext/ffi_c/libffi/m4/ax_append_flag.m4 +69 -0
  60. data/ext/ffi_c/libffi/m4/ax_cc_maxopt.m4 +13 -8
  61. data/ext/ffi_c/libffi/m4/ax_cflags_warn_all.m4 +31 -104
  62. data/ext/ffi_c/libffi/m4/{ax_check_compiler_flags.m4 → ax_check_compile_flag.m4} +30 -34
  63. data/ext/ffi_c/libffi/m4/ax_compiler_vendor.m4 +32 -11
  64. data/ext/ffi_c/libffi/m4/ax_enable_builddir.m4 +6 -5
  65. data/ext/ffi_c/libffi/m4/ax_gcc_archflag.m4 +31 -21
  66. data/ext/ffi_c/libffi/m4/libtool.m4 +1691 -1135
  67. data/ext/ffi_c/libffi/m4/ltoptions.m4 +104 -36
  68. data/ext/ffi_c/libffi/m4/ltsugar.m4 +4 -3
  69. data/ext/ffi_c/libffi/m4/ltversion.m4 +6 -6
  70. data/ext/ffi_c/libffi/m4/lt~obsolete.m4 +4 -3
  71. data/ext/ffi_c/libffi/man/Makefile.am +2 -2
  72. data/ext/ffi_c/libffi/man/Makefile.in +141 -49
  73. data/ext/ffi_c/libffi/man/ffi.3 +10 -0
  74. data/ext/ffi_c/libffi/man/ffi_prep_cif.3 +6 -4
  75. data/ext/ffi_c/libffi/man/ffi_prep_cif_var.3 +73 -0
  76. data/ext/ffi_c/libffi/missing +150 -311
  77. data/ext/ffi_c/libffi/msvcc.sh +72 -9
  78. data/ext/ffi_c/libffi/src/aarch64/ffi.c +941 -0
  79. data/ext/ffi_c/libffi/src/aarch64/ffitarget.h +81 -0
  80. data/ext/ffi_c/libffi/src/aarch64/internal.h +67 -0
  81. data/ext/ffi_c/libffi/src/aarch64/sysv.S +438 -0
  82. data/ext/ffi_c/libffi/src/alpha/ffi.c +335 -98
  83. data/ext/ffi_c/libffi/src/alpha/ffitarget.h +10 -1
  84. data/ext/ffi_c/libffi/src/alpha/internal.h +23 -0
  85. data/ext/ffi_c/libffi/src/alpha/osf.S +161 -266
  86. data/ext/ffi_c/libffi/src/arc/arcompact.S +135 -0
  87. data/ext/ffi_c/libffi/src/arc/ffi.c +266 -0
  88. data/ext/ffi_c/libffi/src/arc/ffitarget.h +53 -0
  89. data/ext/ffi_c/libffi/src/arm/ffi.c +597 -517
  90. data/ext/ffi_c/libffi/src/arm/ffitarget.h +24 -7
  91. data/ext/ffi_c/libffi/src/arm/internal.h +7 -0
  92. data/ext/ffi_c/libffi/src/arm/sysv.S +303 -417
  93. data/ext/ffi_c/libffi/src/avr32/ffitarget.h +6 -1
  94. data/ext/ffi_c/libffi/src/bfin/ffi.c +196 -0
  95. data/ext/ffi_c/libffi/src/bfin/ffitarget.h +43 -0
  96. data/ext/ffi_c/libffi/src/bfin/sysv.S +179 -0
  97. data/ext/ffi_c/libffi/src/closures.c +319 -44
  98. data/ext/ffi_c/libffi/src/cris/ffi.c +10 -7
  99. data/ext/ffi_c/libffi/src/cris/ffitarget.h +6 -1
  100. data/ext/ffi_c/libffi/src/debug.c +6 -1
  101. data/ext/ffi_c/libffi/src/dlmalloc.c +16 -11
  102. data/ext/ffi_c/libffi/src/frv/ffi.c +1 -1
  103. data/ext/ffi_c/libffi/src/frv/ffitarget.h +6 -1
  104. data/ext/ffi_c/libffi/src/ia64/ffi.c +11 -7
  105. data/ext/ffi_c/libffi/src/ia64/ffitarget.h +6 -1
  106. data/ext/ffi_c/libffi/src/java_raw_api.c +23 -5
  107. data/ext/ffi_c/libffi/src/m32r/ffi.c +1 -1
  108. data/ext/ffi_c/libffi/src/m32r/ffitarget.h +6 -1
  109. data/ext/ffi_c/libffi/src/m68k/ffi.c +87 -13
  110. data/ext/ffi_c/libffi/src/m68k/ffitarget.h +6 -1
  111. data/ext/ffi_c/libffi/src/m68k/sysv.S +119 -32
  112. data/ext/ffi_c/libffi/src/m88k/ffi.c +400 -0
  113. data/ext/ffi_c/libffi/src/m88k/ffitarget.h +49 -0
  114. data/ext/ffi_c/libffi/src/m88k/obsd.S +209 -0
  115. data/ext/ffi_c/libffi/src/metag/ffi.c +330 -0
  116. data/ext/ffi_c/libffi/{fficonfig.hw → src/metag/ffitarget.h} +22 -26
  117. data/ext/ffi_c/libffi/src/metag/sysv.S +311 -0
  118. data/ext/ffi_c/libffi/src/microblaze/ffi.c +321 -0
  119. data/ext/ffi_c/libffi/src/microblaze/ffitarget.h +53 -0
  120. data/ext/ffi_c/libffi/src/microblaze/sysv.S +302 -0
  121. data/ext/ffi_c/libffi/src/mips/ffi.c +95 -28
  122. data/ext/ffi_c/libffi/src/mips/ffitarget.h +9 -2
  123. data/ext/ffi_c/libffi/src/mips/n32.S +126 -56
  124. data/ext/ffi_c/libffi/src/mips/o32.S +148 -27
  125. data/ext/ffi_c/libffi/src/moxie/eabi.S +55 -82
  126. data/ext/ffi_c/libffi/src/moxie/ffi.c +40 -44
  127. data/ext/ffi_c/libffi/src/moxie/ffitarget.h +52 -0
  128. data/ext/ffi_c/libffi/src/nios2/ffi.c +304 -0
  129. data/ext/ffi_c/libffi/src/nios2/ffitarget.h +52 -0
  130. data/ext/ffi_c/libffi/src/nios2/sysv.S +136 -0
  131. data/ext/ffi_c/libffi/src/or1k/ffi.c +328 -0
  132. data/ext/ffi_c/libffi/src/or1k/ffitarget.h +58 -0
  133. data/ext/ffi_c/libffi/src/or1k/sysv.S +107 -0
  134. data/ext/ffi_c/libffi/src/pa/ffitarget.h +8 -1
  135. data/ext/ffi_c/libffi/src/powerpc/aix.S +6 -6
  136. data/ext/ffi_c/libffi/src/powerpc/aix_closure.S +3 -1
  137. data/ext/ffi_c/libffi/src/powerpc/asm.h +2 -2
  138. data/ext/ffi_c/libffi/src/powerpc/darwin.S +2 -7
  139. data/ext/ffi_c/libffi/src/powerpc/darwin_closure.S +22 -26
  140. data/ext/ffi_c/libffi/src/powerpc/ffi.c +103 -1378
  141. data/ext/ffi_c/libffi/src/powerpc/ffi_darwin.c +25 -25
  142. data/ext/ffi_c/libffi/src/powerpc/ffi_linux64.c +945 -0
  143. data/ext/ffi_c/libffi/src/powerpc/ffi_powerpc.h +94 -0
  144. data/ext/ffi_c/libffi/src/powerpc/ffi_sysv.c +923 -0
  145. data/ext/ffi_c/libffi/src/powerpc/ffitarget.h +100 -44
  146. data/ext/ffi_c/libffi/src/powerpc/linux64.S +100 -59
  147. data/ext/ffi_c/libffi/src/powerpc/linux64_closure.S +360 -108
  148. data/ext/ffi_c/libffi/src/powerpc/ppc_closure.S +138 -68
  149. data/ext/ffi_c/libffi/src/powerpc/sysv.S +68 -112
  150. data/ext/ffi_c/libffi/src/prep_cif.c +108 -24
  151. data/ext/ffi_c/libffi/src/raw_api.c +18 -5
  152. data/ext/ffi_c/libffi/src/s390/ffi.c +294 -318
  153. data/ext/ffi_c/libffi/src/s390/ffitarget.h +9 -1
  154. data/ext/ffi_c/libffi/src/s390/internal.h +11 -0
  155. data/ext/ffi_c/libffi/src/s390/sysv.S +257 -366
  156. data/ext/ffi_c/libffi/src/sh/ffi.c +4 -3
  157. data/ext/ffi_c/libffi/src/sh/ffitarget.h +6 -1
  158. data/ext/ffi_c/libffi/src/sh64/ffi.c +3 -2
  159. data/ext/ffi_c/libffi/src/sh64/ffitarget.h +6 -1
  160. data/ext/ffi_c/libffi/src/sparc/ffi.c +326 -527
  161. data/ext/ffi_c/libffi/src/sparc/ffi64.c +608 -0
  162. data/ext/ffi_c/libffi/src/sparc/ffitarget.h +20 -7
  163. data/ext/ffi_c/libffi/src/sparc/internal.h +26 -0
  164. data/ext/ffi_c/libffi/src/sparc/v8.S +364 -234
  165. data/ext/ffi_c/libffi/src/sparc/v9.S +340 -207
  166. data/ext/ffi_c/libffi/src/tile/ffi.c +355 -0
  167. data/ext/ffi_c/libffi/src/tile/ffitarget.h +65 -0
  168. data/ext/ffi_c/libffi/src/tile/tile.S +360 -0
  169. data/ext/ffi_c/libffi/src/types.c +43 -14
  170. data/ext/ffi_c/libffi/src/vax/elfbsd.S +195 -0
  171. data/ext/ffi_c/libffi/src/vax/ffi.c +276 -0
  172. data/ext/ffi_c/libffi/src/vax/ffitarget.h +49 -0
  173. data/ext/ffi_c/libffi/src/x86/asmnames.h +30 -0
  174. data/ext/ffi_c/libffi/src/x86/ffi.c +589 -500
  175. data/ext/ffi_c/libffi/src/x86/ffi64.c +338 -116
  176. data/ext/ffi_c/libffi/src/x86/ffitarget.h +55 -35
  177. data/ext/ffi_c/libffi/src/x86/ffiw64.c +287 -0
  178. data/ext/ffi_c/libffi/src/x86/internal.h +29 -0
  179. data/ext/ffi_c/libffi/src/x86/internal64.h +22 -0
  180. data/ext/ffi_c/libffi/src/x86/sysv.S +975 -400
  181. data/ext/ffi_c/libffi/src/x86/unix64.S +398 -299
  182. data/ext/ffi_c/libffi/src/x86/win64.S +222 -458
  183. data/ext/ffi_c/libffi/src/x86/win64_intel.S +237 -0
  184. data/ext/ffi_c/libffi/src/xtensa/ffi.c +298 -0
  185. data/ext/ffi_c/libffi/src/xtensa/ffitarget.h +53 -0
  186. data/ext/ffi_c/libffi/src/xtensa/sysv.S +253 -0
  187. data/ext/ffi_c/libffi/stamp-h.in +1 -0
  188. data/ext/ffi_c/libffi/testsuite/Makefile.am +78 -73
  189. data/ext/ffi_c/libffi/testsuite/Makefile.in +218 -111
  190. data/ext/ffi_c/libffi/testsuite/lib/libffi.exp +120 -25
  191. data/ext/ffi_c/libffi/testsuite/lib/target-libpath.exp +21 -1
  192. data/ext/ffi_c/libffi/testsuite/libffi.call/align_mixed.c +46 -0
  193. data/ext/ffi_c/libffi/testsuite/libffi.call/call.exp +4 -6
  194. data/ext/ffi_c/libffi/testsuite/libffi.call/{closure_stdcall.c → closure_simple.c} +7 -16
  195. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_12byte.c +4 -4
  196. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_16byte.c +4 -4
  197. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_18byte.c +4 -4
  198. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_19byte.c +4 -4
  199. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_1_1byte.c +4 -4
  200. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_20byte.c +4 -4
  201. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_20byte1.c +4 -4
  202. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_24byte.c +5 -5
  203. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_2byte.c +4 -4
  204. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_3_1byte.c +4 -4
  205. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_3byte1.c +4 -4
  206. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_3byte2.c +4 -4
  207. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_4_1byte.c +4 -4
  208. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_4byte.c +4 -4
  209. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_5_1_byte.c +4 -4
  210. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_5byte.c +4 -4
  211. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_64byte.c +5 -5
  212. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_6_1_byte.c +4 -4
  213. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_6byte.c +4 -4
  214. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_7_1_byte.c +4 -4
  215. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_7byte.c +4 -4
  216. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_8byte.c +4 -4
  217. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_9byte1.c +4 -4
  218. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_9byte2.c +4 -4
  219. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_double.c +4 -4
  220. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_float.c +4 -4
  221. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_longdouble.c +4 -4
  222. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_longdouble_split.c +4 -6
  223. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_longdouble_split2.c +4 -6
  224. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_pointer.c +4 -4
  225. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_sint16.c +4 -4
  226. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_sint32.c +4 -4
  227. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_sint64.c +4 -4
  228. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_uint16.c +4 -4
  229. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_uint32.c +4 -4
  230. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_uint64.c +4 -4
  231. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_dbls_struct.c +4 -4
  232. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_double_va.c +10 -9
  233. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_longdouble.c +3 -3
  234. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_longdouble_va.c +10 -9
  235. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_many_mixed_args.c +70 -0
  236. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_many_mixed_float_double.c +55 -0
  237. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_pointer.c +1 -1
  238. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_pointer_stack.c +11 -9
  239. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_struct_va1.c +114 -0
  240. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_uchar_va.c +44 -0
  241. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_uint_va.c +45 -0
  242. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_ulong_va.c +45 -0
  243. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_ulonglong.c +5 -5
  244. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_ushort_va.c +44 -0
  245. data/ext/ffi_c/libffi/testsuite/libffi.call/err_bad_typedef.c +2 -2
  246. data/ext/ffi_c/libffi/testsuite/libffi.call/ffitest.h +23 -40
  247. data/ext/ffi_c/libffi/testsuite/libffi.call/float1.c +3 -1
  248. data/ext/ffi_c/libffi/testsuite/libffi.call/float2.c +6 -4
  249. data/ext/ffi_c/libffi/testsuite/libffi.call/float3.c +4 -2
  250. data/ext/ffi_c/libffi/testsuite/libffi.call/float_va.c +107 -0
  251. data/ext/ffi_c/libffi/testsuite/libffi.call/huge_struct.c +18 -19
  252. data/ext/ffi_c/libffi/testsuite/libffi.call/many.c +6 -16
  253. data/ext/ffi_c/libffi/testsuite/libffi.call/many2.c +57 -0
  254. data/ext/ffi_c/libffi/testsuite/libffi.call/many_double.c +70 -0
  255. data/ext/ffi_c/libffi/testsuite/libffi.call/many_mixed.c +78 -0
  256. data/ext/ffi_c/libffi/testsuite/libffi.call/negint.c +0 -1
  257. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct.c +6 -6
  258. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct1.c +8 -8
  259. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct10.c +6 -6
  260. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct11.c +121 -0
  261. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct2.c +5 -5
  262. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct3.c +5 -5
  263. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct4.c +5 -5
  264. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct5.c +5 -5
  265. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct6.c +6 -6
  266. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct7.c +5 -5
  267. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct8.c +6 -6
  268. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct9.c +6 -6
  269. data/ext/ffi_c/libffi/testsuite/libffi.call/offsets.c +46 -0
  270. data/ext/ffi_c/libffi/testsuite/libffi.call/pr1172638.c +127 -0
  271. data/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl.c +1 -0
  272. data/ext/ffi_c/libffi/testsuite/libffi.call/return_ldl.c +1 -1
  273. data/ext/ffi_c/libffi/testsuite/libffi.call/return_sc.c +1 -1
  274. data/ext/ffi_c/libffi/testsuite/libffi.call/return_uc.c +1 -1
  275. data/ext/ffi_c/libffi/testsuite/libffi.call/stret_large.c +7 -7
  276. data/ext/ffi_c/libffi/testsuite/libffi.call/stret_large2.c +7 -7
  277. data/ext/ffi_c/libffi/testsuite/libffi.call/stret_medium.c +5 -5
  278. data/ext/ffi_c/libffi/testsuite/libffi.call/stret_medium2.c +5 -5
  279. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen.c +2 -2
  280. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen2.c +49 -0
  281. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen3.c +49 -0
  282. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen4.c +55 -0
  283. data/ext/ffi_c/libffi/testsuite/libffi.call/struct1.c +9 -7
  284. data/ext/ffi_c/libffi/testsuite/libffi.call/struct2.c +7 -7
  285. data/ext/ffi_c/libffi/testsuite/libffi.call/struct3.c +7 -6
  286. data/ext/ffi_c/libffi/testsuite/libffi.call/struct4.c +9 -8
  287. data/ext/ffi_c/libffi/testsuite/libffi.call/struct5.c +9 -8
  288. data/ext/ffi_c/libffi/testsuite/libffi.call/struct6.c +9 -9
  289. data/ext/ffi_c/libffi/testsuite/libffi.call/struct7.c +9 -9
  290. data/ext/ffi_c/libffi/testsuite/libffi.call/struct8.c +9 -8
  291. data/ext/ffi_c/libffi/testsuite/libffi.call/struct9.c +9 -8
  292. data/ext/ffi_c/libffi/testsuite/libffi.call/testclosure.c +2 -2
  293. data/ext/ffi_c/libffi/testsuite/libffi.call/uninitialized.c +61 -0
  294. data/ext/ffi_c/libffi/testsuite/{libffi.special → libffi.call}/unwindtest.cc +3 -10
  295. data/ext/ffi_c/libffi/testsuite/{libffi.special → libffi.call}/unwindtest_ffi_call.cc +2 -1
  296. data/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c +196 -0
  297. data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct1.c +121 -0
  298. data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct2.c +123 -0
  299. data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct3.c +125 -0
  300. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex.inc +91 -0
  301. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_double.c +10 -0
  302. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_float.c +10 -0
  303. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_longdouble.c +10 -0
  304. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex.inc +42 -0
  305. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_double.c +10 -0
  306. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_float.c +10 -0
  307. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_longdouble.c +10 -0
  308. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct.inc +71 -0
  309. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_double.c +10 -0
  310. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_float.c +10 -0
  311. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_longdouble.c +10 -0
  312. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va.inc +80 -0
  313. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_double.c +10 -0
  314. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_float.c +16 -0
  315. data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_longdouble.c +10 -0
  316. data/ext/ffi_c/libffi/testsuite/{libffi.special/special.exp → libffi.complex/complex.exp} +9 -8
  317. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex.inc +51 -0
  318. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_double.inc +7 -0
  319. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_float.inc +7 -0
  320. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_longdouble.inc +7 -0
  321. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_double.c +10 -0
  322. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_float.c +10 -0
  323. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_int.c +86 -0
  324. data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_longdouble.c +10 -0
  325. data/ext/ffi_c/libffi/testsuite/libffi.complex/ffitest.h +1 -0
  326. data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex.inc +78 -0
  327. data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_double.c +10 -0
  328. data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_float.c +10 -0
  329. data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_longdouble.c +10 -0
  330. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex.inc +37 -0
  331. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1.inc +41 -0
  332. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_double.c +10 -0
  333. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_float.c +10 -0
  334. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_longdouble.c +10 -0
  335. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2.inc +44 -0
  336. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_double.c +10 -0
  337. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_float.c +10 -0
  338. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_longdouble.c +10 -0
  339. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_double.c +10 -0
  340. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_float.c +10 -0
  341. data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_longdouble.c +10 -0
  342. data/ext/ffi_c/libffi/testsuite/libffi.go/aa-direct.c +34 -0
  343. data/ext/ffi_c/libffi/testsuite/libffi.go/closure1.c +28 -0
  344. data/ext/ffi_c/libffi/testsuite/libffi.go/ffitest.h +1 -0
  345. data/ext/ffi_c/libffi/testsuite/libffi.go/go.exp +36 -0
  346. data/ext/ffi_c/libffi/testsuite/libffi.go/static-chain.h +19 -0
  347. data/ffi.gemspec +2 -2
  348. data/lib/2.0/ffi_c.so +0 -0
  349. data/lib/2.1/ffi_c.so +0 -0
  350. data/lib/2.2/ffi_c.so +0 -0
  351. data/lib/2.3/ffi_c.so +0 -0
  352. data/lib/2.4/ffi_c.so +0 -0
  353. data/lib/2.5/ffi_c.so +0 -0
  354. data/lib/ffi/enum.rb +124 -0
  355. data/lib/ffi/library.rb +65 -13
  356. data/lib/ffi/platform.rb +7 -2
  357. data/lib/ffi/platform/sparc64-linux/types.conf +102 -0
  358. data/lib/ffi/platform/x86_64-windows/types.conf +113 -20
  359. data/lib/ffi/pointer.rb +1 -0
  360. data/lib/ffi/struct.rb +0 -2
  361. data/lib/ffi/version.rb +1 -1
  362. data/spec/ffi/bitmask_spec.rb +575 -0
  363. data/spec/ffi/embed-test/ext/Makefile +242 -0
  364. data/spec/ffi/fixtures/BitmaskTest.c +51 -0
  365. data/spec/ffi/rbx/memory_pointer_spec.rb +4 -0
  366. data/spec/ffi/struct_spec.rb +0 -4
  367. metadata +158 -32
  368. data/ext/ffi_c/libffi/Makefile.vc +0 -141
  369. data/ext/ffi_c/libffi/Makefile.vc64 +0 -141
  370. data/ext/ffi_c/libffi/build-ios.sh +0 -67
  371. data/ext/ffi_c/libffi/doc/libffi.info +0 -593
  372. data/ext/ffi_c/libffi/doc/stamp-vti +0 -4
  373. data/ext/ffi_c/libffi/include/ffi.h.vc +0 -427
  374. data/ext/ffi_c/libffi/include/ffi.h.vc64 +0 -427
  375. data/ext/ffi_c/libffi/src/arm/gentramp.sh +0 -118
  376. data/ext/ffi_c/libffi/src/arm/trampoline.S +0 -4450
  377. data/ext/ffi_c/libffi/src/x86/darwin.S +0 -444
  378. data/ext/ffi_c/libffi/src/x86/darwin64.S +0 -416
  379. data/ext/ffi_c/libffi/src/x86/freebsd.S +0 -458
  380. data/ext/ffi_c/libffi/src/x86/win32.S +0 -1065
  381. data/ext/ffi_c/libffi/testsuite/lib/libffi-dg.exp +0 -300
  382. data/ext/ffi_c/libffi/testsuite/libffi.call/many_win32.c +0 -63
  383. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen_win32.c +0 -44
  384. 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
- /* mingw64 defines this already in malloc.h. */
23
- #ifndef alloca
24
- # define alloca __builtin_alloca
25
- #endif
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
- #pragma alloca
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 ALIGN(v, a) (((((size_t) (v))-1) | ((a)-1))+1)
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),1)
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
  }
@@ -1,7 +1,7 @@
1
1
  #!/bin/sh
2
2
  # install - install a program, script, or datafile
3
3
 
4
- scriptversion=2009-04-28.21; # UTC
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
- # `make' implicit rules from creating a file called install from it
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=" "" $nl"
47
+ IFS=" $tab$nl"
47
48
 
48
- # set DOITPROG to echo to test this script
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
- if test -z "$doit"; then
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
- no_target_directory=
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
- shift;;
125
+ shift;;
141
126
 
142
127
  --help) echo "$usage"; exit $?;;
143
128
 
144
129
  -m) mode=$2
145
- case $mode in
146
- *' '* | *' '* | *'
147
- '* | *'*'* | *'?'* | *'['*)
148
- echo "$0: invalid mode: $mode" >&2
149
- exit 1;;
150
- esac
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
- shift;;
138
+ shift;;
155
139
 
156
140
  -s) stripcmd=$stripprog;;
157
141
 
158
- -t) dst_arg=$2
159
- shift;;
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) no_target_directory=true;;
151
+ -T) is_target_a_directory=never;;
162
152
 
163
153
  --version) echo "$0 $scriptversion"; exit $?;;
164
154
 
165
- --) shift
166
- break;;
155
+ --) shift
156
+ break;;
167
157
 
168
- -*) echo "$0: invalid option: $1" >&2
169
- exit 1;;
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 `install-sh -d' without argument.
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
- trap '(exit $?); exit' 1 2 13 15
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
- u_plus_rw=
231
+ u_plus_rw=
215
232
  else
216
- u_plus_rw='% 200'
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
- u_plus_rw=
238
+ u_plus_rw=
222
239
  else
223
- u_plus_rw=,u+rw
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 starting with `-'.
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 -n "$no_target_directory"; then
266
- echo "$0: $dst_arg: Is a directory" >&2
267
- exit 1
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
- # Prefer dirname, but fall back on a substitute if dirname fails.
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
- # Create intermediate dirs using mode 755 as modified by the umask.
311
- # This is like FreeBSD 'install' as of 1997-10-28.
312
- umask=`umask`
313
- case $stripcmd.$umask in
314
- # Optimize common cases.
315
- *[2367][2367]) mkdir_umask=$umask;;
316
- .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
317
-
318
- *[0-7])
319
- mkdir_umask=`expr $umask + 22 \
320
- - $umask % 100 % 40 + $umask % 20 \
321
- - $umask % 10 % 4 + $umask % 2
322
- `;;
323
- *) mkdir_umask=$umask,go-w;;
324
- esac
325
-
326
- # With -d, create the new directory with the user-specified mode.
327
- # Otherwise, rely on $mkdir_umask.
328
- if test -n "$dir_arg"; then
329
- mkdir_mode=-m$mode
330
- else
331
- mkdir_mode=
332
- fi
333
-
334
- posix_mkdir=false
335
- case $umask in
336
- *[123567][0-7][0-7])
337
- # POSIX mkdir -p sets u+wx bits regardless of umask, which
338
- # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
339
- ;;
340
- *)
341
- tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
342
- trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
343
-
344
- if (umask $mkdir_umask &&
345
- exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
346
- then
347
- if test -z "$dir_arg" || {
348
- # Check for POSIX incompatibilities with -m.
349
- # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
350
- # other-writeable bit of parent directory when it shouldn't.
351
- # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
352
- ls_ld_tmpdir=`ls -ld "$tmpdir"`
353
- case $ls_ld_tmpdir in
354
- d????-?r-*) different_mode=700;;
355
- d????-?--*) different_mode=755;;
356
- *) false;;
357
- esac &&
358
- $mkdirprog -m$different_mode -p -- "$tmpdir" && {
359
- ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
360
- test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
361
- }
362
- }
363
- then posix_mkdir=:
364
- fi
365
- rmdir "$tmpdir/d" "$tmpdir"
366
- else
367
- # Remove any dirs left behind by ancient mkdir implementations.
368
- rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
369
- fi
370
- trap '' 0;;
371
- esac;;
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
- umask $mkdir_umask &&
377
- $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
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
- /*) prefix='/';;
388
- -*) prefix='./';;
389
- *) prefix='';;
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
- $posix_glob set -f
387
+ set -f
397
388
  set fnord $dstdir
398
389
  shift
399
- $posix_glob set +f
390
+ set +f
400
391
  IFS=$oIFS
401
392
 
402
393
  prefixes=
403
394
 
404
395
  for d
405
396
  do
406
- test -z "$d" && continue
407
-
408
- prefix=$prefix$d
409
- if test -d "$prefix"; then
410
- prefixes=
411
- else
412
- if $posix_mkdir; then
413
- (umask=$mkdir_umask &&
414
- $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
415
- # Don't fail if two instances are running concurrently.
416
- test -d "$prefix" || exit 1
417
- else
418
- case $prefix in
419
- *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
420
- *) qprefix=$prefix;;
421
- esac
422
- prefixes="$prefixes '$qprefix'"
423
- fi
424
- fi
425
- prefix=$prefix/
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
- # Don't fail if two instances are running concurrently.
430
- (umask $mkdir_umask &&
431
- eval "\$doit_exec \$mkdirprog $prefixes") ||
432
- test -d "$dstdir" || exit 1
433
- obsolete_mkdir_used=true
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" 2>/dev/null` &&
469
- new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
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
- $posix_glob set +f &&
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
- # Now remove or move aside any old file at destination location.
490
- # We try this two ways since rm can't unlink itself on some
491
- # systems and the destination file might be busy for other
492
- # reasons. In this case, the final cleanup might fail but the new
493
- # file should still install successfully.
494
- {
495
- test ! -f "$dst" ||
496
- $doit $rmcmd -f "$dst" 2>/dev/null ||
497
- { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
498
- { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
499
- } ||
500
- { echo "$0: cannot unlink or rename $dst" >&2
501
- (exit 1); exit 1
502
- }
503
- } &&
504
-
505
- # Now rename the file to the real destination.
506
- $doit $mvcmd "$dsttmp" "$dst"
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