Neither MSVC nor MinGW defines LONG_BIT. For MSVC this was not a problem as
it doesn't define __x86_64__ macro (it's GCC specific.)
However on Windows long type is guaranteed to be 32bits.
Also add an #error, as GCC will just warn, not throw any error, when no
value is returned.
Trivial.
#ifdef __x86_64__
#if LONG_BIT == 64
return _mm_cvtss_si64(_mm_load_ss(&x));
-#elif LONG_BIT == 32
+#elif LONG_BIT == 32 || defined(_WIN32)
return _mm_cvtss_si32(_mm_load_ss(&x));
+#else
+#error "Unsupported or undefined LONG_BIT"
#endif
#else
return lrintf(x);
#ifdef __x86_64__
#if LONG_BIT == 64
return _mm_cvtsd_si64(_mm_load_sd(&x));
-#elif LONG_BIT == 32
+#elif LONG_BIT == 32 || defined(_WIN32)
return _mm_cvtsd_si32(_mm_load_sd(&x));
+#else
+#error "Unsupported or undefined LONG_BIT"
#endif
#else
return lrint(x);