The behavior of FIX2INT and FIX2UINT differs by platform
For instance, when
sizeof(int) < sizeof(long) (such as on Linux), then
sizeof(int) == sizeof(long) (such as on Windows), then it returns
So the behavior changes from a call to
rb_fix2int() to a raw shift without any checks.
I think it should be consistent between platforms.
Also, the code in ruby.h defining FIX2INT is fairly complicated with conditions like
#if SIZEOF_INT < SIZEOF_LONG
spanning many lines, which makes it fairly hard to follow.
and https://ci.appveyor.com/project/eregon/spec-x948i/builds/21753809/job/ed8e8k97m8syp4r7 for more differences.