lib/fiddle/pack.rb in fiddle-1.1.2 vs lib/fiddle/pack.rb in fiddle-1.1.3
- old
+ new
@@ -39,9 +39,15 @@
when SIZEOF_INT
PACK_MAP[TYPE_BOOL] = PACK_MAP[TYPE_UINT]
when SIZEOF_LONG
PACK_MAP[TYPE_BOOL] = PACK_MAP[TYPE_ULONG]
end
+ if RUBY_ENGINE == "jruby" and WINDOWS and [0].pack("l!").size == 8
+ # JRuby's 'l!' pack string doesn't use 32-bit on Windows.
+ # See https://github.com/jruby/jruby/issues/8357 for details
+ PACK_MAP[TYPE_LONG] = PACK_MAP[TYPE_INT]
+ PACK_MAP[TYPE_ULONG] = PACK_MAP[TYPE_UINT]
+ end
SIZE_MAP = {
TYPE_VOIDP => SIZEOF_VOIDP,
TYPE_CHAR => SIZEOF_CHAR,
TYPE_SHORT => SIZEOF_SHORT,