xref: /freebsd/contrib/lua/src/luaconf.h.dist (revision 02e9120893770924227138ba49df1edb3896112a)
1/*
2** $Id: luaconf.h $
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** General Configuration File for Lua
18**
19** Some definitions here can be changed externally, through the compiler
20** (e.g., with '-D' options): They are commented out or protected
21** by '#if !defined' guards. However, several other definitions
22** should be changed directly here, either because they affect the
23** Lua ABI (by making the changes here, you ensure that all software
24** connected to Lua, such as C libraries, will be compiled with the same
25** configuration); or because they are seldom changed.
26**
27** Search for "@@" to find all configurable definitions.
28** ===================================================================
29*/
30
31
32/*
33** {====================================================================
34** System Configuration: macros to adapt (if needed) Lua to some
35** particular platform, for instance restricting it to C89.
36** =====================================================================
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#endif
65
66
67#if defined(LUA_USE_MACOSX)
68#define LUA_USE_POSIX
69#define LUA_USE_DLOPEN		/* MacOS does not need -ldl */
70#endif
71
72
73/*
74@@ LUAI_IS32INT is true iff 'int' has (at least) 32 bits.
75*/
76#define LUAI_IS32INT	((UINT_MAX >> 30) >= 3)
77
78/* }================================================================== */
79
80
81
82/*
83** {==================================================================
84** Configuration for Number types. These options should not be
85** set externally, because any other code connected to Lua must
86** use the same configuration.
87** ===================================================================
88*/
89
90/*
91@@ LUA_INT_TYPE defines the type for Lua integers.
92@@ LUA_FLOAT_TYPE defines the type for Lua floats.
93** Lua should work fine with any mix of these options supported
94** by your C compiler. The usual configurations are 64-bit integers
95** and 'double' (the default), 32-bit integers and 'float' (for
96** restricted platforms), and 'long'/'double' (for C compilers not
97** compliant with C99, which may not have support for 'long long').
98*/
99
100/* predefined options for LUA_INT_TYPE */
101#define LUA_INT_INT		1
102#define LUA_INT_LONG		2
103#define LUA_INT_LONGLONG	3
104
105/* predefined options for LUA_FLOAT_TYPE */
106#define LUA_FLOAT_FLOAT		1
107#define LUA_FLOAT_DOUBLE	2
108#define LUA_FLOAT_LONGDOUBLE	3
109#define LUA_FLOAT_INT64		4
110
111
112/* Default configuration ('long long' and 'double', for 64-bit Lua) */
113#define LUA_INT_DEFAULT		LUA_INT_LONGLONG
114#define LUA_FLOAT_DEFAULT	LUA_FLOAT_DOUBLE
115
116
117/*
118@@ LUA_32BITS enables Lua with 32-bit integers and 32-bit floats.
119*/
120#define LUA_32BITS	0
121
122
123/*
124@@ LUA_C89_NUMBERS ensures that Lua uses the largest types available for
125** C89 ('long' and 'double'); Windows always has '__int64', so it does
126** not need to use this case.
127*/
128#if defined(LUA_USE_C89) && !defined(LUA_USE_WINDOWS)
129#define LUA_C89_NUMBERS		1
130#else
131#define LUA_C89_NUMBERS		0
132#endif
133
134
135#if LUA_32BITS		/* { */
136/*
137** 32-bit integers and 'float'
138*/
139#if LUAI_IS32INT  /* use 'int' if big enough */
140#define LUA_INT_TYPE	LUA_INT_INT
141#else  /* otherwise use 'long' */
142#define LUA_INT_TYPE	LUA_INT_LONG
143#endif
144#define LUA_FLOAT_TYPE	LUA_FLOAT_FLOAT
145
146#elif LUA_C89_NUMBERS	/* }{ */
147/*
148** largest types available for C89 ('long' and 'double')
149*/
150#define LUA_INT_TYPE	LUA_INT_LONG
151#define LUA_FLOAT_TYPE	LUA_FLOAT_DOUBLE
152
153#else		/* }{ */
154/* use defaults */
155
156#define LUA_INT_TYPE	LUA_INT_DEFAULT
157#define LUA_FLOAT_TYPE	LUA_FLOAT_DEFAULT
158
159#endif				/* } */
160
161
162/* }================================================================== */
163
164
165
166/*
167** {==================================================================
168** Configuration for Paths.
169** ===================================================================
170*/
171
172/*
173** LUA_PATH_SEP is the character that separates templates in a path.
174** LUA_PATH_MARK is the string that marks the substitution points in a
175** template.
176** LUA_EXEC_DIR in a Windows path is replaced by the executable's
177** directory.
178*/
179#define LUA_PATH_SEP            ";"
180#define LUA_PATH_MARK           "?"
181#define LUA_EXEC_DIR            "!"
182
183
184/*
185@@ LUA_PATH_DEFAULT is the default path that Lua uses to look for
186** Lua libraries.
187@@ LUA_CPATH_DEFAULT is the default path that Lua uses to look for
188** C libraries.
189** CHANGE them if your machine has a non-conventional directory
190** hierarchy or if you want to install your libraries in
191** non-conventional directories.
192*/
193
194#define LUA_VDIR	LUA_VERSION_MAJOR "." LUA_VERSION_MINOR
195#if defined(_WIN32)	/* { */
196/*
197** In Windows, any exclamation mark ('!') in the path is replaced by the
198** path of the directory of the executable file of the current process.
199*/
200#define LUA_LDIR	"!\\lua\\"
201#define LUA_CDIR	"!\\"
202#define LUA_SHRDIR	"!\\..\\share\\lua\\" LUA_VDIR "\\"
203
204#if !defined(LUA_PATH_DEFAULT)
205#define LUA_PATH_DEFAULT  \
206		LUA_LDIR"?.lua;"  LUA_LDIR"?\\init.lua;" \
207		LUA_CDIR"?.lua;"  LUA_CDIR"?\\init.lua;" \
208		LUA_SHRDIR"?.lua;" LUA_SHRDIR"?\\init.lua;" \
209		".\\?.lua;" ".\\?\\init.lua"
210#endif
211
212#if !defined(LUA_CPATH_DEFAULT)
213#define LUA_CPATH_DEFAULT \
214		LUA_CDIR"?.dll;" \
215		LUA_CDIR"..\\lib\\lua\\" LUA_VDIR "\\?.dll;" \
216		LUA_CDIR"loadall.dll;" ".\\?.dll"
217#endif
218
219#else			/* }{ */
220
221#define LUA_ROOT	"/usr/local/"
222#define LUA_LDIR	LUA_ROOT "share/lua/" LUA_VDIR "/"
223#define LUA_CDIR	LUA_ROOT "lib/lua/" LUA_VDIR "/"
224
225#if !defined(LUA_PATH_DEFAULT)
226#define LUA_PATH_DEFAULT  \
227		LUA_LDIR"?.lua;"  LUA_LDIR"?/init.lua;" \
228		LUA_CDIR"?.lua;"  LUA_CDIR"?/init.lua;" \
229		"./?.lua;" "./?/init.lua"
230#endif
231
232#if !defined(LUA_CPATH_DEFAULT)
233#define LUA_CPATH_DEFAULT \
234		LUA_CDIR"?.so;" LUA_CDIR"loadall.so;" "./?.so"
235#endif
236
237#endif			/* } */
238
239
240/*
241@@ LUA_DIRSEP is the directory separator (for submodules).
242** CHANGE it if your machine does not use "/" as the directory separator
243** and is not Windows. (On Windows Lua automatically uses "\".)
244*/
245#if !defined(LUA_DIRSEP)
246
247#if defined(_WIN32)
248#define LUA_DIRSEP	"\\"
249#else
250#define LUA_DIRSEP	"/"
251#endif
252
253#endif
254
255/* }================================================================== */
256
257
258/*
259** {==================================================================
260** Marks for exported symbols in the C code
261** ===================================================================
262*/
263
264/*
265@@ LUA_API is a mark for all core API functions.
266@@ LUALIB_API is a mark for all auxiliary library functions.
267@@ LUAMOD_API is a mark for all standard library opening functions.
268** CHANGE them if you need to define those functions in some special way.
269** For instance, if you want to create one Windows DLL with the core and
270** the libraries, you may want to use the following definition (define
271** LUA_BUILD_AS_DLL to get it).
272*/
273#if defined(LUA_BUILD_AS_DLL)	/* { */
274
275#if defined(LUA_CORE) || defined(LUA_LIB)	/* { */
276#define LUA_API __declspec(dllexport)
277#else						/* }{ */
278#define LUA_API __declspec(dllimport)
279#endif						/* } */
280
281#else				/* }{ */
282
283#define LUA_API		extern
284
285#endif				/* } */
286
287
288/*
289** More often than not the libs go together with the core.
290*/
291#define LUALIB_API	LUA_API
292#define LUAMOD_API	LUA_API
293
294
295/*
296@@ LUAI_FUNC is a mark for all extern functions that are not to be
297** exported to outside modules.
298@@ LUAI_DDEF and LUAI_DDEC are marks for all extern (const) variables,
299** none of which to be exported to outside modules (LUAI_DDEF for
300** definitions and LUAI_DDEC for declarations).
301** CHANGE them if you need to mark them in some special way. Elf/gcc
302** (versions 3.2 and later) mark them as "hidden" to optimize access
303** when Lua is compiled as a shared library. Not all elf targets support
304** this attribute. Unfortunately, gcc does not offer a way to check
305** whether the target offers that support, and those without support
306** give a warning about it. To avoid these warnings, change to the
307** default definition.
308*/
309#if defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 302) && \
310    defined(__ELF__)		/* { */
311#define LUAI_FUNC	__attribute__((visibility("internal"))) extern
312#else				/* }{ */
313#define LUAI_FUNC	extern
314#endif				/* } */
315
316#define LUAI_DDEC(dec)	LUAI_FUNC dec
317#define LUAI_DDEF	/* empty */
318
319/* }================================================================== */
320
321
322/*
323** {==================================================================
324** Compatibility with previous versions
325** ===================================================================
326*/
327
328/*
329@@ LUA_COMPAT_5_3 controls other macros for compatibility with Lua 5.3.
330** You can define it to get all options, or change specific options
331** to fit your specific needs.
332*/
333#if defined(LUA_COMPAT_5_3)	/* { */
334
335/*
336@@ LUA_COMPAT_MATHLIB controls the presence of several deprecated
337** functions in the mathematical library.
338** (These functions were already officially removed in 5.3;
339** nevertheless they are still available here.)
340*/
341#define LUA_COMPAT_MATHLIB
342
343/*
344@@ LUA_COMPAT_APIINTCASTS controls the presence of macros for
345** manipulating other integer types (lua_pushunsigned, lua_tounsigned,
346** luaL_checkint, luaL_checklong, etc.)
347** (These macros were also officially removed in 5.3, but they are still
348** available here.)
349*/
350#define LUA_COMPAT_APIINTCASTS
351
352
353/*
354@@ LUA_COMPAT_LT_LE controls the emulation of the '__le' metamethod
355** using '__lt'.
356*/
357#define LUA_COMPAT_LT_LE
358
359
360/*
361@@ The following macros supply trivial compatibility for some
362** changes in the API. The macros themselves document how to
363** change your code to avoid using them.
364** (Once more, these macros were officially removed in 5.3, but they are
365** still available here.)
366*/
367#define lua_strlen(L,i)		lua_rawlen(L, (i))
368
369#define lua_objlen(L,i)		lua_rawlen(L, (i))
370
371#define lua_equal(L,idx1,idx2)		lua_compare(L,(idx1),(idx2),LUA_OPEQ)
372#define lua_lessthan(L,idx1,idx2)	lua_compare(L,(idx1),(idx2),LUA_OPLT)
373
374#endif				/* } */
375
376/* }================================================================== */
377
378
379
380/*
381** {==================================================================
382** Configuration for Numbers (low-level part).
383** Change these definitions if no predefined LUA_FLOAT_* / LUA_INT_*
384** satisfy your needs.
385** ===================================================================
386*/
387
388/*
389@@ LUAI_UACNUMBER is the result of a 'default argument promotion'
390@@ over a floating number.
391@@ l_floatatt(x) corrects float attribute 'x' to the proper float type
392** by prefixing it with one of FLT/DBL/LDBL.
393@@ LUA_NUMBER_FRMLEN is the length modifier for writing floats.
394@@ LUA_NUMBER_FMT is the format for writing floats.
395@@ lua_number2str converts a float to a string.
396@@ l_mathop allows the addition of an 'l' or 'f' to all math operations.
397@@ l_floor takes the floor of a float.
398@@ lua_str2number converts a decimal numeral to a number.
399*/
400
401
402/* The following definitions are good for most cases here */
403
404#define l_floor(x)		(l_mathop(floor)(x))
405
406#define lua_number2str(s,sz,n)  \
407	l_sprintf((s), sz, LUA_NUMBER_FMT, (LUAI_UACNUMBER)(n))
408
409/*
410@@ lua_numbertointeger converts a float number with an integral value
411** to an integer, or returns 0 if float is not within the range of
412** a lua_Integer.  (The range comparisons are tricky because of
413** rounding. The tests here assume a two-complement representation,
414** where MININTEGER always has an exact representation as a float;
415** MAXINTEGER may not have one, and therefore its conversion to float
416** may have an ill-defined value.)
417*/
418#define lua_numbertointeger(n,p) \
419  ((n) >= (LUA_NUMBER)(LUA_MININTEGER) && \
420   (n) < -(LUA_NUMBER)(LUA_MININTEGER) && \
421      (*(p) = (LUA_INTEGER)(n), 1))
422
423
424/* now the variable definitions */
425
426#if LUA_FLOAT_TYPE == LUA_FLOAT_FLOAT		/* { single float */
427
428#define LUA_NUMBER	float
429
430#define l_floatatt(n)		(FLT_##n)
431
432#define LUAI_UACNUMBER	double
433
434#define LUA_NUMBER_FRMLEN	""
435#define LUA_NUMBER_FMT		"%.7g"
436
437#define l_mathop(op)		op##f
438
439#define lua_str2number(s,p)	strtof((s), (p))
440
441
442#elif LUA_FLOAT_TYPE == LUA_FLOAT_LONGDOUBLE	/* }{ long double */
443
444#define LUA_NUMBER	long double
445
446#define l_floatatt(n)		(LDBL_##n)
447
448#define LUAI_UACNUMBER	long double
449
450#define LUA_NUMBER_FRMLEN	"L"
451#define LUA_NUMBER_FMT		"%.19Lg"
452
453#define l_mathop(op)		op##l
454
455#define lua_str2number(s,p)	strtold((s), (p))
456
457#elif LUA_FLOAT_TYPE == LUA_FLOAT_DOUBLE	/* }{ double */
458
459#define LUA_NUMBER	double
460
461#define l_floatatt(n)		(DBL_##n)
462
463#define LUAI_UACNUMBER	double
464
465#define LUA_NUMBER_FRMLEN	""
466#define LUA_NUMBER_FMT		"%.14g"
467
468#define l_mathop(op)		op
469
470#define lua_str2number(s,p)	strtod((s), (p))
471
472#else						/* }{ */
473
474#error "numeric float type not defined"
475
476#endif					/* } */
477
478
479
480/*
481@@ LUA_UNSIGNED is the unsigned version of LUA_INTEGER.
482@@ LUAI_UACINT is the result of a 'default argument promotion'
483@@ over a LUA_INTEGER.
484@@ LUA_INTEGER_FRMLEN is the length modifier for reading/writing integers.
485@@ LUA_INTEGER_FMT is the format for writing integers.
486@@ LUA_MAXINTEGER is the maximum value for a LUA_INTEGER.
487@@ LUA_MININTEGER is the minimum value for a LUA_INTEGER.
488@@ LUA_MAXUNSIGNED is the maximum value for a LUA_UNSIGNED.
489@@ lua_integer2str converts an integer to a string.
490*/
491
492
493/* The following definitions are good for most cases here */
494
495#define LUA_INTEGER_FMT		"%" LUA_INTEGER_FRMLEN "d"
496
497#define LUAI_UACINT		LUA_INTEGER
498
499#define lua_integer2str(s,sz,n)  \
500	l_sprintf((s), sz, LUA_INTEGER_FMT, (LUAI_UACINT)(n))
501
502/*
503** use LUAI_UACINT here to avoid problems with promotions (which
504** can turn a comparison between unsigneds into a signed comparison)
505*/
506#define LUA_UNSIGNED		unsigned LUAI_UACINT
507
508
509/* now the variable definitions */
510
511#if LUA_INT_TYPE == LUA_INT_INT		/* { int */
512
513#define LUA_INTEGER		int
514#define LUA_INTEGER_FRMLEN	""
515
516#define LUA_MAXINTEGER		INT_MAX
517#define LUA_MININTEGER		INT_MIN
518
519#define LUA_MAXUNSIGNED		UINT_MAX
520
521#elif LUA_INT_TYPE == LUA_INT_LONG	/* }{ long */
522
523#define LUA_INTEGER		long
524#define LUA_INTEGER_FRMLEN	"l"
525
526#define LUA_MAXINTEGER		LONG_MAX
527#define LUA_MININTEGER		LONG_MIN
528
529#define LUA_MAXUNSIGNED		ULONG_MAX
530
531#elif LUA_INT_TYPE == LUA_INT_LONGLONG	/* }{ long long */
532
533/* use presence of macro LLONG_MAX as proxy for C99 compliance */
534#if defined(LLONG_MAX)		/* { */
535/* use ISO C99 stuff */
536
537#define LUA_INTEGER		long long
538#define LUA_INTEGER_FRMLEN	"ll"
539
540#define LUA_MAXINTEGER		LLONG_MAX
541#define LUA_MININTEGER		LLONG_MIN
542
543#define LUA_MAXUNSIGNED		ULLONG_MAX
544
545#elif defined(LUA_USE_WINDOWS) /* }{ */
546/* in Windows, can use specific Windows types */
547
548#define LUA_INTEGER		__int64
549#define LUA_INTEGER_FRMLEN	"I64"
550
551#define LUA_MAXINTEGER		_I64_MAX
552#define LUA_MININTEGER		_I64_MIN
553
554#define LUA_MAXUNSIGNED		_UI64_MAX
555
556#else				/* }{ */
557
558#error "Compiler does not support 'long long'. Use option '-DLUA_32BITS' \
559  or '-DLUA_C89_NUMBERS' (see file 'luaconf.h' for details)"
560
561#endif				/* } */
562
563#else				/* }{ */
564
565#error "numeric integer type not defined"
566
567#endif				/* } */
568
569/* }================================================================== */
570
571
572/*
573** {==================================================================
574** Dependencies with C99 and other C details
575** ===================================================================
576*/
577
578/*
579@@ l_sprintf is equivalent to 'snprintf' or 'sprintf' in C89.
580** (All uses in Lua have only one format item.)
581*/
582#if !defined(LUA_USE_C89)
583#define l_sprintf(s,sz,f,i)	snprintf(s,sz,f,i)
584#else
585#define l_sprintf(s,sz,f,i)	((void)(sz), sprintf(s,f,i))
586#endif
587
588
589/*
590@@ lua_strx2number converts a hexadecimal numeral to a number.
591** In C99, 'strtod' does that conversion. Otherwise, you can
592** leave 'lua_strx2number' undefined and Lua will provide its own
593** implementation.
594*/
595#if !defined(LUA_USE_C89)
596#define lua_strx2number(s,p)		lua_str2number(s,p)
597#endif
598
599
600/*
601@@ lua_pointer2str converts a pointer to a readable string in a
602** non-specified way.
603*/
604#define lua_pointer2str(buff,sz,p)	l_sprintf(buff,sz,"%p",p)
605
606
607/*
608@@ lua_number2strx converts a float to a hexadecimal numeral.
609** In C99, 'sprintf' (with format specifiers '%a'/'%A') does that.
610** Otherwise, you can leave 'lua_number2strx' undefined and Lua will
611** provide its own implementation.
612*/
613#if !defined(LUA_USE_C89)
614#define lua_number2strx(L,b,sz,f,n)  \
615	((void)L, l_sprintf(b,sz,f,(LUAI_UACNUMBER)(n)))
616#endif
617
618
619/*
620** 'strtof' and 'opf' variants for math functions are not valid in
621** C89. Otherwise, the macro 'HUGE_VALF' is a good proxy for testing the
622** availability of these variants. ('math.h' is already included in
623** all files that use these macros.)
624*/
625#if defined(LUA_USE_C89) || (defined(HUGE_VAL) && !defined(HUGE_VALF))
626#undef l_mathop  /* variants not available */
627#undef lua_str2number
628#define l_mathop(op)		(lua_Number)op  /* no variant */
629#define lua_str2number(s,p)	((lua_Number)strtod((s), (p)))
630#endif
631
632
633/*
634@@ LUA_KCONTEXT is the type of the context ('ctx') for continuation
635** functions.  It must be a numerical type; Lua will use 'intptr_t' if
636** available, otherwise it will use 'ptrdiff_t' (the nearest thing to
637** 'intptr_t' in C89)
638*/
639#define LUA_KCONTEXT	ptrdiff_t
640
641#if !defined(LUA_USE_C89) && defined(__STDC_VERSION__) && \
642    __STDC_VERSION__ >= 199901L
643#include <stdint.h>
644#if defined(INTPTR_MAX)  /* even in C99 this type is optional */
645#undef LUA_KCONTEXT
646#define LUA_KCONTEXT	intptr_t
647#endif
648#endif
649
650
651/*
652@@ lua_getlocaledecpoint gets the locale "radix character" (decimal point).
653** Change that if you do not want to use C locales. (Code using this
654** macro must include the header 'locale.h'.)
655*/
656#if !defined(lua_getlocaledecpoint)
657#define lua_getlocaledecpoint()		(localeconv()->decimal_point[0])
658#endif
659
660
661/*
662** macros to improve jump prediction, used mostly for error handling
663** and debug facilities. (Some macros in the Lua API use these macros.
664** Define LUA_NOBUILTIN if you do not want '__builtin_expect' in your
665** code.)
666*/
667#if !defined(luai_likely)
668
669#if defined(__GNUC__) && !defined(LUA_NOBUILTIN)
670#define luai_likely(x)		(__builtin_expect(((x) != 0), 1))
671#define luai_unlikely(x)	(__builtin_expect(((x) != 0), 0))
672#else
673#define luai_likely(x)		(x)
674#define luai_unlikely(x)	(x)
675#endif
676
677#endif
678
679
680#if defined(LUA_CORE) || defined(LUA_LIB)
681/* shorter names for Lua's own use */
682#define l_likely(x)	luai_likely(x)
683#define l_unlikely(x)	luai_unlikely(x)
684#endif
685
686
687
688/* }================================================================== */
689
690
691/*
692** {==================================================================
693** Language Variations
694** =====================================================================
695*/
696
697/*
698@@ LUA_NOCVTN2S/LUA_NOCVTS2N control how Lua performs some
699** coercions. Define LUA_NOCVTN2S to turn off automatic coercion from
700** numbers to strings. Define LUA_NOCVTS2N to turn off automatic
701** coercion from strings to numbers.
702*/
703/* #define LUA_NOCVTN2S */
704/* #define LUA_NOCVTS2N */
705
706
707/*
708@@ LUA_USE_APICHECK turns on several consistency checks on the C API.
709** Define it as a help when debugging C code.
710*/
711#if defined(LUA_USE_APICHECK)
712#include <assert.h>
713#define luai_apicheck(l,e)	assert(e)
714#endif
715
716/* }================================================================== */
717
718
719/*
720** {==================================================================
721** Macros that affect the API and must be stable (that is, must be the
722** same when you compile Lua and when you compile code that links to
723** Lua).
724** =====================================================================
725*/
726
727/*
728@@ LUAI_MAXSTACK limits the size of the Lua stack.
729** CHANGE it if you need a different limit. This limit is arbitrary;
730** its only purpose is to stop Lua from consuming unlimited stack
731** space (and to reserve some numbers for pseudo-indices).
732** (It must fit into max(size_t)/32.)
733*/
734#if LUAI_IS32INT
735#define LUAI_MAXSTACK		1000000
736#else
737#define LUAI_MAXSTACK		15000
738#endif
739
740
741/*
742@@ LUA_EXTRASPACE defines the size of a raw memory area associated with
743** a Lua state with very fast access.
744** CHANGE it if you need a different size.
745*/
746#define LUA_EXTRASPACE		(sizeof(void *))
747
748
749/*
750@@ LUA_IDSIZE gives the maximum size for the description of the source
751@@ of a function in debug information.
752** CHANGE it if you want a different size.
753*/
754#define LUA_IDSIZE	60
755
756
757/*
758@@ LUAL_BUFFERSIZE is the buffer size used by the lauxlib buffer system.
759*/
760#define LUAL_BUFFERSIZE   ((int)(16 * sizeof(void*) * sizeof(lua_Number)))
761
762
763/*
764@@ LUAI_MAXALIGN defines fields that, when used in a union, ensure
765** maximum alignment for the other items in that union.
766*/
767#define LUAI_MAXALIGN  lua_Number n; double u; void *s; lua_Integer i; long l
768
769/* }================================================================== */
770
771
772
773
774
775/* =================================================================== */
776
777/*
778** Local configuration. You can use this space to add your redefinitions
779** without modifying the main part of the file.
780*/
781
782
783
784
785
786#endif
787
788