aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStepets <stepa.alimov.93@gmail.com>2014-04-20 13:56:34 +0400
committerStepets <stepa.alimov.93@gmail.com>2014-04-20 13:56:34 +0400
commitf33e4e68f5877a35e4952e1f53704464c18a53ed (patch)
treeb75d7fea61018e0c47c4b37f3aec65f64950b0e1
parent24fab19cef4ddd030ffa37a85b527d1b368e5481 (diff)
downloadlanes-f33e4e68f5877a35e4952e1f53704464c18a53ed.tar.gz
lanes-f33e4e68f5877a35e4952e1f53704464c18a53ed.tar.bz2
lanes-f33e4e68f5877a35e4952e1f53704464c18a53ed.zip
LuaJIT auto detect FIX
-rw-r--r--src/tools.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/tools.h b/src/tools.h
index 2609ce9..b868440 100644
--- a/src/tools.h
+++ b/src/tools.h
@@ -17,16 +17,18 @@
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
21#if defined(LUA_LJDIR) && (defined(__x86_64__) || defined(_M_X64)) 20#if defined(LUA_LJDIR) && (defined(__x86_64__) || defined(_M_X64))
22#define PROPAGATE_ALLOCF 0 21#define PROPAGATE_ALLOCF 0
22#else // LuaJIT x64
23#define PROPAGATE_ALLOCF 1
24#endif // LuaJIT x64
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)
25#else // luaJIT x64 28#else // PROPAGATE_ALLOCF
26#define PROPAGATE_ALLOCF 1
27#define PROPAGATE_ALLOCF_PREP( L) 29#define PROPAGATE_ALLOCF_PREP( L)
28#define PROPAGATE_ALLOCF_ALLOC() luaL_newstate() 30#define PROPAGATE_ALLOCF_ALLOC() luaL_newstate()
29#endif // luaJIT x64 31#endif // PROPAGATE_ALLOCF
30 32
31#define USE_DEBUG_SPEW 0 33#define USE_DEBUG_SPEW 0
32#if USE_DEBUG_SPEW 34#if USE_DEBUG_SPEW