[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Detecting LuaJIT at compile time
- From: Dimiter 'malkia' Stanev <malkia@...>
- Date: Wed, 30 Nov 2011 10:27:33 -0800
I guess my message didn't get in.
I've looked at luajit's lua.h and lua's lua.h, and they are almost
identical, but both include luaconf.h and there the things differ.
For example LUA_JDIR is defined for luajit only.
So one way compile time to detect whether luajit is being included,
instead of lua is by doing this:
// luajit here
// lua (or some other implementation)
On 11/30/2011 9:46 AM, Javier Guerra Giraldez wrote:
On Wed, Nov 30, 2011 at 12:32 PM, Mike Pall<email@example.com> wrote:
I don't think you understood what I said. Your code may still be
running under either Lua or LuaJIT. It only depends on which
library you link against and/or from which VM your module is
loaded. The C compiler cannot know that. You definitely want to
print the version info provided at runtime, not a static version.
Maybe Antonio's C code isn't a module, but is embedding Lua? In that
case, i think the question makes some sense, even if the chosen
library could still be changed at dynamic link time....