beta-0.89.2
[luatex.git] / source / libs / luajit / LuaJIT-src / src / luaconf.h
blob79f514825f87394d8971fda3e8b7a0bb16cef99f
1 /*
2 ** Configuration header.
3 ** Copyright (C) 2005-2015 Mike Pall. See Copyright Notice in luajit.h
4 */
6 #ifndef luaconf_h
7 #define luaconf_h
9 #ifndef WINVER
10 #define WINVER 0x0501
11 #endif
12 #include <limits.h>
13 #include <stddef.h>
15 /* Default path for loading Lua and C modules with require(). */
16 #if defined(_WIN32)
18 ** In Windows, any exclamation mark ('!') in the path is replaced by the
19 ** path of the directory of the executable file of the current process.
21 #define LUA_LDIR "!\\lua\\"
22 #define LUA_CDIR "!\\"
23 #define LUA_PATH_DEFAULT \
24 ".\\?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?\\init.lua;"
25 #define LUA_CPATH_DEFAULT \
26 ".\\?.dll;" LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll"
27 #else
29 ** Note to distribution maintainers: do NOT patch the following lines!
30 ** Please read ../doc/install.html#distro and pass PREFIX=/usr instead.
32 #ifndef LUA_MULTILIB
33 #define LUA_MULTILIB "lib"
34 #endif
35 #ifndef LUA_LMULTILIB
36 #define LUA_LMULTILIB "lib"
37 #endif
38 #define LUA_LROOT "/usr/local"
39 #define LUA_LUADIR "/lua/5.1/"
40 #define LUA_LJDIR "/luajit-2.1.0-beta1/"
42 #ifdef LUA_ROOT
43 #define LUA_JROOT LUA_ROOT
44 #define LUA_RLDIR LUA_ROOT "/share" LUA_LUADIR
45 #define LUA_RCDIR LUA_ROOT "/" LUA_MULTILIB LUA_LUADIR
46 #define LUA_RLPATH ";" LUA_RLDIR "?.lua;" LUA_RLDIR "?/init.lua"
47 #define LUA_RCPATH ";" LUA_RCDIR "?.so"
48 #else
49 #define LUA_JROOT LUA_LROOT
50 #define LUA_RLPATH
51 #define LUA_RCPATH
52 #endif
54 #define LUA_JPATH ";" LUA_JROOT "/share" LUA_LJDIR "?.lua"
55 #define LUA_LLDIR LUA_LROOT "/share" LUA_LUADIR
56 #define LUA_LCDIR LUA_LROOT "/" LUA_LMULTILIB LUA_LUADIR
57 #define LUA_LLPATH ";" LUA_LLDIR "?.lua;" LUA_LLDIR "?/init.lua"
58 #define LUA_LCPATH1 ";" LUA_LCDIR "?.so"
59 #define LUA_LCPATH2 ";" LUA_LCDIR "loadall.so"
61 #define LUA_PATH_DEFAULT "./?.lua" LUA_JPATH LUA_LLPATH LUA_RLPATH
62 #define LUA_CPATH_DEFAULT "./?.so" LUA_LCPATH1 LUA_RCPATH LUA_LCPATH2
63 #endif
65 /* Environment variable names for path overrides and initialization code. */
66 #define LUA_PATH "LUA_PATH"
67 #define LUA_CPATH "LUA_CPATH"
68 #define LUA_INIT "LUA_INIT"
70 /* Special file system characters. */
71 #if defined(_WIN32)
72 #define LUA_DIRSEP "\\"
73 #else
74 #define LUA_DIRSEP "/"
75 #endif
76 #define LUA_PATHSEP ";"
77 #define LUA_PATH_MARK "?"
78 #define LUA_EXECDIR "!"
79 #define LUA_IGMARK "-"
80 #define LUA_PATH_CONFIG \
81 LUA_DIRSEP "\n" LUA_PATHSEP "\n" LUA_PATH_MARK "\n" \
82 LUA_EXECDIR "\n" LUA_IGMARK
84 /* Quoting in error messages. */
85 #define LUA_QL(x) "'" x "'"
86 #define LUA_QS LUA_QL("%s")
88 /* Various tunables. */
89 #define LUAI_MAXSTACK 65500 /* Max. # of stack slots for a thread (<64K). */
90 #define LUAI_MAXCSTACK 8000 /* Max. # of stack slots for a C func (<10K). */
91 #define LUAI_GCPAUSE 200 /* Pause GC until memory is at 200%. */
92 #define LUAI_GCMUL 200 /* Run GC at 200% of allocation speed. */
93 #define LUA_MAXCAPTURES 32 /* Max. pattern captures. */
95 /* Compatibility with older library function names. */
96 #define LUA_COMPAT_MOD /* OLD: math.mod, NEW: math.fmod */
97 #define LUA_COMPAT_GFIND /* OLD: string.gfind, NEW: string.gmatch */
99 /* Configuration for the frontend (the luajit executable). */
100 #if defined(luajit_c)
101 #define LUA_PROGNAME "luajit" /* Fallback frontend name. */
102 #define LUA_PROMPT "> " /* Interactive prompt. */
103 #define LUA_PROMPT2 ">> " /* Continuation prompt. */
104 #define LUA_MAXINPUT 512 /* Max. input line length. */
105 #endif
107 /* Note: changing the following defines breaks the Lua 5.1 ABI. */
108 #define LUA_INTEGER ptrdiff_t
109 #define LUA_IDSIZE 60 /* Size of lua_Debug.short_src. */
111 ** Size of lauxlib and io.* on-stack buffers. Weird workaround to avoid using
112 ** unreasonable amounts of stack space, but still retain ABI compatibility.
113 ** Blame Lua for depending on BUFSIZ in the ABI, blame **** for wrecking it.
115 #define LUAL_BUFFERSIZE (BUFSIZ > 16384 ? 8192 : BUFSIZ)
117 /* The following defines are here only for compatibility with luaconf.h
118 ** from the standard Lua distribution. They must not be changed for LuaJIT.
120 #define LUA_NUMBER_DOUBLE
121 #define LUA_NUMBER double
122 #define LUAI_UACNUMBER double
123 #define LUA_NUMBER_SCAN "%lf"
124 #define LUA_NUMBER_FMT "%.14g"
125 #define lua_number2str(s, n) sprintf((s), LUA_NUMBER_FMT, (n))
126 #define LUAI_MAXNUMBER2STR 32
127 #define LUA_INTFRMLEN "l"
128 #define LUA_INTFRM_T long
130 /* Linkage of public API functions. */
131 #if defined(LUA_BUILD_AS_DLL)
132 #if defined(LUA_CORE) || defined(LUA_LIB)
133 #define LUA_API __declspec(dllexport)
134 #else
135 #define LUA_API __declspec(dllimport)
136 #endif
137 #else
138 #define LUA_API extern
139 #endif
141 #define LUALIB_API LUA_API
143 /* Support for internal assertions. */
144 #if defined(LUA_USE_ASSERT) || defined(LUA_USE_APICHECK)
145 #include <assert.h>
146 #endif
147 #ifdef LUA_USE_ASSERT
148 #define lua_assert(x) assert(x)
149 #endif
150 #ifdef LUA_USE_APICHECK
151 #define luai_apicheck(L, o) { (void)L; assert(o); }
152 #else
153 #define luai_apicheck(L, o) { (void)L; }
154 #endif
156 #endif