lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Am 04.11.2014 um 19:01 schröbte Hisham:
On 4 November 2014 15:52, Ką Mykolas <kamicc@gmail.com> wrote:
And I doubt it's going to be ported. Since 5.3 Lua does have native
binary operators, so....

...so it should be semi-trivial to write a compatibility layer that
maps to either luabitop or bit32?

Judging from `local bit = bit32 or require "bit"` in `posix.lua` that compatibility layer is already in place more or less -- but you have to put one or the other in the dependencies table in the rockspec ...

Maybe `bit32` would have been a better dependency because it is available for Lua 5.1, 5.2, and 5.3-beta (with compatibility switches), but I don't know for sure whether it really works for LuaJIT (which provides some of the same Lua 5.2 C API symbols as `lua-compat-5.2` which `bit32` uses internally).

Or, if `bor` is really the only bit operation that `luaposix` requires, maybe it should provide its own (fallback) implementation and don't specify a dependency in the rockspec at all. Then the library user can decide which bit operations to use.


-- Hisham

Philipp



On 11/4/14, Gary V. Vaughan <gary@vaughan.pe> wrote:
Hi Dirk,

On 4 Nov 2014, at 17:30, Dirk Laurie <dirk.laurie@gmail.com> wrote:

2014-11-04 19:02 GMT+02:00 Gary Vaughan <gary@vaughan.pe>:

Install it with LuaRocks, using:

    luarocks install luaposix 33.0.0

This procedure does not work with Lua 5.3.0-beta.

Missing dependencies for luaposix:
luabitop >= 1.0.2

gcc -O2 -fPIC -I/home/dirk/include -c bit.c -o bit.o
bit.c: In function 'barg':
bit.c:83:2: error: #error "Unknown number type, check LUA_NUMBER_* in
luaconf.h"
#error "Unknown number type, check LUA_NUMBER_* in luaconf.h"

Like the last several luaposix releases, luabitop is required (for LuaJIT
and Lua 5.1), and not yet ported to 5.3. For that matter, neither have I
tried to port luaposix to 5.3 yet.

Cheers,
--
Gary V. Vaughan (gary AT vaughan DOT Pe)