浏览代码

definition for LUA_UNSIGNEDBITS (number of bits in a LUA_UNSIGNED)

Roberto Ierusalimschy 7 年之前
父节点
当前提交
8d50a998e3
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      luaconf.h

+ 4 - 1
luaconf.h

@@ -1,5 +1,5 @@
 /*
 /*
-** $Id: luaconf.h,v 1.266 2018/03/02 18:31:51 roberto Exp roberto $
+** $Id: luaconf.h,v 1.267 2018/03/09 14:56:02 roberto Exp roberto $
 ** Configuration file for Lua
 ** Configuration file for Lua
 ** See Copyright Notice in lua.h
 ** See Copyright Notice in lua.h
 */
 */
@@ -447,6 +447,7 @@
 @@ LUA_MAXINTEGER is the maximum value for a LUA_INTEGER.
 @@ LUA_MAXINTEGER is the maximum value for a LUA_INTEGER.
 @@ LUA_MININTEGER is the minimum value for a LUA_INTEGER.
 @@ LUA_MININTEGER is the minimum value for a LUA_INTEGER.
 @@ LUA_MAXUNSIGNED is the maximum value for a LUA_UNSIGNED.
 @@ LUA_MAXUNSIGNED is the maximum value for a LUA_UNSIGNED.
+@@ LUA_UNSIGNEDBITS is the number of bits in a LUA_UNSIGNED.
 @@ lua_integer2str converts an integer to a string.
 @@ lua_integer2str converts an integer to a string.
 */
 */
 
 
@@ -468,6 +469,8 @@
 
 
 #define LUA_MAXUNSIGNED		(~(lua_Unsigned)0)
 #define LUA_MAXUNSIGNED		(~(lua_Unsigned)0)
 
 
+#define LUA_UNSIGNEDBITS	(sizeof(LUA_UNSIGNED) * CHAR_BIT)
+
 
 
 /* now the variable definitions */
 /* now the variable definitions */