We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a402810 commit aa2e1f5Copy full SHA for aa2e1f5
src/llimits.h
@@ -238,7 +238,14 @@ typedef lu_int32 Instruction;
238
(((u) <= (lua_Unsigned)INT_MAX) ? (lua_Number)(int)(u) : (lua_Number)(u))
239
#endif
240
241
-
+#ifdef NINTENDO_SWITCH
242
+//workaround for the undefined behaviors causing problems with the implementation below.
243
+//This is taken from MS_ASMTRICK part of this original file
244
+union luai_Cast { double l_d; LUA_INT32 l_p[2]; };
245
+#define luai_hashnum(i,n) \
246
+ { volatile union luai_Cast u; u.l_d = (n) + 1.0; /* avoid -0 */ \
247
+ (i) = u.l_p[0]; (i) += u.l_p[1]; } /* add double bits for his hash */
248
+#endif
249
250
#if defined(ltable_c) && !defined(luai_hashnum)
251
0 commit comments