Fixes issue for more strict compilation in GCC (also works in Clang).
Tested in a VFX production environment on Linux.
The previous definition of v4sil was trying to cast to a 64bit type, not not exactly matching the expected underlying type (long long).
Under c++11, this fails to compile with a narrowing warning.
i.e. in gcc when using the flags "-std=c++11 -Wnarrowing"
By casting to a "long long" instead of "unsigned long long" above, we match the type of the underlying definition, and also the v2dil cast then work correctly to widen the 2 64bit type to the expected final 128bit type.
Additionally added MSVC compatibility for 2015+
As far as I know it will now compile and run in MSVC directly out of the box (it does for me now)
@pmineiro @romeric
P.S. to verify go to godbolt, and paste the following:
Fixes issue for more strict compilation in GCC (also works in Clang). Tested in a VFX production environment on Linux.
The previous definition of v4sil was trying to cast to a 64bit type, not not exactly matching the expected underlying type (long long).
Under c++11, this fails to compile with a narrowing warning. i.e. in gcc when using the flags "-std=c++11 -Wnarrowing"
By casting to a "long long" instead of "unsigned long long" above, we match the type of the underlying definition, and also the v2dil cast then work correctly to widen the 2 64bit type to the expected final 128bit type.
@pmineiro @romeric
P.S. to verify go to godbolt, and paste the following:
Then compile with a gcc target, with the following flags:
-O3 -ffast-math -std=c++11 -Wnarrowing
Note that without this change, it won't compile.