luaconf.h 20.1 KB
Newer Older
1
/*
2
** $Id: luaconf.h,v 1.251 2015/05/20 17:39:23 roberto Exp $
3 4 5 6 7
** Configuration file for Lua
** See Copyright Notice in lua.h
*/


8 9
#ifndef luaconf_h
#define luaconf_h
10 11 12 13 14 15

#include <limits.h>
#include <stddef.h>


/*
16
** ===================================================================
17 18 19 20 21 22
** Search for "@@" to find all configurable definitions.
** ===================================================================
*/


/*
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
** {====================================================================
** System Configuration: macros to adapt (if needed) Lua to some
** particular platform, for instance compiling it with 32-bit numbers or
** restricting it to C89.
** =====================================================================
*/

/*
@@ LUA_32BITS enables Lua with 32-bit integers and 32-bit floats. You
** can also define LUA_32BITS in the make file, but changing here you
** ensure that all software connected to Lua will be compiled with the
** same configuration.
*/
/* #define LUA_32BITS */


/*
@@ LUA_USE_C89 controls the use of non-ISO-C89 features.
** Define it if you want Lua to avoid the use of a few C99 features
** or Windows-specific features on Windows.
43
*/
44 45 46 47 48 49 50 51
/* #define LUA_USE_C89 */


/*
** By default, Lua on Windows use (some) specific Windows features
*/
#if !defined(LUA_USE_C89) && defined(_WIN32) && !defined(_WIN32_WCE)
#define LUA_USE_WINDOWS  /* enable goodies for regular Windows */
52 53 54
#endif


55 56 57
#if defined(LUA_USE_WINDOWS)
#define LUA_DL_DLL	/* enable support for DLL */
#define LUA_USE_C89	/* broadly, Windows is C89 */
58 59
#endif

60

61 62 63 64 65 66
#if defined(LUA_USE_LINUX)
#define LUA_USE_POSIX
#define LUA_USE_DLOPEN		/* needs an extra library: -ldl */
#define LUA_USE_READLINE	/* needs some extra libraries */
#endif

67

68 69
#if defined(LUA_USE_MACOSX)
#define LUA_USE_POSIX
70 71
#define LUA_USE_DLOPEN		/* MacOS does not need -ldl */
#define LUA_USE_READLINE	/* needs an extra library: -lreadline */
72 73 74
#endif


75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
/*
@@ LUA_C89_NUMBERS ensures that Lua uses the largest types available for
** C89 ('long' and 'double'); Windows always has '__int64', so it does
** not need to use this case.
*/
#if defined(LUA_USE_C89) && !defined(LUA_USE_WINDOWS)
#define LUA_C89_NUMBERS
#endif



/*
@@ LUAI_BITSINT defines the (minimum) number of bits in an 'int'.
*/
/* avoid undefined shifts */
#if ((INT_MAX >> 15) >> 15) >= 1
#define LUAI_BITSINT	32
#else
/* 'int' always must have at least 16 bits */
#define LUAI_BITSINT	16
#endif


/*
@@ LUA_INT_TYPE defines the type for Lua integers.
@@ LUA_FLOAT_TYPE defines the type for Lua floats.
** Lua should work fine with any mix of these options (if supported
** by your C compiler). The usual configurations are 64-bit integers
** and 'double' (the default), 32-bit integers and 'float' (for
** restricted platforms), and 'long'/'double' (for C compilers not
** compliant with C99, which may not have support for 'long long').
*/

/* predefined options for LUA_INT_TYPE */
#define LUA_INT_INT		1
#define LUA_INT_LONG		2
#define LUA_INT_LONGLONG	3
112

113 114 115 116 117 118
/* predefined options for LUA_FLOAT_TYPE */
#define LUA_FLOAT_FLOAT		1
#define LUA_FLOAT_DOUBLE	2
#define LUA_FLOAT_LONGDOUBLE	3

#if defined(LUA_32BITS)		/* { */
119
/*
120
** 32-bit integers and 'float'
121
*/
122 123 124 125
#if LUAI_BITSINT >= 32  /* use 'int' if big enough */
#define LUA_INT_TYPE	LUA_INT_INT
#else  /* otherwise use 'long' */
#define LUA_INT_TYPE	LUA_INT_LONG
126
#endif
127 128 129 130 131 132 133 134 135 136
#define LUA_FLOAT_TYPE	LUA_FLOAT_FLOAT

#elif defined(LUA_C89_NUMBERS)	/* }{ */
/*
** largest types available for C89 ('long' and 'double')
*/
#define LUA_INT_TYPE	LUA_INT_LONG
#define LUA_FLOAT_TYPE	LUA_FLOAT_DOUBLE

#endif				/* } */
137 138 139


/*
140
** default configuration for 64-bit Lua ('long long' and 'double')
141
*/
142 143 144 145 146 147 148 149 150 151 152
#if !defined(LUA_INT_TYPE)
#define LUA_INT_TYPE	LUA_INT_LONGLONG
#endif

#if !defined(LUA_FLOAT_TYPE)
#define LUA_FLOAT_TYPE	LUA_FLOAT_DOUBLE
#endif								/* } */

/* }================================================================== */


153 154


155 156 157 158 159 160
/*
** {==================================================================
** Configuration for Paths.
** ===================================================================
*/

161 162
/*
@@ LUA_PATH_DEFAULT is the default path that Lua uses to look for
163
** Lua libraries.
164
@@ LUA_CPATH_DEFAULT is the default path that Lua uses to look for
165
** C libraries.
166 167 168 169
** CHANGE them if your machine has a non-conventional directory
** hierarchy or if you want to install your libraries in
** non-conventional directories.
*/
170 171
#define LUA_VDIR	LUA_VERSION_MAJOR "." LUA_VERSION_MINOR
#if defined(_WIN32)	/* { */
172 173 174 175 176 177
/*
** In Windows, any exclamation mark ('!') in the path is replaced by the
** path of the directory of the executable file of the current process.
*/
#define LUA_LDIR	"!\\lua\\"
#define LUA_CDIR	"!\\"
178
#define LUA_SHRDIR	"!\\..\\share\\lua\\" LUA_VDIR "\\"
179
#define LUA_PATH_DEFAULT  \
180 181 182 183
		LUA_LDIR"?.lua;"  LUA_LDIR"?\\init.lua;" \
		LUA_CDIR"?.lua;"  LUA_CDIR"?\\init.lua;" \
		LUA_SHRDIR"?.lua;" LUA_SHRDIR"?\\init.lua;" \
		".\\?.lua;" ".\\?\\init.lua"
184
#define LUA_CPATH_DEFAULT \
185 186 187 188 189
		LUA_CDIR"?.dll;" \
		LUA_CDIR"..\\lib\\lua\\" LUA_VDIR "\\?.dll;" \
		LUA_CDIR"loadall.dll;" ".\\?.dll"

#else			/* }{ */
190 191

#define LUA_ROOT	"/usr/local/"
192 193
#define LUA_LDIR	LUA_ROOT "share/lua/" LUA_VDIR "/"
#define LUA_CDIR	LUA_ROOT "lib/lua/" LUA_VDIR "/"
194
#define LUA_PATH_DEFAULT  \
195 196 197
		LUA_LDIR"?.lua;"  LUA_LDIR"?/init.lua;" \
		LUA_CDIR"?.lua;"  LUA_CDIR"?/init.lua;" \
		"./?.lua;" "./?/init.lua"
198
#define LUA_CPATH_DEFAULT \
199 200
		LUA_CDIR"?.so;" LUA_CDIR"loadall.so;" "./?.so"
#endif			/* } */
201 202 203 204 205 206 207 208 209 210 211 212 213


/*
@@ LUA_DIRSEP is the directory separator (for submodules).
** CHANGE it if your machine does not use "/" as the directory separator
** and is not Windows. (On Windows Lua automatically uses "\".)
*/
#if defined(_WIN32)
#define LUA_DIRSEP	"\\"
#else
#define LUA_DIRSEP	"/"
#endif

214
/* }================================================================== */
215 216 217


/*
218 219 220
** {==================================================================
** Marks for exported symbols in the C code
** ===================================================================
221 222 223 224
*/

/*
@@ LUA_API is a mark for all core API functions.
225 226
@@ LUALIB_API is a mark for all auxiliary library functions.
@@ LUAMOD_API is a mark for all standard library opening functions.
227 228 229 230 231
** CHANGE them if you need to define those functions in some special way.
** For instance, if you want to create one Windows DLL with the core and
** the libraries, you may want to use the following definition (define
** LUA_BUILD_AS_DLL to get it).
*/
232
#if defined(LUA_BUILD_AS_DLL)	/* { */
233

234
#if defined(LUA_CORE) || defined(LUA_LIB)	/* { */
235
#define LUA_API __declspec(dllexport)
236
#else						/* }{ */
237
#define LUA_API __declspec(dllimport)
238
#endif						/* } */
239

240
#else				/* }{ */
241 242 243

#define LUA_API		extern

244 245
#endif				/* } */

246 247 248

/* more often than not the libs go together with the core */
#define LUALIB_API	LUA_API
249
#define LUAMOD_API	LUALIB_API
250 251 252 253


/*
@@ LUAI_FUNC is a mark for all extern functions that are not to be
254 255 256 257
** exported to outside modules.
@@ LUAI_DDEF and LUAI_DDEC are marks for all extern (const) variables
** that are not to be exported to outside modules (LUAI_DDEF for
** definitions and LUAI_DDEC for declarations).
258 259
** CHANGE them if you need to mark them in some special way. Elf/gcc
** (versions 3.2 and later) mark them as "hidden" to optimize access
260 261 262 263 264 265 266 267
** when Lua is compiled as a shared library. Not all elf targets support
** this attribute. Unfortunately, gcc does not offer a way to check
** whether the target offers that support, and those without support
** give a warning about it. To avoid these warnings, change to the
** default definition.
*/
#if defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 302) && \
    defined(__ELF__)		/* { */
268
#define LUAI_FUNC	__attribute__((visibility("hidden"))) extern
269
#else				/* }{ */
270
#define LUAI_FUNC	extern
271
#endif				/* } */
272

273 274
#define LUAI_DDEC	LUAI_FUNC
#define LUAI_DDEF	/* empty */
275

276
/* }================================================================== */
277 278 279 280


/*
** {==================================================================
281
** Compatibility with previous versions
282 283 284 285
** ===================================================================
*/

/*
286 287 288 289
@@ LUA_COMPAT_5_2 controls other macros for compatibility with Lua 5.2.
@@ LUA_COMPAT_5_1 controls other macros for compatibility with Lua 5.1.
** You can define it to get all options, or change specific options
** to fit your specific needs.
290
*/
291
#if defined(LUA_COMPAT_5_2)	/* { */
292 293

/*
294 295
@@ LUA_COMPAT_MATHLIB controls the presence of several deprecated
** functions in the mathematical library.
296
*/
297
#define LUA_COMPAT_MATHLIB
298 299

/*
300
@@ LUA_COMPAT_BITLIB controls the presence of library 'bit32'.
301
*/
302
#define LUA_COMPAT_BITLIB
303 304

/*
305
@@ LUA_COMPAT_IPAIRS controls the effectiveness of the __ipairs metamethod.
306
*/
307
#define LUA_COMPAT_IPAIRS
308 309

/*
310 311 312
@@ LUA_COMPAT_APIINTCASTS controls the presence of macros for
** manipulating other integer types (lua_pushunsigned, lua_tounsigned,
** luaL_checkint, luaL_checklong, etc.)
313
*/
314
#define LUA_COMPAT_APIINTCASTS
315

316
#endif				/* } */
317 318


319
#if defined(LUA_COMPAT_5_1)	/* { */
320

321 322 323
/* Incompatibilities from 5.2 -> 5.3 */
#define LUA_COMPAT_MATHLIB
#define LUA_COMPAT_APIINTCASTS
324 325

/*
326 327
@@ LUA_COMPAT_UNPACK controls the presence of global 'unpack'.
** You can replace it with 'table.unpack'.
328
*/
329
#define LUA_COMPAT_UNPACK
330 331

/*
332 333
@@ LUA_COMPAT_LOADERS controls the presence of table 'package.loaders'.
** You can replace it with 'package.searchers'.
334
*/
335
#define LUA_COMPAT_LOADERS
336 337

/*
338 339
@@ macro 'lua_cpcall' emulates deprecated function lua_cpcall.
** You can call your C function directly (with light C functions).
340
*/
341 342 343 344
#define lua_cpcall(L,f,u)  \
	(lua_pushcfunction(L, (f)), \
	 lua_pushlightuserdata(L,(u)), \
	 lua_pcall(L,1,0,0))
345 346 347


/*
348 349
@@ LUA_COMPAT_LOG10 defines the function 'log10' in the math library.
** You can rewrite 'log10(x)' as 'log(x, 10)'.
350
*/
351
#define LUA_COMPAT_LOG10
352 353

/*
354 355
@@ LUA_COMPAT_LOADSTRING defines the function 'loadstring' in the base
** library. You can rewrite 'loadstring(s)' as 'load(s)'.
356
*/
357
#define LUA_COMPAT_LOADSTRING
358 359

/*
360
@@ LUA_COMPAT_MAXN defines the function 'maxn' in the table library.
361
*/
362
#define LUA_COMPAT_MAXN
363 364

/*
365 366 367
@@ The following macros supply trivial compatibility for some
** changes in the API. The macros themselves document how to
** change your code to avoid using them.
368
*/
369
#define lua_strlen(L,i)		lua_rawlen(L, (i))
370

371
#define lua_objlen(L,i)		lua_rawlen(L, (i))
372

373 374
#define lua_equal(L,idx1,idx2)		lua_compare(L,(idx1),(idx2),LUA_OPEQ)
#define lua_lessthan(L,idx1,idx2)	lua_compare(L,(idx1),(idx2),LUA_OPLT)
375 376

/*
377 378
@@ LUA_COMPAT_MODULE controls compatibility with previous
** module functions 'module' (Lua) and 'luaL_register' (C).
379
*/
380 381 382
#define LUA_COMPAT_MODULE

#endif				/* } */
383 384 385


/*
386 387 388 389
@@ LUA_COMPAT_FLOATSTRING makes Lua format integral floats without a
@@ a float mark ('.0').
** This macro is not on by default even in compatibility mode,
** because this is not really an incompatibility.
390
*/
391
/* #define LUA_COMPAT_FLOATSTRING */
392

393
/* }================================================================== */
394 395 396 397



/*
398 399 400 401 402
** {==================================================================
** Configuration for Numbers.
** Change these definitions if no predefined LUA_FLOAT_* / LUA_INT_*
** satisfy your needs.
** ===================================================================
403 404 405
*/

/*
406 407 408 409 410 411 412 413 414 415
@@ LUA_NUMBER is the floating-point type used by Lua.
@@ LUAI_UACNUMBER is the result of an 'usual argument conversion'
@@ over a floating number.
@@ l_mathlim(x) corrects limit name 'x' to the proper float type
** by prefixing it with one of FLT/DBL/LDBL.
@@ LUA_NUMBER_FRMLEN is the length modifier for writing floats.
@@ LUA_NUMBER_FMT is the format for writing floats.
@@ lua_number2str converts a float to a string.
@@ l_mathop allows the addition of an 'l' or 'f' to all math operations.
@@ lua_str2number converts a decimal numeric string to a number.
416 417
*/

418
#if LUA_FLOAT_TYPE == LUA_FLOAT_FLOAT		/* { single float */
419

420
#define LUA_NUMBER	float
421

422
#define l_mathlim(n)		(FLT_##n)
423

424
#define LUAI_UACNUMBER	double
425

426 427
#define LUA_NUMBER_FRMLEN	""
#define LUA_NUMBER_FMT		"%.7g"
428

429
#define l_mathop(op)		op##f
430

431
#define lua_str2number(s,p)	strtof((s), (p))
432 433


434
#elif LUA_FLOAT_TYPE == LUA_FLOAT_LONGDOUBLE	/* }{ long double */
435

436
#define LUA_NUMBER	long double
437

438
#define l_mathlim(n)		(LDBL_##n)
439

440
#define LUAI_UACNUMBER	long double
441

442 443
#define LUA_NUMBER_FRMLEN	"L"
#define LUA_NUMBER_FMT		"%.19Lg"
444

445
#define l_mathop(op)		op##l
446

447
#define lua_str2number(s,p)	strtold((s), (p))
448

449
#elif LUA_FLOAT_TYPE == LUA_FLOAT_DOUBLE	/* }{ double */
450 451 452

#define LUA_NUMBER	double

453 454
#define l_mathlim(n)		(DBL_##n)

455 456
#define LUAI_UACNUMBER	double

457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474
#define LUA_NUMBER_FRMLEN	""
#define LUA_NUMBER_FMT		"%.14g"

#define l_mathop(op)		op

#define lua_str2number(s,p)	strtod((s), (p))

#else						/* }{ */

#error "numeric float type not defined"

#endif					/* } */


#define l_floor(x)		(l_mathop(floor)(x))

#define lua_number2str(s,n)	sprintf((s), LUA_NUMBER_FMT, (n))

475 476

/*
477 478 479 480 481 482
@@ lua_numbertointeger converts a float number to an integer, or
** returns 0 if float is not within the range of a lua_Integer.
** (The range comparisons are tricky because of rounding. The tests
** here assume a two-complement representation, where MININTEGER always
** has an exact representation as a float; MAXINTEGER may not have one,
** and therefore its conversion to float may have an ill-defined value.)
483
*/
484 485 486 487 488
#define lua_numbertointeger(n,p) \
  ((n) >= (LUA_NUMBER)(LUA_MININTEGER) && \
   (n) < -(LUA_NUMBER)(LUA_MININTEGER) && \
      (*(p) = (LUA_INTEGER)(n), 1))

489 490 491


/*
492 493 494 495 496 497 498 499 500 501 502
@@ LUA_INTEGER is the integer type used by Lua.
**
@@ LUA_UNSIGNED is the unsigned version of LUA_INTEGER.
**
@@ LUAI_UACINT is the result of an 'usual argument conversion'
@@ over a lUA_INTEGER.
@@ LUA_INTEGER_FRMLEN is the length modifier for reading/writing integers.
@@ LUA_INTEGER_FMT is the format for writing integers.
@@ LUA_MAXINTEGER is the maximum value for a LUA_INTEGER.
@@ LUA_MININTEGER is the minimum value for a LUA_INTEGER.
@@ lua_integer2str converts an integer to a string.
503 504 505
*/


506 507 508 509 510 511 512
/* The following definitions are good for most cases here */

#define LUA_INTEGER_FMT		"%" LUA_INTEGER_FRMLEN "d"
#define lua_integer2str(s,n)	sprintf((s), LUA_INTEGER_FMT, (n))

#define LUAI_UACINT		LUA_INTEGER

513
/*
514 515
** use LUAI_UACINT here to avoid problems with promotions (which
** can turn a comparison between unsigneds into a signed comparison)
516
*/
517
#define LUA_UNSIGNED		unsigned LUAI_UACINT
518 519


520
/* now the variable definitions */
521

522
#if LUA_INT_TYPE == LUA_INT_INT		/* { int */
523

524 525
#define LUA_INTEGER		int
#define LUA_INTEGER_FRMLEN	""
526

527 528
#define LUA_MAXINTEGER		INT_MAX
#define LUA_MININTEGER		INT_MIN
529

530
#elif LUA_INT_TYPE == LUA_INT_LONG	/* }{ long */
531

532 533
#define LUA_INTEGER		long
#define LUA_INTEGER_FRMLEN	"l"
534

535 536
#define LUA_MAXINTEGER		LONG_MAX
#define LUA_MININTEGER		LONG_MIN
537

538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569
#elif LUA_INT_TYPE == LUA_INT_LONGLONG	/* }{ long long */

#if defined(LLONG_MAX)		/* { */
/* use ISO C99 stuff */

#define LUA_INTEGER		long long
#define LUA_INTEGER_FRMLEN	"ll"

#define LUA_MAXINTEGER		LLONG_MAX
#define LUA_MININTEGER		LLONG_MIN

#elif defined(LUA_USE_WINDOWS) /* }{ */
/* in Windows, can use specific Windows types */

#define LUA_INTEGER		__int64
#define LUA_INTEGER_FRMLEN	"I64"

#define LUA_MAXINTEGER		_I64_MAX
#define LUA_MININTEGER		_I64_MIN

#else				/* }{ */

#error "Compiler does not support 'long long'. Use option '-DLUA_32BITS' \
  or '-DLUA_C89_NUMBERS' (see file 'luaconf.h' for details)"

#endif				/* } */

#else				/* }{ */

#error "numeric integer type not defined"

#endif				/* } */
570 571 572 573 574

/* }================================================================== */


/*
575 576 577
** {==================================================================
** Dependencies with C99 and other C details
** ===================================================================
578 579 580
*/

/*
581 582 583 584
@@ lua_strx2number converts an hexadecimal numeric string to a number.
** In C99, 'strtod' does that conversion. Otherwise, you can
** leave 'lua_strx2number' undefined and Lua will provide its own
** implementation.
585
*/
586 587 588
#if !defined(LUA_USE_C89)
#define lua_strx2number(s,p)	lua_str2number(s,p)
#endif
589 590


591 592 593 594 595 596 597 598
/*
@@ lua_number2strx converts a float to an hexadecimal numeric string. 
** In C99, 'sprintf' (with format specifiers '%a'/'%A') does that.
** Otherwise, you can leave 'lua_number2strx' undefined and Lua will
** provide its own implementation.
*/
#if !defined(LUA_USE_C89)
#define lua_number2strx(L,b,f,n)	sprintf(b,f,n)
599 600 601 602
#endif


/*
603 604 605 606
** 'strtof' and 'opf' variants for math functions are not valid in
** C89. Otherwise, the macro 'HUGE_VALF' is a good proxy for testing the
** availability of these variants. ('math.h' is already included in
** all files that use these macros.)
607
*/
608 609 610 611 612 613
#if defined(LUA_USE_C89) || (defined(HUGE_VAL) && !defined(HUGE_VALF))
#undef l_mathop  /* variants not available */
#undef lua_str2number
#define l_mathop(op)		(lua_Number)op  /* no variant */
#define lua_str2number(s,p)	((lua_Number)strtod((s), (p)))
#endif
614 615 616


/*
617 618 619 620
@@ LUA_KCONTEXT is the type of the context ('ctx') for continuation
** functions.  It must be a numerical type; Lua will use 'intptr_t' if
** available, otherwise it will use 'ptrdiff_t' (the nearest thing to
** 'intptr_t' in C89)
621
*/
622
#define LUA_KCONTEXT	ptrdiff_t
623

624 625 626 627 628 629
#if !defined(LUA_USE_C89) && defined(__STDC_VERSION__) && \
    __STDC_VERSION__ >= 199901L
#include <stdint.h>
#if defined(INTPTR_MAX)  /* even in C99 this type is optional */
#undef LUA_KCONTEXT
#define LUA_KCONTEXT	intptr_t
630 631 632 633 634
#endif
#endif


/*
635 636 637
@@ lua_getlocaledecpoint gets the locale "radix character" (decimal point).
** Change that if you do not want to use C locales. (Code using this
** macro must include header 'locale.h'.)
638
*/
639 640 641
#if !defined(lua_getlocaledecpoint)
#define lua_getlocaledecpoint()		(localeconv()->decimal_point[0])
#endif
642

643
/* }================================================================== */
644 645


646 647 648 649 650
/*
** {==================================================================
** Language Variations
** =====================================================================
*/
651

652 653 654 655 656 657 658 659
/*
@@ LUA_NOCVTN2S/LUA_NOCVTS2N control how Lua performs some
** coercions. Define LUA_NOCVTN2S to turn off automatic coercion from
** numbers to strings. Define LUA_NOCVTS2N to turn off automatic
** coercion from strings to numbers.
*/
/* #define LUA_NOCVTN2S */
/* #define LUA_NOCVTS2N */
660 661


662 663 664 665 666 667 668
/*
@@ LUA_USE_APICHECK turns on several consistency checks on the C API.
** Define it as a help when debugging C code.
*/
#if defined(LUA_USE_APICHECK)
#include <assert.h>
#define luai_apicheck(l,e)	assert(e)
669 670
#endif

671 672 673
/* }================================================================== */


674
/*
675 676 677 678 679 680
** {==================================================================
** Macros that affect the API and must be stable (that is, must be the
** same when you compile Lua and when you compile code that links to
** Lua). You probably do not want/need to change them.
** =====================================================================
*/
681

682 683 684 685 686 687 688 689 690 691
/*
@@ LUAI_MAXSTACK limits the size of the Lua stack.
** CHANGE it if you need a different limit. This limit is arbitrary;
** its only purpose is to stop Lua from consuming unlimited stack
** space (and to reserve some numbers for pseudo-indices).
*/
#if LUAI_BITSINT >= 32
#define LUAI_MAXSTACK		1000000
#else
#define LUAI_MAXSTACK		15000
692 693 694 695
#endif


/*
696 697 698
@@ LUA_EXTRASPACE defines the size of a raw memory area associated with
** a Lua state with very fast access.
** CHANGE it if you need a different size.
699
*/
700
#define LUA_EXTRASPACE		(sizeof(void *))
701 702 703


/*
704 705 706
@@ LUA_IDSIZE gives the maximum size for the description of the source
@@ of a function in debug information.
** CHANGE it if you want a different size.
707
*/
708
#define LUA_IDSIZE	60
709 710 711


/*
712 713 714 715 716
@@ LUAL_BUFFERSIZE is the buffer size used by the lauxlib buffer system.
** CHANGE it if it uses too much C-stack space. (For long double,
** 'string.format("%.99f", 1e4932)' needs ~5030 bytes, so a
** smaller buffer would force a memory allocation for each call to
** 'string.format'.)
717
*/
718 719 720 721 722
#if defined(LUA_FLOAT_LONGDOUBLE)
#define LUAL_BUFFERSIZE		8192
#else
#define LUAL_BUFFERSIZE   ((int)(0x80 * sizeof(void*) * sizeof(lua_Integer)))
#endif
723

724
/* }================================================================== */
725 726


727 728 729 730 731 732 733
/*
@@ LUA_QL describes how error messages quote program elements.
** Lua does not use these macros anymore; they are here for
** compatibility only.
*/
#define LUA_QL(x)	"'" x "'"
#define LUA_QS		LUA_QL("%s")
734 735 736 737 738 739 740 741 742 743 744 745 746




/* =================================================================== */

/*
** Local configuration. You can use this space to add your redefinitions
** without modifying the main part of the file.
*/



747 748


749 750
#endif