/* ** Configuration header. ** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h */ #ifndef luaconf_h #define luaconf_h #include #include #cmakedefine LUAJIT_DISABLE_FFI #cmakedefine LUAJIT_ENABLE_LUA52COMPAT #cmakedefine LUAJIT_DISABLE_JIT #cmakedefine LUAJIT_USE_SYSMALLOC #cmakedefine LUAJIT_USE_VALGRIND #cmakedefine LUAJIT_USE_GDBJIT #cmakedefine LUA_USE_APICHECK #cmakedefine LUA_USE_ASSERT #cmakedefine LUAJIT_CPU_SSE2 #cmakedefine LUAJIT_CPU_NOCMOV /* Default path for loading Lua and C modules with require(). */ #cmakedefine LUA_MODULE_SUFFIX "@LUA_MODULE_SUFFIX@" #cmakedefine LUA_DIR "@LUA_DIR@" #cmakedefine LUA_LDIR "@LUA_LDIR@" #cmakedefine LUA_CDIR "@LUA_CDIR@" #define LUA_PATH_DEFAULT "@LUA_PATH_DEFAULT@" #define LUA_CPATH_DEFAULT "@LUA_CPATH_DEFAULT@" /* Environment variable names for path overrides and initialization code. */ #cmakedefine LUA_PATH "@LUA_PATH@" #cmakedefine LUA_CPATH "@LUA_CPATH@" #cmakedefine LUA_INIT "@LUA_INIT@" /* Special file system characters. */ #cmakedefine LUA_DIRSEP "@LUA_DIRSEP@" #define LUA_PATHSEP ";" #define LUA_PATH_MARK "?" #define LUA_EXECDIR "!" #define LUA_IGMARK "-" #define LUA_PATH_CONFIG \ LUA_DIRSEP "\n" LUA_PATHSEP "\n" LUA_PATH_MARK "\n" \ LUA_EXECDIR "\n" LUA_IGMARK /* Quoting in error messages. */ #define LUA_QL(x) "'" x "'" #define LUA_QS LUA_QL("%s") /* Various tunables. */ #cmakedefine LUAI_MAXSTACK @LUAI_MAXSTACK@ /* Max. # of stack slots for a thread (<64K). */ #cmakedefine LUAI_MAXCSTACK @LUAI_MAXCSTACK@ /* Max. # of stack slots for a C func (<10K). */ #cmakedefine LUAI_GCPAUSE @LUAI_GCPAUSE@ /* Pause GC until memory is at 200%. */ #cmakedefine LUAI_GCMUL @LUAI_GCMUL@ /* Run GC at 200% of allocation speed. */ #cmakedefine LUA_MAXCAPTURES @LUA_MAXCAPTURES@ /* Max. pattern captures. */ /* Compatibility with older library function names. */ #define LUA_COMPAT_MOD /* OLD: math.mod, NEW: math.fmod */ #define LUA_COMPAT_GFIND /* OLD: string.gfind, NEW: string.gmatch */ /* Configuration for the frontend (the luajit executable). */ #if defined(luajit_c) #define LUA_PROGNAME "luajit" /* Fallback frontend name. */ #cmakedefine LUA_PROMPT "@LUA_PROMPT@" /* Interactive prompt. */ #cmakedefine LUA_PROMPT2 "@LUA_PROMPT2@" /* Continuation prompt. */ #cmakedefine LUA_MAXINPUT @LUA_MAXINPUT@ /* Max. input line length. */ #endif /* Note: changing the following defines breaks the Lua 5.1 ABI. */ #define LUA_INTEGER ptrdiff_t #define LUA_IDSIZE 60 /* Size of lua_Debug.short_src. */ /* ** Size of lauxlib and io.* on-stack buffers. Weird workaround to avoid using ** unreasonable amounts of stack space, but still retain ABI compatibility. ** Blame Lua for depending on BUFSIZ in the ABI, blame **** for wrecking it. */ #define LUAL_BUFFERSIZE (BUFSIZ > 16384 ? 8192 : BUFSIZ) /* The following defines are here only for compatibility with luaconf.h ** from the standard Lua distribution. They must not be changed for LuaJIT. */ #define LUA_NUMBER_DOUBLE #define LUA_NUMBER double #define LUAI_UACNUMBER double #define LUA_NUMBER_SCAN "%lf" #define LUA_NUMBER_FMT "%.14g" #define lua_number2str(s, n) sprintf((s), LUA_NUMBER_FMT, (n)) #define LUAI_MAXNUMBER2STR 32 #define LUA_INTFRMLEN "l" #define LUA_INTFRM_T long /* Linkage of public API functions. */ #if defined(LUA_BUILD_AS_DLL) #if defined(LUA_CORE) || defined(LUA_LIB) #define LUA_API __declspec(dllexport) #else #define LUA_API __declspec(dllimport) #endif #else #define LUA_API extern #endif #define LUALIB_API LUA_API /* Support for internal assertions. */ #if defined(LUA_USE_ASSERT) || defined(LUA_USE_APICHECK) #include #endif #ifdef LUA_USE_ASSERT #define lua_assert(x) assert(x) #endif #ifdef LUA_USE_APICHECK #define luai_apicheck(L, o) { (void)L; assert(o); } #else #define luai_apicheck(L, o) { (void)L; } #endif #endif