aboutsummaryrefslogtreecommitdiff
path: root/luaconf.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2005-05-17 16:49:15 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2005-05-17 16:49:15 -0300
commit67578ec51f1a3ec2c967f15d370067caf9e0b87b (patch)
treed77b292ddec33d7e6987bae808fa1db250ebd830 /luaconf.h
parentc2bb9abceceef125554595e23b7cc18ad3555c7c (diff)
downloadlua-67578ec51f1a3ec2c967f15d370067caf9e0b87b.tar.gz
lua-67578ec51f1a3ec2c967f15d370067caf9e0b87b.tar.bz2
lua-67578ec51f1a3ec2c967f15d370067caf9e0b87b.zip
several small details
Diffstat (limited to 'luaconf.h')
-rw-r--r--luaconf.h97
1 files changed, 55 insertions, 42 deletions
diff --git a/luaconf.h b/luaconf.h
index 32600822..f7bcbf92 100644
--- a/luaconf.h
+++ b/luaconf.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: luaconf.h,v 1.47 2005/05/03 19:30:17 roberto Exp roberto $ 2** $Id: luaconf.h,v 1.48 2005/05/16 21:19:00 roberto Exp roberto $
3** Configuration file for Lua 3** Configuration file for Lua
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -13,14 +13,12 @@
13 13
14 14
15/* 15/*
16** {================================================================== 16** ==================================================================
17** Index (search for keyword to find corresponding entry) 17** Search for "@@" to find all configurable definitions.
18** =================================================================== 18** ===================================================================
19*/ 19*/
20 20
21 21
22/* }================================================================== */
23
24 22
25 23
26/* 24/*
@@ -67,17 +65,17 @@
67/* 65/*
68@@ LUA_PATHSEP is the character that separates templates in a path. 66@@ LUA_PATHSEP is the character that separates templates in a path.
69** CHANGE it if for some reason your system cannot use a 67** CHANGE it if for some reason your system cannot use a
70** semicolon. (E.g., a semicolon may be a too common character in 68** semicolon. (E.g., if a semicolon is a common character in
71** file/directory names.) Probably you do not need to change this. 69** file/directory names.) Probably you do not need to change this.
72*/ 70*/
73#define LUA_PATHSEP ';' 71#define LUA_PATHSEP ';'
74 72
75 73
76/* 74/*
77@@ LUA_PATH_MARK is ths string that marks the substitution points in a 75@@ LUA_PATH_MARK is the string that marks the substitution points in a
78@* template. 76@* template.
79** CHANGE it if for some reason your system cannot use an interogation 77** CHANGE it if for some reason your system cannot use an interrogation
80** mark. (E.g., an interogation mark may be a too common character in 78** mark. (E.g., if an interogation mark is a common character in
81** file/directory names.) Probably you do not need to change this. 79** file/directory names.) Probably you do not need to change this.
82*/ 80*/
83#define LUA_PATH_MARK "?" 81#define LUA_PATH_MARK "?"
@@ -113,16 +111,16 @@
113 111
114#endif 112#endif
115 113
116/* more often then not the libs go together with the core */ 114/* more often than not the libs go together with the core */
117#define LUALIB_API LUA_API 115#define LUALIB_API LUA_API
118 116
119 117
120/* 118/*
121@@ LUAI_FUNC is a mark for all extern functions that are not to be 119@@ LUAI_FUNC is a mark for all extern functions that are not to be
122@* exported to outside modules. 120@* exported to outside modules.
123** CHANGE it if you need to mark them in some special way. Gcc mark 121** CHANGE it if you need to mark them in some special way. Gcc (versions
124** them as "hidden" to optimize their call when Lua is compiled as a 122** 3.2 and later) mark them as "hidden" to optimize their call when Lua
125** shared library. 123** is compiled as a shared library.
126*/ 124*/
127#if defined(luaall_c) 125#if defined(luaall_c)
128#define LUAI_FUNC static 126#define LUAI_FUNC static
@@ -141,10 +139,20 @@
141 139
142 140
143/* 141/*
144@@ LUA_SM describes how variable strings appear in error messages. 142@@ LUA_QL describes how error messages quote program elements.
145** CHANGE it if you want a different appearance. 143** CHANGE it if you want a different appearance.
146*/ 144*/
147#define LUA_SM "'%s'" 145#define LUA_QL(x) "'" x "'"
146#define LUA_QS LUA_QL("%s")
147
148
149/*
150@@ LUA_IDSIZE gives the maximum size for the description of the source
151@* of a function in debug information.
152** CHANGE it if you a different size.
153*/
154#define LUA_IDSIZE 60
155
148 156
149/* 157/*
150** {================================================================== 158** {==================================================================
@@ -155,8 +163,8 @@
155#if defined(lua_c) || defined(luaall_c) 163#if defined(lua_c) || defined(luaall_c)
156 164
157/* 165/*
158@@ lua_stdin_is_tty is a function to detect whether the standard input is 166@@ lua_stdin_is_tty detects whether the standard input is a 'tty' (that
159@* a 'tty' (that is, is interactive). 167@* is, whether we're running lua interactively).
160** CHANGE it if you have a better definition for non-POSIX/non-Windows 168** CHANGE it if you have a better definition for non-POSIX/non-Windows
161** systems. 169** systems.
162*/ 170*/
@@ -191,7 +199,8 @@
191 199
192 200
193/* 201/*
194@@ LUA_MAXINPUT is the maximum length for an input line 202@@ LUA_MAXINPUT is the maximum length for an input line in the
203@* stand-alone interpreter.
195** CHANGE it if you need longer lines. 204** CHANGE it if you need longer lines.
196*/ 205*/
197#define LUA_MAXINPUT 512 206#define LUA_MAXINPUT 512
@@ -200,10 +209,10 @@
200/* 209/*
201@@ lua_readline defines how to show a prompt and then read a line from 210@@ lua_readline defines how to show a prompt and then read a line from
202@* the standard input. 211@* the standard input.
203@@ lua_saveline defines how to "save" a read line. 212@@ lua_saveline defines how to "save" a read line in a "history".
204@@ lua_freeline defines how to free a line read by lua_readline. 213@@ lua_freeline defines how to free a line read by lua_readline.
205** CHANGE them if you want to improve this functionality (e.g., using GNU 214** CHANGE them if you want to improve this functionality (e.g., by using
206** readline and history facilities). 215** GNU readline and history facilities).
207*/ 216*/
208#if !defined(__STRICT_ANSI__) && defined(LUA_USE_READLINE) 217#if !defined(__STRICT_ANSI__) && defined(LUA_USE_READLINE)
209#include <stdio.h> 218#include <stdio.h>
@@ -317,14 +326,14 @@
317/* 326/*
318@@ LUAI_UINT32 is an unsigned integer with at least 32 bits. 327@@ LUAI_UINT32 is an unsigned integer with at least 32 bits.
319@@ LUAI_INT32 is an signed integer with at least 32 bits. 328@@ LUAI_INT32 is an signed integer with at least 32 bits.
320@@ LUAI_UMEM is an an unsigned integer big enough to count the total 329@@ LUAI_UMEM is an unsigned integer big enough to count the total
321@* memory used by Lua. 330@* memory used by Lua.
322@@ LUAI_MEM is an a signed integer big enough to count the total memory 331@@ LUAI_MEM is a signed integer big enough to count the total memory
323@* used by Lua. 332@* used by Lua.
324** CHANGE here if for some weird reason the default definitions are not 333** CHANGE here if for some weird reason the default definitions are not
325** good enough for your machine. (The 'else' definition always works, 334** good enough for your machine. (The definitions in the 'else'
326** but may waste space on machines with 64-bit longs.) Probably you do 335** part always works, but may waste space on machines with 64-bit
327** not need to change this. 336** longs.) Probably you do not need to change this.
328*/ 337*/
329#if LUAI_BITSINT >= 32 338#if LUAI_BITSINT >= 32
330#define LUAI_UINT32 unsigned int 339#define LUAI_UINT32 unsigned int
@@ -352,7 +361,8 @@
352 361
353 362
354/* 363/*
355@@ LUAI_MAXCSTACK limits the number of slots that a C function can use. 364@@ LUAI_MAXCSTACK limits the number of Lua stack slots that a C function
365@* can use.
356** CHANGE it if you need lots of (Lua) stack space for your C 366** CHANGE it if you need lots of (Lua) stack space for your C
357** functions. This limit is arbitrary; its only purpose is to stop C 367** functions. This limit is arbitrary; its only purpose is to stop C
358** functions to consume unlimited stack space. 368** functions to consume unlimited stack space.
@@ -379,7 +389,7 @@
379@@ LUAI_MAXCCALLS is the maximum depth for nested C calls (short) and 389@@ LUAI_MAXCCALLS is the maximum depth for nested C calls (short) and
380@* syntactical nested non-terminals in a program. 390@* syntactical nested non-terminals in a program.
381*/ 391*/
382#define LUAI_MAXCCALLS 200 392#define LUAI_MAXCCALLS 200
383 393
384 394
385/* 395/*
@@ -420,7 +430,7 @@
420** in C is extremely slow, so any alternative is worth trying. 430** in C is extremely slow, so any alternative is worth trying.
421*/ 431*/
422 432
423/* On a GNU/Pentium, resort to assembler */ 433/* On a gcc/Pentium, resort to assembler */
424#if !defined(__STRICT_ANSI__) && defined(__GNUC__) && defined(__i386) 434#if !defined(__STRICT_ANSI__) && defined(__GNUC__) && defined(__i386)
425#define lua_number2int(i,d) __asm__ ("fistpl %0":"=m"(i):"t"(d):"st") 435#define lua_number2int(i,d) __asm__ ("fistpl %0":"=m"(i):"t"(d):"st")
426 436
@@ -433,10 +443,10 @@
433 443
434/* on Pentium machines compliant with C99, you can try lrint */ 444/* on Pentium machines compliant with C99, you can try lrint */
435#elif defined (__i386) && defined(__STDC_VERSION__) && \ 445#elif defined (__i386) && defined(__STDC_VERSION__) && \
436 (__STDC_VERSION__ >= 199900L) 446 (__STDC_VERSION__ >= 199900L)
437#define lua_number2int(i,d) ((i)=lrint(d)) 447#define lua_number2int(i,d) ((i)=lrint(d))
438 448
439/* this option always work, but may be slow */ 449/* this option always works, but may be slow */
440#else 450#else
441#define lua_number2int(i,d) ((i)=(int)(d)) 451#define lua_number2int(i,d) ((i)=(int)(d))
442 452
@@ -447,14 +457,14 @@
447@@ lua_number2integer is a macro to convert lua_Number to lua_Integer. 457@@ lua_number2integer is a macro to convert lua_Number to lua_Integer.
448** CHANGE (see lua_number2int). 458** CHANGE (see lua_number2int).
449*/ 459*/
450/* On a GNU or Windows/Pentium, resort to assembler */ 460/* On a gcc or Windows/Pentium, resort to assembler */
451#if (defined(__GNUC__) && defined(__i386)) || \ 461#if (defined(__GNUC__) && defined(__i386)) || \
452 (defined(_MSC_VER) && defined(_M_IX86)) 462 (defined(_MSC_VER) && defined(_M_IX86))
453#define lua_number2integer(i,n) lua_number2int(i, n) 463#define lua_number2integer(i,n) lua_number2int(i, n)
454 464
455/* this option always work, but may be slow */ 465/* this option always works, but may be slow */
456#else 466#else
457#define lua_number2integer(i,d) ((i)=(lua_Integer)(d)) 467#define lua_number2integer(i,d) ((i)=(lua_Integer)(d))
458 468
459#endif 469#endif
460 470
@@ -462,6 +472,7 @@
462 472
463/* 473/*
464** {================================================================== 474** {==================================================================
475@@ LUA_NUMBER is the type of numbers in Lua.
465** CHANGE the following definitions only if you want to build Lua 476** CHANGE the following definitions only if you want to build Lua
466** with a number type different from double. You may also need to 477** with a number type different from double. You may also need to
467** change lua_number2int & lua_number2integer. 478** change lua_number2int & lua_number2integer.
@@ -470,7 +481,6 @@
470 481
471 482
472/* 483/*
473@@ LUA_NUMBER is the type of numbers in Lua.
474@@ LUAI_UACNUMBER is the result of an 'usual argument conversion' 484@@ LUAI_UACNUMBER is the result of an 'usual argument conversion'
475@* over a number. 485@* over a number.
476*/ 486*/
@@ -512,9 +522,9 @@
512/* 522/*
513@@ LUAI_USER_ALIGNMENT_T is a type that requires maximum alignment. 523@@ LUAI_USER_ALIGNMENT_T is a type that requires maximum alignment.
514** CHANGE it if your system requires alignments larger than double. (For 524** CHANGE it if your system requires alignments larger than double. (For
515** instance, if your system supports long double and those long doubles 525** instance, if your system supports long doubles and they must be
516** must be aligned in 16-byte boundaries, then you should add long 526** aligned in 16-byte boundaries, then you should add long double in the
517** double in the union.) Probably you do not need to change this. 527** union.) Probably you do not need to change this.
518*/ 528*/
519#define LUAI_USER_ALIGNMENT_T union { double u; void *s; long l; } 529#define LUAI_USER_ALIGNMENT_T union { double u; void *s; long l; }
520 530
@@ -535,7 +545,7 @@
535#define luai_jmpbuf int /* dummy variable */ 545#define luai_jmpbuf int /* dummy variable */
536 546
537#elif !defined(__STRICT_ANSI__) && (defined(unix) || defined(__unix) || \ 547#elif !defined(__STRICT_ANSI__) && (defined(unix) || defined(__unix) || \
538 defined(__unix__)) 548 defined(__unix__))
539/* in Unix, try _longjmp/_setjmp (more efficient) */ 549/* in Unix, try _longjmp/_setjmp (more efficient) */
540#define LUAI_THROW(L,c) _longjmp((c)->b, 1) 550#define LUAI_THROW(L,c) _longjmp((c)->b, 1)
541#define LUAI_TRY(L,c,a) if (_setjmp((c)->b) == 0) { a } 551#define LUAI_TRY(L,c,a) if (_setjmp((c)->b) == 0) { a }
@@ -589,7 +599,7 @@
589** dynamic-library system for your platform (either Windows' DLL, Mac's 599** dynamic-library system for your platform (either Windows' DLL, Mac's
590** dyld, or Unix's dlopen). If your system is some kind of Unix, there 600** dyld, or Unix's dlopen). If your system is some kind of Unix, there
591** is a good chance that it has dlopen, so LUA_DL_DLOPEN will work for 601** is a good chance that it has dlopen, so LUA_DL_DLOPEN will work for
592** it. To use dlopen you also need to adapt the makefile (probably 602** it. To use dlopen you also need to adapt the src/Makefile (probably
593** adding -ldl to the linker options), so Lua does not select it 603** adding -ldl to the linker options), so Lua does not select it
594** automatically. (When you change the makefile to add -ldl, you must 604** automatically. (When you change the makefile to add -ldl, you must
595** also add -DLUA_USE_DLOPEN.) 605** also add -DLUA_USE_DLOPEN.)
@@ -611,7 +621,7 @@
611@@ lua_lock/lua_unlock are macros for thread synchronization inside the 621@@ lua_lock/lua_unlock are macros for thread synchronization inside the
612@* Lua core. This is an attempt to simplify the implementation of a 622@* Lua core. This is an attempt to simplify the implementation of a
613@* multithreaded version of Lua. 623@* multithreaded version of Lua.
614** CHANGE them only if you know what you are doing. all accesses to 624** CHANGE them only if you know what you are doing. All accesses to
615** the global state and to global objects are synchronized. Because 625** the global state and to global objects are synchronized. Because
616** threads can read the stack of other threads (when running garbage 626** threads can read the stack of other threads (when running garbage
617** collection), a thread must also synchronize any write-access to its 627** collection), a thread must also synchronize any write-access to its
@@ -650,7 +660,10 @@
650 660
651/* =================================================================== */ 661/* =================================================================== */
652 662
653/* Local configuration */ 663/*
664** Local configuration. You can use this space to add your redefinitions
665** without modifying the main part of the file.
666*/
654 667
655 668
656 669