1 /*
2 ** $Id: luaconf.h,v 1.238 2014/12/29 13:27:55 roberto Exp $
3 ** Configuration file for Lua
4 ** See Copyright Notice in lua.h
5 */
6 
7 
8 #ifndef luaconf_h
9 #define luaconf_h
10 
11 #include <limits.h>
12 #include <stddef.h>
13 
14 
15 /*
16 ** ===================================================================
17 ** Search for "@@" to find all configurable definitions.
18 ** ===================================================================
19 */
20 
21 
22 /*
23 ** {====================================================================
24 ** System Configuration: macros to adapt (if needed) Lua to some
25 ** particular platform, for instance compiling it with 32-bit numbers or
26 ** restricting it to C89.
27 ** =====================================================================
28 */
29 
30 /*
31 @@ LUA_32BITS enables Lua with 32-bit integers and 32-bit floats. You
32 ** can also define LUA_32BITS in the make file, but changing here you
33 ** ensure that all software connected to Lua will be compiled with the
34 ** same configuration.
35 */
36 /* #define LUA_32BITS */
37 
38 
39 /*
40 @@ LUA_USE_C89 controls the use of non-ISO-C89 features.
41 ** Define it if you want Lua to avoid the use of a few C99 features
42 ** or Windows-specific features on Windows.
43 */
44 /* #define LUA_USE_C89 */
45 
46 
47 /*
48 ** By default, Lua on Windows use (some) specific Windows features
49 */
50 #if !defined(LUA_USE_C89) && defined(_WIN32) && !defined(_WIN32_WCE)
51 #define LUA_USE_WINDOWS  /* enable goodies for regular Windows */
52 #endif
53 
54 
55 #if defined(LUA_USE_WINDOWS)
56 #define LUA_DL_DLL	/* enable support for DLL */
57 #define LUA_USE_C89	/* broadly, Windows is C89 */
58 #endif
59 
60 
61 #if defined(LUA_USE_LINUX)
62 #define LUA_USE_POSIX
63 #define LUA_USE_DLOPEN		/* needs an extra library: -ldl */
64 #define LUA_USE_READLINE	/* needs some extra libraries */
65 #endif
66 
67 
68 #if defined(LUA_USE_MACOSX)
69 #define LUA_USE_POSIX
70 #define LUA_USE_DLOPEN		/* MacOS does not need -ldl */
71 #define LUA_USE_READLINE	/* needs an extra library: -lreadline */
72 #endif
73 
74 
75 /*
76 @@ LUA_C89_NUMBERS ensures that Lua uses the largest types available for
77 ** C89 ('long' and 'double'); Windows always has '__int64', so it does
78 ** not need to use this case.
79 */
80 #if defined(LUA_USE_C89) && !defined(LUA_USE_WINDOWS)
81 #define LUA_C89_NUMBERS
82 #endif
83 
84 
85 
86 /*
87 @@ LUAI_BITSINT defines the (minimum) number of bits in an 'int'.
88 */
89 /* avoid undefined shifts */
90 #if ((INT_MAX >> 15) >> 15) >= 1
91 #define LUAI_BITSINT	32
92 #else
93 /* 'int' always must have at least 16 bits */
94 #define LUAI_BITSINT	16
95 #endif
96 
97 
98 /*
99 @@ LUA_INT_INT / LUA_INT_LONG / LUA_INT_LONGLONG defines the type for
100 ** Lua integers.
101 @@ LUA_REAL_FLOAT / LUA_REAL_DOUBLE / LUA_REAL_LONGDOUBLE defines
102 ** the type for Lua floats.
103 ** Lua should work fine with any mix of these options (if supported
104 ** by your C compiler). The usual configurations are 64-bit integers
105 ** and 'double' (the default), 32-bit integers and 'float' (for
106 ** restricted platforms), and 'long'/'double' (for C compilers not
107 ** compliant with C99, which may not have support for 'long long').
108 */
109 
110 #if defined(LUA_32BITS)		/* { */
111 /*
112 ** 32-bit integers and 'float'
113 */
114 #if LUAI_BITSINT >= 32  /* use 'int' if big enough */
115 #define LUA_INT_INT
116 #else  /* otherwise use 'long' */
117 #define LUA_INT_LONG
118 #endif
119 #define LUA_REAL_FLOAT
120 
121 #elif defined(LUA_C89_NUMBERS)	/* }{ */
122 /*
123 ** largest types available for C89 ('long' and 'double')
124 */
125 #define LUA_INT_LONG
126 #define LUA_REAL_DOUBLE
127 
128 #else				/* }{ */
129 /*
130 ** default configuration for 64-bit Lua ('long long' and 'double')
131 */
132 #define LUA_INT_LONGLONG
133 #define LUA_REAL_DOUBLE
134 
135 #endif								/* } */
136 
137 /* }================================================================== */
138 
139 
140 
141 
142 /*
143 ** {==================================================================
144 ** Configuration for Paths.
145 ** ===================================================================
146 */
147 
148 /*
149 @@ LUA_PATH_DEFAULT is the default path that Lua uses to look for
150 ** Lua libraries.
151 @@ LUA_CPATH_DEFAULT is the default path that Lua uses to look for
152 ** C libraries.
153 ** CHANGE them if your machine has a non-conventional directory
154 ** hierarchy or if you want to install your libraries in
155 ** non-conventional directories.
156 */
157 #define LUA_VDIR	LUA_VERSION_MAJOR "." LUA_VERSION_MINOR
158 #if defined(_WIN32) 	/* { */
159 /*
160 ** In Windows, any exclamation mark ('!') in the path is replaced by the
161 ** path of the directory of the executable file of the current process.
162 */
163 #define LUA_LDIR	"!\\lua\\"
164 #define LUA_CDIR	"!\\"
165 #define LUA_SHRDIR	"!\\..\\share\\lua\\" LUA_VDIR "\\"
166 #define LUA_PATH_DEFAULT  \
167 		LUA_LDIR"?.lua;"  LUA_LDIR"?\\init.lua;" \
168 		LUA_CDIR"?.lua;"  LUA_CDIR"?\\init.lua;" \
169 		LUA_SHRDIR"?.lua;" LUA_SHRDIR"?\\init.lua;" \
170 		".\\?.lua;" ".\\?\\init.lua"
171 #define LUA_CPATH_DEFAULT \
172 		LUA_CDIR"?.dll;" \
173 		LUA_CDIR"..\\lib\\lua\\" LUA_VDIR "\\?.dll;" \
174 		LUA_CDIR"loadall.dll;" ".\\?.dll"
175 
176 #else			/* }{ */
177 
178 #define LUA_ROOT	"/usr/local/"
179 #define LUA_LDIR	LUA_ROOT "share/lua/" LUA_VDIR "/"
180 #define LUA_CDIR	LUA_ROOT "lib/lua/" LUA_VDIR "/"
181 #define LUA_PATH_DEFAULT  \
182 		LUA_LDIR"?.lua;"  LUA_LDIR"?/init.lua;" \
183 		LUA_CDIR"?.lua;"  LUA_CDIR"?/init.lua;" \
184 		"./?.lua;" "./?/init.lua"
185 #define LUA_CPATH_DEFAULT \
186 		LUA_CDIR"?.so;" LUA_CDIR"loadall.so;" "./?.so"
187 #endif			/* } */
188 
189 
190 /*
191 @@ LUA_DIRSEP is the directory separator (for submodules).
192 ** CHANGE it if your machine does not use "/" as the directory separator
193 ** and is not Windows. (On Windows Lua automatically uses "\".)
194 */
195 #if defined(_WIN32)
196 #define LUA_DIRSEP	"\\"
197 #else
198 #define LUA_DIRSEP	"/"
199 #endif
200 
201 /* }================================================================== */
202 
203 
204 /*
205 ** {==================================================================
206 ** Marks for exported symbols in the C code
207 ** ===================================================================
208 */
209 
210 /*
211 @@ LUA_API is a mark for all core API functions.
212 @@ LUALIB_API is a mark for all auxiliary library functions.
213 @@ LUAMOD_API is a mark for all standard library opening functions.
214 ** CHANGE them if you need to define those functions in some special way.
215 ** For instance, if you want to create one Windows DLL with the core and
216 ** the libraries, you may want to use the following definition (define
217 ** LUA_BUILD_AS_DLL to get it).
218 */
219 #if defined(LUA_BUILD_AS_DLL)	/* { */
220 
221 #if defined(LUA_CORE) || defined(LUA_LIB)	/* { */
222 #define LUA_API __declspec(dllexport)
223 #else						/* }{ */
224 #define LUA_API __declspec(dllimport)
225 #endif						/* } */
226 
227 #else				/* }{ */
228 
229 #define LUA_API		extern
230 
231 #endif				/* } */
232 
233 
234 /* more often than not the libs go together with the core */
235 #define LUALIB_API	LUA_API
236 #define LUAMOD_API	LUALIB_API
237 
238 
239 /*
240 @@ LUAI_FUNC is a mark for all extern functions that are not to be
241 ** exported to outside modules.
242 @@ LUAI_DDEF and LUAI_DDEC are marks for all extern (const) variables
243 ** that are not to be exported to outside modules (LUAI_DDEF for
244 ** definitions and LUAI_DDEC for declarations).
245 ** CHANGE them if you need to mark them in some special way. Elf/gcc
246 ** (versions 3.2 and later) mark them as "hidden" to optimize access
247 ** when Lua is compiled as a shared library. Not all elf targets support
248 ** this attribute. Unfortunately, gcc does not offer a way to check
249 ** whether the target offers that support, and those without support
250 ** give a warning about it. To avoid these warnings, change to the
251 ** default definition.
252 */
253 #if defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 302) && \
254     defined(__ELF__)		/* { */
255 #define LUAI_FUNC	__attribute__((visibility("hidden"))) extern
256 #else				/* }{ */
257 #define LUAI_FUNC	extern
258 #endif				/* } */
259 
260 #define LUAI_DDEC	LUAI_FUNC
261 #define LUAI_DDEF	/* empty */
262 
263 /* }================================================================== */
264 
265 
266 /*
267 ** {==================================================================
268 ** Compatibility with previous versions
269 ** ===================================================================
270 */
271 
272 /*
273 @@ LUA_COMPAT_5_2 controls other macros for compatibility with Lua 5.2.
274 @@ LUA_COMPAT_5_1 controls other macros for compatibility with Lua 5.1.
275 ** You can define it to get all options, or change specific options
276 ** to fit your specific needs.
277 */
278 #if defined(LUA_COMPAT_5_2)	/* { */
279 
280 /*
281 @@ LUA_COMPAT_MATHLIB controls the presence of several deprecated
282 ** functions in the mathematical library.
283 */
284 #define LUA_COMPAT_MATHLIB
285 
286 /*
287 @@ LUA_COMPAT_BITLIB controls the presence of library 'bit32'.
288 */
289 #define LUA_COMPAT_BITLIB
290 
291 /*
292 @@ LUA_COMPAT_IPAIRS controls the effectiveness of the __ipairs metamethod.
293 */
294 #define LUA_COMPAT_IPAIRS
295 
296 /*
297 @@ LUA_COMPAT_APIINTCASTS controls the presence of macros for
298 ** manipulating other integer types (lua_pushunsigned, lua_tounsigned,
299 ** luaL_checkint, luaL_checklong, etc.)
300 */
301 #define LUA_COMPAT_APIINTCASTS
302 
303 
304 /*
305 @@ LUA_COMPAT_FLOATSTRING makes Lua format integral floats without a
306 @@ a float mark ('.0').
307 ** This macro is not on by default even in compatibility mode,
308 ** because this is not really an incompatibility.
309 */
310 /* #define LUA_COMPAT_FLOATSTRING */
311 
312 #endif				/* } */
313 
314 
315 #if defined(LUA_COMPAT_5_1)	/* { */
316 
317 /*
318 @@ LUA_COMPAT_UNPACK controls the presence of global 'unpack'.
319 ** You can replace it with 'table.unpack'.
320 */
321 #define LUA_COMPAT_UNPACK
322 
323 /*
324 @@ LUA_COMPAT_LOADERS controls the presence of table 'package.loaders'.
325 ** You can replace it with 'package.searchers'.
326 */
327 #define LUA_COMPAT_LOADERS
328 
329 /*
330 @@ macro 'lua_cpcall' emulates deprecated function lua_cpcall.
331 ** You can call your C function directly (with light C functions).
332 */
333 #define lua_cpcall(L,f,u)  \
334 	(lua_pushcfunction(L, (f)), \
335 	 lua_pushlightuserdata(L,(u)), \
336 	 lua_pcall(L,1,0,0))
337 
338 
339 /*
340 @@ LUA_COMPAT_LOG10 defines the function 'log10' in the math library.
341 ** You can rewrite 'log10(x)' as 'log(x, 10)'.
342 */
343 #define LUA_COMPAT_LOG10
344 
345 /*
346 @@ LUA_COMPAT_LOADSTRING defines the function 'loadstring' in the base
347 ** library. You can rewrite 'loadstring(s)' as 'load(s)'.
348 */
349 #define LUA_COMPAT_LOADSTRING
350 
351 /*
352 @@ LUA_COMPAT_MAXN defines the function 'maxn' in the table library.
353 */
354 #define LUA_COMPAT_MAXN
355 
356 /*
357 @@ The following macros supply trivial compatibility for some
358 ** changes in the API. The macros themselves document how to
359 ** change your code to avoid using them.
360 */
361 #define lua_strlen(L,i)		lua_rawlen(L, (i))
362 
363 #define lua_objlen(L,i)		lua_rawlen(L, (i))
364 
365 #define lua_equal(L,idx1,idx2)		lua_compare(L,(idx1),(idx2),LUA_OPEQ)
366 #define lua_lessthan(L,idx1,idx2)	lua_compare(L,(idx1),(idx2),LUA_OPLT)
367 
368 /*
369 @@ LUA_COMPAT_MODULE controls compatibility with previous
370 ** module functions 'module' (Lua) and 'luaL_register' (C).
371 */
372 #define LUA_COMPAT_MODULE
373 
374 #endif				/* } */
375 
376 /* }================================================================== */
377 
378 
379 
380 /*
381 ** {==================================================================
382 ** Configuration for Numbers.
383 ** Change these definitions if no predefined LUA_REAL_* / LUA_INT_*
384 ** satisfy your needs.
385 ** ===================================================================
386 */
387 
388 /*
389 @@ LUA_NUMBER is the floating-point type used by Lua.
390 **
391 @@ LUAI_UACNUMBER is the result of an 'usual argument conversion'
392 @@ over a floating number.
393 **
394 @@ LUA_NUMBER_FRMLEN is the length modifier for writing floats.
395 @@ LUA_NUMBER_FMT is the format for writing floats.
396 @@ lua_number2str converts a float to a string.
397 **
398 @@ l_mathop allows the addition of an 'l' or 'f' to all math operations.
399 **
400 @@ lua_str2number converts a decimal numeric string to a number.
401 */
402 
403 #if defined(LUA_REAL_FLOAT)		/* { single float */
404 
405 #define LUA_NUMBER	float
406 
407 #define LUAI_UACNUMBER	double
408 
409 #define LUA_NUMBER_FRMLEN	""
410 #define LUA_NUMBER_FMT		"%.7g"
411 
412 #define l_mathop(op)		op##f
413 
414 #define lua_str2number(s,p)	strtof((s), (p))
415 
416 
417 #elif defined(LUA_REAL_LONGDOUBLE)	/* }{ long double */
418 
419 #define LUA_NUMBER	long double
420 
421 #define LUAI_UACNUMBER	long double
422 
423 #define LUA_NUMBER_FRMLEN	"L"
424 #define LUA_NUMBER_FMT		"%.19Lg"
425 
426 #define l_mathop(op)		op##l
427 
428 #define lua_str2number(s,p)	strtold((s), (p))
429 
430 #elif defined(LUA_REAL_DOUBLE)		/* }{ double */
431 
432 #define LUA_NUMBER	double
433 
434 #define LUAI_UACNUMBER	double
435 
436 #define LUA_NUMBER_FRMLEN	""
437 #define LUA_NUMBER_FMT		"%.14g"
438 
439 #define l_mathop(op)		op
440 
441 #define lua_str2number(s,p)	strtod((s), (p))
442 
443 #else					/* }{ */
444 
445 #error "numeric real type not defined"
446 
447 #endif					/* } */
448 
449 
450 #define l_floor(x)		(l_mathop(floor)(x))
451 
452 #define lua_number2str(s,n)	sprintf((s), LUA_NUMBER_FMT, (n))
453 
454 
455 /*
456 @@ lua_numbertointeger converts a float number to an integer, or
457 ** returns 0 if float is not within the range of a lua_Integer.
458 ** (The range comparisons are tricky because of rounding. The tests
459 ** here assume a two-complement representation, where MININTEGER always
460 ** has an exact representation as a float; MAXINTEGER may not have one,
461 ** and therefore its conversion to float may have an ill-defined value.)
462 */
463 #define lua_numbertointeger(n,p) \
464   ((n) >= (LUA_NUMBER)(LUA_MININTEGER) && \
465    (n) < -(LUA_NUMBER)(LUA_MININTEGER) && \
466       (*(p) = (LUA_INTEGER)(n), 1))
467 
468 
469 /*
470 @@ The luai_num* macros define the primitive operations over numbers.
471 ** They should work for any size of floating numbers.
472 */
473 
474 /* the following operations need the math library */
475 #if defined(lobject_c) || defined(lvm_c)
476 #include <math.h>
477 
478 /* floor division (defined as 'floor(a/b)') */
479 #define luai_numidiv(L,a,b)	((void)L, l_mathop(floor)(luai_numdiv(L,a,b)))
480 
481 /*
482 ** module: defined as 'a - floor(a/b)*b'; the previous definition gives
483 ** NaN when 'b' is huge, but the result should be 'a'. 'fmod' gives the
484 ** result of 'a - trunc(a/b)*b', and therefore must be corrected when
485 ** 'trunc(a/b) ~= floor(a/b)'. That happens when the division has a
486 ** non-integer negative result, which is equivalent to the test below
487 */
488 #define luai_nummod(L,a,b,m)  \
489   { (m) = l_mathop(fmod)(a,b); if ((m)*(b) < 0) (m) += (b); }
490 
491 /* exponentiation */
492 #define luai_numpow(L,a,b)	((void)L, l_mathop(pow)(a,b))
493 
494 #endif
495 
496 /* these are quite standard operations */
497 #if defined(LUA_CORE)
498 #define luai_numadd(L,a,b)	((a)+(b))
499 #define luai_numsub(L,a,b)	((a)-(b))
500 #define luai_nummul(L,a,b)	((a)*(b))
501 #define luai_numdiv(L,a,b)	((a)/(b))
502 #define luai_numunm(L,a)	(-(a))
503 #define luai_numeq(a,b)		((a)==(b))
504 #define luai_numlt(a,b)		((a)<(b))
505 #define luai_numle(a,b)		((a)<=(b))
506 #define luai_numisnan(a)	(!luai_numeq((a), (a)))
507 #endif
508 
509 
510 /*
511 @@ LUA_INTEGER is the integer type used by Lua.
512 **
513 @@ LUA_UNSIGNED is the unsigned version of LUA_INTEGER.
514 **
515 @@ LUAI_UACINT is the result of an 'usual argument conversion'
516 @@ over a lUA_INTEGER.
517 @@ LUA_INTEGER_FRMLEN is the length modifier for reading/writing integers.
518 @@ LUA_INTEGER_FMT is the format for writing integers.
519 @@ LUA_MAXINTEGER is the maximum value for a LUA_INTEGER.
520 @@ LUA_MININTEGER is the minimum value for a LUA_INTEGER.
521 @@ lua_integer2str converts an integer to a string.
522 */
523 
524 
525 /* The following definitions are good for most cases here */
526 
527 #define LUA_INTEGER_FMT		"%" LUA_INTEGER_FRMLEN "d"
528 #define lua_integer2str(s,n)	sprintf((s), LUA_INTEGER_FMT, (n))
529 
530 #define LUAI_UACINT		LUA_INTEGER
531 
532 /*
533 ** use LUAI_UACINT here to avoid problems with promotions (which
534 ** can turn a comparison between unsigneds into a signed comparison)
535 */
536 #define LUA_UNSIGNED		unsigned LUAI_UACINT
537 
538 
539 /* now the variable definitions */
540 
541 #if defined(LUA_INT_INT)		/* { int */
542 
543 #define LUA_INTEGER		int
544 #define LUA_INTEGER_FRMLEN	""
545 
546 #define LUA_MAXINTEGER		INT_MAX
547 #define LUA_MININTEGER		INT_MIN
548 
549 #elif defined(LUA_INT_LONG)	/* }{ long */
550 
551 #define LUA_INTEGER		long
552 #define LUA_INTEGER_FRMLEN	"l"
553 
554 #define LUA_MAXINTEGER		LONG_MAX
555 #define LUA_MININTEGER		LONG_MIN
556 
557 #elif defined(LUA_INT_LONGLONG)	/* }{ long long */
558 
559 #if defined(LLONG_MAX)		/* { */
560 /* use ISO C99 stuff */
561 
562 #define LUA_INTEGER		long long
563 #define LUA_INTEGER_FRMLEN	"ll"
564 
565 #define LUA_MAXINTEGER		LLONG_MAX
566 #define LUA_MININTEGER		LLONG_MIN
567 
568 #elif defined(LUA_USE_WINDOWS) /* }{ */
569 /* in Windows, can use specific Windows types */
570 
571 #define LUA_INTEGER		__int64
572 #define LUA_INTEGER_FRMLEN	"I64"
573 
574 #define LUA_MAXINTEGER		_I64_MAX
575 #define LUA_MININTEGER		_I64_MIN
576 
577 #else				/* }{ */
578 
579 #error "Compiler does not support 'long long'. Use option '-DLUA_32BITS' \
580   or '-DLUA_C89_NUMBERS' (see file 'luaconf.h' for details)"
581 
582 #endif				/* } */
583 
584 #else				/* }{ */
585 
586 #error "numeric integer type not defined"
587 
588 #endif				/* } */
589 
590 /* }================================================================== */
591 
592 
593 /*
594 ** {==================================================================
595 ** Dependencies with C99
596 ** ===================================================================
597 */
598 
599 /*
600 @@ lua_strx2number converts an hexadecimal numeric string to a number.
601 ** In C99, 'strtod' does both conversions. Otherwise, you can
602 ** leave 'lua_strx2number' undefined and Lua will provide its own
603 ** implementation.
604 */
605 #if !defined(LUA_USE_C89)
606 #define lua_strx2number(s,p)	lua_str2number(s,p)
607 #endif
608 
609 
610 /*
611 @@ LUA_USE_AFORMAT allows '%a'/'%A' specifiers in 'string.format'
612 ** Enable it if the C function 'printf' supports these specifiers.
613 ** (C99 demands it and Windows also supports it.)
614 */
615 #if !defined(LUA_USE_C89) || defined(LUA_USE_WINDOWS)
616 #define LUA_USE_AFORMAT
617 #endif
618 
619 
620 /*
621 ** 'strtof' and 'opf' variants for math functions are not valid in
622 ** C89. Otherwise, the macro 'HUGE_VALF' is a good proxy for testing the
623 ** availability of these variants. ('math.h' is already included in
624 ** all files that use these macros.)
625 */
626 #if defined(LUA_USE_C89) || (defined(HUGE_VAL) && !defined(HUGE_VALF))
627 #undef l_mathop  /* variants not available */
628 #undef lua_str2number
629 #define l_mathop(op)		(lua_Number)op  /* no variant */
630 #define lua_str2number(s,p)	((lua_Number)strtod((s), (p)))
631 #endif
632 
633 
634 /*
635 @@ LUA_KCONTEXT is the type of the context ('ctx') for continuation
636 ** functions.  It must be a numerical type; Lua will use 'intptr_t' if
637 ** available, otherwise it will use 'ptrdiff_t' (the nearest thing to
638 ** 'intptr_t' in C89)
639 */
640 #define LUA_KCONTEXT	ptrdiff_t
641 
642 #if !defined(LUA_USE_C89) && defined(__STDC_VERSION__) && \
643     __STDC_VERSION__ >= 199901L
644 #include <stdint.h>
645 #if defined (INTPTR_MAX)  /* even in C99 this type is optional */
646 #undef LUA_KCONTEXT
647 #define LUA_KCONTEXT	intptr_t
648 #endif
649 #endif
650 
651 /* }================================================================== */
652 
653 
654 /*
655 ** {==================================================================
656 ** Macros that affect the API and must be stable (that is, must be the
657 ** same when you compile Lua and when you compile code that links to
658 ** Lua). You probably do not want/need to change them.
659 ** =====================================================================
660 */
661 
662 /*
663 @@ LUAI_MAXSTACK limits the size of the Lua stack.
664 ** CHANGE it if you need a different limit. This limit is arbitrary;
665 ** its only purpose is to stop Lua from consuming unlimited stack
666 ** space (and to reserve some numbers for pseudo-indices).
667 */
668 #if LUAI_BITSINT >= 32
669 #define LUAI_MAXSTACK		1000000
670 #else
671 #define LUAI_MAXSTACK		15000
672 #endif
673 
674 /* reserve some space for error handling */
675 #define LUAI_FIRSTPSEUDOIDX	(-LUAI_MAXSTACK - 1000)
676 
677 
678 /*
679 @@ LUA_EXTRASPACE defines the size of a raw memory area associated with
680 ** a Lua state with very fast access.
681 ** CHANGE it if you need a different size.
682 */
683 #define LUA_EXTRASPACE		(sizeof(void *))
684 
685 
686 /*
687 @@ LUA_IDSIZE gives the maximum size for the description of the source
688 @@ of a function in debug information.
689 ** CHANGE it if you want a different size.
690 */
691 #define LUA_IDSIZE	60
692 
693 
694 /*
695 @@ LUAI_MAXSHORTLEN is the maximum length for short strings, that is,
696 ** strings that are internalized. (Cannot be smaller than reserved words
697 ** or tags for metamethods, as these strings must be internalized;
698 ** #("function") = 8, #("__newindex") = 10.)
699 */
700 #define LUAI_MAXSHORTLEN        40
701 
702 
703 /*
704 @@ LUAL_BUFFERSIZE is the buffer size used by the lauxlib buffer system.
705 ** CHANGE it if it uses too much C-stack space.
706 */
707 #define LUAL_BUFFERSIZE	((int)(0x80 * sizeof(void*) * sizeof(lua_Integer)))
708 
709 /* }================================================================== */
710 
711 
712 /*
713 @@ LUA_QL describes how error messages quote program elements.
714 ** Lua does not use these macros anymore; they are here for
715 ** compatibility only.
716 */
717 #define LUA_QL(x)	"'" x "'"
718 #define LUA_QS		LUA_QL("%s")
719 
720 
721 
722 
723 /* =================================================================== */
724 
725 /*
726 ** Local configuration. You can use this space to add your redefinitions
727 ** without modifying the main part of the file.
728 */
729 
730 
731 
732 
733 
734 #endif
735 
736