summaryrefslogtreecommitdiff
path: root/src/luaconf.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/luaconf.h')
-rw-r--r--src/luaconf.h133
1 files changed, 133 insertions, 0 deletions
diff --git a/src/luaconf.h b/src/luaconf.h
new file mode 100644
index 00000000..4d4f1099
--- /dev/null
+++ b/src/luaconf.h
@@ -0,0 +1,133 @@
1/*
2** Configuration header.
3** Copyright (C) 2005-2009 Mike Pall. See Copyright Notice in luajit.h
4*/
5
6#ifndef luaconf_h
7#define luaconf_h
8
9#include <limits.h>
10#include <stddef.h>
11
12/* Try to determine supported features for a couple of standard platforms. */
13#if defined(_WIN32)
14#define LUA_USE_WIN
15#define LUA_DL_DLL
16#elif defined(__linux__) || defined(__solaris__) || defined(__CYGWIN__) || \
17 defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || \
18 (defined(__MACH__) && defined(__APPLE__))
19#define LUA_USE_POSIX
20#define LUA_DL_DLOPEN
21#endif
22
23/* Default path for loading Lua and C modules with require(). */
24#ifdef LUA_USE_WIN
25/*
26** In Windows, any exclamation mark ('!') in the path is replaced by the
27** path of the directory of the executable file of the current process.
28*/
29#define LUA_LDIR "!\\lua\\"
30#define LUA_CDIR "!\\"
31#define LUA_PATH_DEFAULT \
32 ".\\?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?\\init.lua;"
33#define LUA_CPATH_DEFAULT \
34 ".\\?.dll;" LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll"
35#else
36#define LUA_ROOT "/usr/local/"
37#define LUA_JDIR LUA_ROOT "share/luajit-2.0.0-beta1/"
38#define LUA_LDIR LUA_ROOT "share/lua/5.1/"
39#define LUA_CDIR LUA_ROOT "lib/lua/5.1/"
40#define LUA_PATH_DEFAULT \
41 "./?.lua;" LUA_JDIR"?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;"
42#define LUA_CPATH_DEFAULT \
43 "./?.so;" LUA_CDIR"?.so;" LUA_CDIR"loadall.so"
44#endif
45
46/* Environment variable names for path overrides and initialization code. */
47#define LUA_PATH "LUA_PATH"
48#define LUA_CPATH "LUA_CPATH"
49#define LUA_INIT "LUA_INIT"
50
51/* Special file system characters. */
52#ifdef LUA_USE_WIN
53#define LUA_DIRSEP "\\"
54#else
55#define LUA_DIRSEP "/"
56#endif
57#define LUA_PATHSEP ";"
58#define LUA_PATH_MARK "?"
59#define LUA_EXECDIR "!"
60#define LUA_IGMARK "-"
61#define LUA_PATH_CONFIG \
62 LUA_DIRSEP "\n" LUA_PATHSEP "\n" LUA_PATH_MARK "\n" \
63 LUA_EXECDIR "\n" LUA_IGMARK
64
65/* Quoting in error messages. */
66#define LUA_QL(x) "'" x "'"
67#define LUA_QS LUA_QL("%s")
68
69/* Various tunables. */
70#define LUAI_MAXSTACK 65500 /* Max. # of stack slots for a thread (<64K). */
71#define LUAI_MAXCSTACK 8000 /* Max. # of stack slots for a C func (<10K). */
72#define LUAI_GCPAUSE 200 /* Pause GC until memory is at 200%. */
73#define LUAI_GCMUL 200 /* Run GC at 200% of allocation speed. */
74#define LUA_MAXCAPTURES 32 /* Max. pattern captures. */
75
76/* Compatibility with older library function names. */
77#define LUA_COMPAT_MOD /* OLD: math.mod, NEW: math.fmod */
78#define LUA_COMPAT_GFIND /* OLD: string.gfind, NEW: string.gmatch */
79
80/* Configuration for the frontend (the luajit executable). */
81#if defined(luajit_c)
82#define LUA_PROGNAME "luajit" /* Fallback frontend name. */
83#define LUA_PROMPT "> " /* Interactive prompt. */
84#define LUA_PROMPT2 ">> " /* Continuation prompt. */
85#define LUA_MAXINPUT 512 /* Max. input line length. */
86#endif
87
88/* Note: changing the following defines breaks the Lua 5.1 ABI. */
89#define LUA_INTEGER ptrdiff_t
90#define LUA_IDSIZE 60 /* Size of lua_Debug.short_src. */
91#define LUAL_BUFFERSIZE BUFSIZ /* Size of lauxlib and io.* buffers. */
92
93/* The following defines are here only for compatibility with luaconf.h
94** from the standard Lua distribution. They must not be changed for LuaJIT.
95*/
96#define LUA_NUMBER_DOUBLE
97#define LUA_NUMBER double
98#define LUAI_UACNUMBER double
99#define LUA_NUMBER_SCAN "%lf"
100#define LUA_NUMBER_FMT "%.14g"
101#define lua_number2str(s, n) sprintf((s), LUA_NUMBER_FMT, (n))
102#define LUAI_MAXNUMBER2STR 32
103#define lua_str2number(s, p) strtod((s), (p))
104#define LUA_INTFRMLEN "l"
105#define LUA_INTFRM_T long
106
107/* Linkage of public API functions. */
108#if defined(LUA_BUILD_AS_DLL)
109#if defined(LUA_CORE) || defined(LUA_LIB)
110#define LUA_API __declspec(dllexport)
111#else
112#define LUA_API __declspec(dllimport)
113#endif
114#else
115#define LUA_API extern
116#endif
117
118#define LUALIB_API LUA_API
119
120/* Support for internal assertions. */
121#if defined(LUA_USE_ASSERT) || defined(LUA_USE_APICHECK)
122#include <assert.h>
123#endif
124#ifdef LUA_USE_ASSERT
125#define lua_assert(x) assert(x)
126#endif
127#ifdef LUA_USE_APICHECK
128#define luai_apicheck(L, o) { (void)L; assert(o); }
129#else
130#define luai_apicheck(L, o) { (void)L; }
131#endif
132
133#endif