mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/fiddle] support for very old libffi
Define `Fiddle::TYPE_VARIADIC` only when `ffi_prep_cif_var` is available, otherwise skip the test for it.
This commit is contained in:
parent
0703e01471
commit
48fb6299c6
2 changed files with 5 additions and 0 deletions
|
@ -227,11 +227,13 @@ Init_fiddle(void)
|
|||
*/
|
||||
rb_define_const(mFiddle, "TYPE_DOUBLE", INT2NUM(TYPE_DOUBLE));
|
||||
|
||||
#ifdef HAVE_FFI_PREP_CIF_VAR
|
||||
/* Document-const: TYPE_VARIADIC
|
||||
*
|
||||
* C type - ...
|
||||
*/
|
||||
rb_define_const(mFiddle, "TYPE_VARIADIC", INT2NUM(TYPE_VARIADIC));
|
||||
#endif
|
||||
|
||||
/* Document-const: TYPE_SIZE_T
|
||||
*
|
||||
|
|
|
@ -81,6 +81,9 @@ module Fiddle
|
|||
end
|
||||
|
||||
def test_snprintf
|
||||
unless Fiddle.const_defined?("TYPE_VARIADIC")
|
||||
skip "libffi doesn't support variadic arguments"
|
||||
end
|
||||
if Fiddle::WINDOWS
|
||||
snprintf_name = "_snprintf"
|
||||
else
|
||||
|
|
Loading…
Add table
Reference in a new issue