Works fine with LuaJIT but not with standard

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Bicentric
Prole
Posts: 28
Joined: Fri Jul 12, 2013 12:17 pm

Works fine with LuaJIT but not with standard

Post by Bicentric »

-
Last edited by Bicentric on Tue Jun 19, 2018 7:25 pm, edited 1 time in total.
User avatar
Boolsheet
Inner party member
Posts: 780
Joined: Wed Dec 29, 2010 4:57 am
Location: Switzerland

Re: Works fine with LuaJIT but not with standard

Post by Boolsheet »

The library you have chosen does not have pure-Lua bitwise functions.

Code: Select all

-- TODO: implement bit ops in Lua
You can try my hash.lua that implements some hashes. It also requires my utils.lua and bit.lua for the pure-Lua functions.
Shallow indentations.
User avatar
Roland_Yonaba
Inner party member
Posts: 1563
Joined: Tue Jun 21, 2011 6:08 pm
Location: Ouagadougou (Burkina Faso)
Contact:

Re: Works fine with LuaJIT but not with standard

Post by Roland_Yonaba »

Hi,
The standard version of Löve uses Lua5.1, which does not have a bit library.
LoveJIT uses LuaJIT, which already implements a bitOp module (written in C and provinding functions such as bit.band, bit.bor, bit.ror, ...).
In case you need to run the same code with standard Love, you will have to implement a bitwise op library in a file named bit.lua, so that it'll be called by LuaCrypt. Hopefully, pure Lua implementations of bitwise operations is available. Checkout David Manura's.

EDIT: Ninja'ed by BoolSheet.
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 67 guests