summaryrefslogtreecommitdiff
path: root/ext/fiddle/conversions.h
diff options
context:
space:
mode:
authorngoto <ngoto@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-09 05:31:47 +0000
committerngoto <ngoto@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-09 05:31:47 +0000
commit4d71d348555f75ea705f8a0e4782e0e5935a7094 (patch)
tree4d5a050ca37c0c9b09e0d6afd96fb39495296e91 /ext/fiddle/conversions.h
parente26cead1e99e10ab3e672e0894ebdc8c277c833c (diff)
* ext/fiddle/conversions.c (generic_to_value): ffi_arg and ffi_sarg
should be used to handle shorter return value. fix [Bug #3861] [ruby-core:32504] * ext/fiddle/closure.c (callback): ditto * ext/fiddle/conversions.h (fiddle_generic): ditto * ext/fiddle/conversions.c (value_to_generic): char, short and int are strictly distinguished on big-endian CPU, e.g. sparc64. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/fiddle/conversions.h')
-rw-r--r--ext/fiddle/conversions.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/fiddle/conversions.h b/ext/fiddle/conversions.h
index eb16125..5a605b3 100644
--- a/ext/fiddle/conversions.h
+++ b/ext/fiddle/conversions.h
@@ -5,6 +5,8 @@
typedef union
{
+ ffi_arg fffi_arg; /* rvalue smaller than unsigned long */
+ ffi_sarg fffi_sarg; /* rvalue smaller than signed long */
unsigned char uchar; /* ffi_type_uchar */
signed char schar; /* ffi_type_schar */
unsigned short ushort; /* ffi_type_sshort */