From 9b0c36b39032cffff3c62a2b0e1fc38fa429f5ea Mon Sep 17 00:00:00 2001 From: Kenta Murata Date: Fri, 11 Dec 2020 09:41:12 +0900 Subject: Import fiddle-1.0.4 (#3860) I don't use tool/sync_default_gem.rb because the last sync was incomplete. Co-authored-by: Hiroshi SHIBATA Co-authored-by: Alan Wu Co-authored-by: sinisterchipmunk Co-authored-by: Sutou Kouhei --- ext/fiddle/conversions.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'ext/fiddle/conversions.c') diff --git a/ext/fiddle/conversions.c b/ext/fiddle/conversions.c index fdfc3fcbf2..6e0ce36378 100644 --- a/ext/fiddle/conversions.c +++ b/ext/fiddle/conversions.c @@ -22,6 +22,18 @@ rb_fiddle_type_ensure(VALUE type) ID long_id; #ifdef TYPE_LONG_LONG ID long_long_id; +#endif +#ifdef TYPE_INT8_T + ID int8_t_id; +#endif +#ifdef TYPE_INT16_T + ID int16_t_id; +#endif +#ifdef TYPE_INT32_T + ID int32_t_id; +#endif +#ifdef TYPE_INT64_T + ID int64_t_id; #endif ID float_id; ID double_id; @@ -40,6 +52,18 @@ rb_fiddle_type_ensure(VALUE type) RUBY_CONST_ID(long_id, "long"); #ifdef TYPE_LONG_LONG RUBY_CONST_ID(long_long_id, "long_long"); +#endif +#ifdef TYPE_INT8_T + RUBY_CONST_ID(int8_t_id, "int8_t"); +#endif +#ifdef TYPE_INT16_T + RUBY_CONST_ID(int16_t_id, "int16_t"); +#endif +#ifdef TYPE_INT32_T + RUBY_CONST_ID(int32_t_id, "int32_t"); +#endif +#ifdef TYPE_INT64_T + RUBY_CONST_ID(int64_t_id, "int64_t"); #endif RUBY_CONST_ID(float_id, "float"); RUBY_CONST_ID(double_id, "double"); @@ -72,6 +96,26 @@ rb_fiddle_type_ensure(VALUE type) else if (type_id == long_long_id) { return INT2NUM(TYPE_LONG_LONG); } +#endif +#ifdef TYPE_INT8_T + else if (type_id == int8_t_id) { + return INT2NUM(TYPE_INT8_T); + } +#endif +#ifdef TYPE_INT16_T + else if (type_id == int16_t_id) { + return INT2NUM(TYPE_INT16_T); + } +#endif +#ifdef TYPE_INT32_T + else if (type_id == int32_t_id) { + return INT2NUM(TYPE_INT32_T); + } +#endif +#ifdef TYPE_INT64_T + else if (type_id == int64_t_id) { + return INT2NUM(TYPE_INT64_T); + } #endif else if (type_id == float_id) { return INT2NUM(TYPE_FLOAT); -- cgit v1.2.3