aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Germain <bnt.germain@gmail.com>2014-04-22 16:00:36 +0200
committerBenoit Germain <bnt.germain@gmail.com>2014-04-22 16:00:36 +0200
commit9eee131f36700f0693d4e2f168a389e2e7c20e89 (patch)
treeb75d7fea61018e0c47c4b37f3aec65f64950b0e1
parentd8cfb248939a9b6e1cbc9bb4c05b216daf9a0e3a (diff)
parentf33e4e68f5877a35e4952e1f53704464c18a53ed (diff)
downloadlanes-9eee131f36700f0693d4e2f168a389e2e7c20e89.tar.gz
lanes-9eee131f36700f0693d4e2f168a389e2e7c20e89.tar.bz2
lanes-9eee131f36700f0693d4e2f168a389e2e7c20e89.zip
Merge pull request #99 from Stepets/master
LuaJIT auto detect
-rw-r--r--src/tools.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/tools.h b/src/tools.h
index 8e8bb7d..b868440 100644
--- a/src/tools.h
+++ b/src/tools.h
@@ -17,8 +17,11 @@
17#endif 17#endif
18 18
19// For some reason, LuaJIT 64bits doesn't support lua_newstate() 19// For some reason, LuaJIT 64bits doesn't support lua_newstate()
20// If you build specifically for this situation, change value to 0 20#if defined(LUA_LJDIR) && (defined(__x86_64__) || defined(_M_X64))
21#define PROPAGATE_ALLOCF 0
22#else // LuaJIT x64
21#define PROPAGATE_ALLOCF 1 23#define PROPAGATE_ALLOCF 1
24#endif // LuaJIT x64
22#if PROPAGATE_ALLOCF 25#if PROPAGATE_ALLOCF
23#define PROPAGATE_ALLOCF_PREP( L) void* allocUD; lua_Alloc allocF = lua_getallocf( L, &allocUD) 26#define PROPAGATE_ALLOCF_PREP( L) void* allocUD; lua_Alloc allocF = lua_getallocf( L, &allocUD)
24#define PROPAGATE_ALLOCF_ALLOC() lua_newstate( allocF, allocUD) 27#define PROPAGATE_ALLOCF_ALLOC() lua_newstate( allocF, allocUD)