Commit 0690a7d1 authored by Johny Mattsson's avatar Johny Mattsson
Browse files

Make bit module handle 32/64bit integer configs.

parent cd585ae9
......@@ -169,7 +169,7 @@
/* Changed to long for use with integral Lua numbers. */
#if !defined LUA_NUMBER_INTEGRAL
#define LUA_INTEGER ptrdiff_t
#define LUA_INTEGER int
#else
#if !defined LUA_INTEGRAL_LONGLONG
#define LUA_INTEGER int
......
......@@ -10,9 +10,11 @@
#include "lauxlib.h"
/* FIXME: Assume size_t is an unsigned lua_Integer */
typedef size_t lua_UInteger;
#define LUA_UINTEGER_MAX SIZE_MAX
#if defined(LUA_UNSIGNED)
typedef LUA_UNSIGNED lua_UInteger;
#else
typedef unsigned LUA_INTEGER lua_UInteger;
#endif
/* Define TOBIT to get a bit value */
#define TOBIT(L, n) \
......
......@@ -4,7 +4,9 @@
| 2014-12-24 | [https://github.com/LuaDist/bitlib](https://github.com/LuaDist/bitlib), [Zeroday](https://github.com/funshine) | [Zeroday](https://github.com/funshine) | [bit.c](../../components/modules/bit.c)|
Bit manipulation support, on 32bit integers.
Bit manipulation support, on the integer type used by the Lua VM. On 5.1 this
will be 32bit, whereas on 5.3 it may be either 32bit (default) or 64bit if
configured for 64bit integers.
## bit.arshift()
Arithmetic right shift a number equivalent to `value >> shift` in C.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment