aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStepets <stepa.alimov.93@gmail.com>2014-04-20 13:22:43 +0400
committerStepets <stepa.alimov.93@gmail.com>2014-04-20 13:22:43 +0400
commit24fab19cef4ddd030ffa37a85b527d1b368e5481 (patch)
tree7c4bf823d1945ee44b40bea4a4186c2327705a97
parentd8cfb248939a9b6e1cbc9bb4c05b216daf9a0e3a (diff)
downloadlanes-24fab19cef4ddd030ffa37a85b527d1b368e5481.tar.gz
lanes-24fab19cef4ddd030ffa37a85b527d1b368e5481.tar.bz2
lanes-24fab19cef4ddd030ffa37a85b527d1b368e5481.zip
LuaJIT auto detect
-rw-r--r--src/tools.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/tools.h b/src/tools.h
index 8e8bb7d..2609ce9 100644
--- a/src/tools.h
+++ b/src/tools.h
@@ -18,14 +18,15 @@
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 you build specifically for this situation, change value to 0
21#define PROPAGATE_ALLOCF 1 21#if defined(LUA_LJDIR) && (defined(__x86_64__) || defined(_M_X64))
22#if PROPAGATE_ALLOCF 22#define PROPAGATE_ALLOCF 0
23#define PROPAGATE_ALLOCF_PREP( L) void* allocUD; lua_Alloc allocF = lua_getallocf( L, &allocUD) 23#define PROPAGATE_ALLOCF_PREP( L) void* allocUD; lua_Alloc allocF = lua_getallocf( L, &allocUD)
24#define PROPAGATE_ALLOCF_ALLOC() lua_newstate( allocF, allocUD) 24#define PROPAGATE_ALLOCF_ALLOC() lua_newstate( allocF, allocUD)
25#else // PROPAGATE_ALLOCF 25#else // luaJIT x64
26#define PROPAGATE_ALLOCF 1
26#define PROPAGATE_ALLOCF_PREP( L) 27#define PROPAGATE_ALLOCF_PREP( L)
27#define PROPAGATE_ALLOCF_ALLOC() luaL_newstate() 28#define PROPAGATE_ALLOCF_ALLOC() luaL_newstate()
28#endif // PROPAGATE_ALLOCF 29#endif // luaJIT x64
29 30
30#define USE_DEBUG_SPEW 0 31#define USE_DEBUG_SPEW 0
31#if USE_DEBUG_SPEW 32#if USE_DEBUG_SPEW