commit c27ef1b79c5063e87efe81ef5915b23e59a47aa4
parent 4422b9747253a065da560e6d24388c9fd98c6223
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Wed, 16 Apr 2014 15:45:26 -0300
correct integer limits for Windows + small adjustments for short
option
Diffstat:
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/luaconf.h b/luaconf.h
@@ -1,5 +1,5 @@
/*
-** $Id: luaconf.h,v 1.197 2014/04/12 14:51:53 roberto Exp roberto $
+** $Id: luaconf.h,v 1.198 2014/04/14 16:58:54 roberto Exp roberto $
** Configuration file for Lua
** See Copyright Notice in lua.h
*/
@@ -578,18 +578,27 @@
#elif defined(LUA_INT_LONGLONG) /* }{ long long */
#if defined(_WIN32)
+
#define LUA_INTEGER __int64
#define LUA_INTEGER_FRMLEN "I64"
+
+#define LUA_MAXUNSIGNED _UI64_MAX
+#define LUA_MAXINTEGER _I64_MAX
+#define LUA_MININTEGER _I64_MIN
+
#else
+
#define LUA_INTEGER long long
#define LUA_INTEGER_FRMLEN "ll"
-#endif
#define LUA_MAXUNSIGNED ULLONG_MAX
#define LUA_MAXINTEGER LLONG_MAX
#define LUA_MININTEGER LLONG_MIN
-#elif defined(LUA_INT_SHORT) /* }{ short int; for tests */
+#endif
+
+#elif defined(LUA_INT_SHORT) /* }{ short int */
+/* this option is for tests only; it is not fully functional */
#define LUA_INTEGER short int
#define LUA_INTEGER_FRMLEN ""
@@ -607,6 +616,8 @@
#undef LUAI_MAXSTACK
#define LUAI_MAXSTACK 15000
+#define l_castS2U(x) ((LUA_UNSIGNED)(unsigned short)(x))
+
#else /* }{ */
#error "numeric integer type not defined"