monotone

monotone Mtn Source Tree

Root/lua/luaconf.h

1/*
2** $Id: luaconf.h,v 1.82a 2006/04/10 18:27:23 roberto Exp $
3** Configuration file for Lua
4** See Copyright Notice in lua.h
5*/
6
7
8#ifndef lconfig_h
9#define lconfig_h
10
11#include <limits.h>
12#include <stddef.h>
13
14/* Monotone local: Needs to see the application config.h. */
15#include "config.h"
16
17/*
18** ==================================================================
19** Search for "@@" to find all configurable definitions.
20** ===================================================================
21*/
22
23
24/*
25@@ LUA_ANSI controls the use of non-ansi features.
26** CHANGE it (define it) if you want Lua to avoid the use of any
27** non-ansi feature or library.
28*/
29#if defined(__STRICT_ANSI__)
30#define LUA_ANSI
31#endif
32
33
34/* Monotone local: We can assume POSIX if not _WIN32. */
35#if !defined(LUA_ANSI)
36#if defined(_WIN32)
37#define LUA_WIN
38#else
39#define LUA_USE_POSIX
40#endif
41#endif
42
43#if defined(LUA_USE_LINUX)
44#define LUA_USE_POSIX
45#define LUA_USE_DLOPEN/* needs an extra library: -ldl */
46#define LUA_USE_READLINE/* needs some extra libraries */
47#endif
48
49#if defined(LUA_USE_MACOSX)
50#define LUA_USE_POSIX
51#define LUA_DL_DYLD/* does not need extra library */
52#endif
53
54
55
56/*
57@@ LUA_USE_POSIX includes all functionallity listed as X/Open System
58@* Interfaces Extension (XSI).
59** CHANGE it (define it) if your system is XSI compatible.
60*/
61#if defined(LUA_USE_POSIX)
62#define LUA_USE_MKSTEMP
63#define LUA_USE_ISATTY
64#define LUA_USE_POPEN
65#define LUA_USE_ULONGJMP
66#endif
67
68
69/*
70@@ LUA_PATH and LUA_CPATH are the names of the environment variables that
71@* Lua check to set its paths.
72@@ LUA_INIT is the name of the environment variable that Lua
73@* checks for initialization code.
74** CHANGE them if you want different names.
75*/
76#define LUA_PATH "LUA_PATH"
77#define LUA_CPATH "LUA_CPATH"
78#define LUA_INIT"LUA_INIT"
79
80
81/*
82@@ LUA_PATH_DEFAULT is the default path that Lua uses to look for
83@* Lua libraries.
84@@ LUA_CPATH_DEFAULT is the default path that Lua uses to look for
85@* C libraries.
86** CHANGE them if your machine has a non-conventional directory
87** hierarchy or if you want to install your libraries in
88** non-conventional directories.
89*/
90#if defined(_WIN32)
91/*
92** In Windows, any exclamation mark ('!') in the path is replaced by the
93** path of the directory of the executable file of the current process.
94*/
95#define LUA_LDIR"!\\lua\\"
96#define LUA_CDIR"!\\"
97#define LUA_PATH_DEFAULT \
98".\\?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?\\init.lua;" \
99 LUA_CDIR"?.lua;" LUA_CDIR"?\\init.lua"
100#define LUA_CPATH_DEFAULT \
101".\\?.dll;" LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll"
102
103#else
104#define LUA_ROOT"/usr/local/"
105#define LUA_LDIRLUA_ROOT "share/lua/5.1/"
106#define LUA_CDIRLUA_ROOT "lib/lua/5.1/"
107#define LUA_PATH_DEFAULT \
108"./?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \
109 LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua"
110#define LUA_CPATH_DEFAULT \
111"./?.so;" LUA_CDIR"?.so;" LUA_CDIR"loadall.so"
112#endif
113
114
115/*
116@@ LUA_DIRSEP is the directory separator (for submodules).
117** CHANGE it if your machine does not use "/" as the directory separator
118** and is not Windows. (On Windows Lua automatically uses "\".)
119*/
120#if defined(_WIN32)
121#define LUA_DIRSEP"\\"
122#else
123#define LUA_DIRSEP"/"
124#endif
125
126
127/*
128@@ LUA_PATHSEP is the character that separates templates in a path.
129@@ LUA_PATH_MARK is the string that marks the substitution points in a
130@* template.
131@@ LUA_EXECDIR in a Windows path is replaced by the executable's
132@* directory.
133@@ LUA_IGMARK is a mark to ignore all before it when bulding the
134@* luaopen_ function name.
135** CHANGE them if for some reason your system cannot use those
136** characters. (E.g., if one of those characters is a common character
137** in file/directory names.) Probably you do not need to change them.
138*/
139#define LUA_PATHSEP";"
140#define LUA_PATH_MARK"?"
141#define LUA_EXECDIR"!"
142#define LUA_IGMARK"-"
143
144
145/*
146@@ LUA_INTEGER is the integral type used by lua_pushinteger/lua_tointeger.
147** CHANGE that if ptrdiff_t is not adequate on your machine. (On most
148** machines, ptrdiff_t gives a good choice between int or long.)
149*/
150#define LUA_INTEGERptrdiff_t
151
152
153/*
154@@ LUA_API is a mark for all core API functions.
155@@ LUALIB_API is a mark for all standard library functions.
156** CHANGE them if you need to define those functions in some special way.
157** For instance, if you want to create one Windows DLL with the core and
158** the libraries, you may want to use the following definition (define
159** LUA_BUILD_AS_DLL to get it).
160*/
161#if defined(LUA_BUILD_AS_DLL)
162
163#if defined(LUA_CORE) || defined(LUA_LIB)
164#define LUA_API __declspec(dllexport)
165#else
166#define LUA_API __declspec(dllimport)
167#endif
168
169#else
170
171#define LUA_APIextern
172
173#endif
174
175/* more often than not the libs go together with the core */
176#define LUALIB_APILUA_API
177
178
179/*
180@@ LUAI_FUNC is a mark for all extern functions that are not to be
181@* exported to outside modules.
182@@ LUAI_DATA is a mark for all extern (const) variables that are not to
183@* be exported to outside modules.
184** CHANGE them if you need to mark them in some special way. Elf/gcc
185** (versions 3.2 and later) mark them as "hidden" to optimize access
186** when Lua is compiled as a shared library.
187*/
188#if defined(luaall_c)
189#define LUAI_FUNCstatic
190#define LUAI_DATA/* empty */
191
192#elif defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 302) && \
193 defined(__ELF__)
194#define LUAI_FUNC__attribute__((visibility("hidden"))) extern
195#define LUAI_DATALUAI_FUNC
196
197#else
198#define LUAI_FUNCextern
199#define LUAI_DATAextern
200#endif
201
202
203
204/*
205@@ LUA_QL describes how error messages quote program elements.
206** CHANGE it if you want a different appearance.
207*/
208#define LUA_QL(x)"'" x "'"
209#define LUA_QSLUA_QL("%s")
210
211
212/*
213@@ LUA_IDSIZE gives the maximum size for the description of the source
214@* of a function in debug information.
215** CHANGE it if you want a different size.
216*/
217#define LUA_IDSIZE60
218
219
220/*
221** {==================================================================
222** Stand-alone configuration
223** ===================================================================
224*/
225
226#if defined(lua_c) || defined(luaall_c)
227
228/*
229@@ lua_stdin_is_tty detects whether the standard input is a 'tty' (that
230@* is, whether we're running lua interactively).
231** CHANGE it if you have a better definition for non-POSIX/non-Windows
232** systems.
233*/
234#if defined(LUA_USE_ISATTY)
235#include <unistd.h>
236#define lua_stdin_is_tty()isatty(0)
237#elif defined(LUA_WIN)
238#include <io.h>
239#include <stdio.h>
240#define lua_stdin_is_tty()_isatty(_fileno(stdin))
241#else
242#define lua_stdin_is_tty()1 /* assume stdin is a tty */
243#endif
244
245
246/*
247@@ LUA_PROMPT is the default prompt used by stand-alone Lua.
248@@ LUA_PROMPT2 is the default continuation prompt used by stand-alone Lua.
249** CHANGE them if you want different prompts. (You can also change the
250** prompts dynamically, assigning to globals _PROMPT/_PROMPT2.)
251*/
252#define LUA_PROMPT"> "
253#define LUA_PROMPT2">> "
254
255
256/*
257@@ LUA_PROGNAME is the default name for the stand-alone Lua program.
258** CHANGE it if your stand-alone interpreter has a different name and
259** your system is not able to detect that name automatically.
260*/
261#define LUA_PROGNAME"lua"
262
263
264/*
265@@ LUA_MAXINPUT is the maximum length for an input line in the
266@* stand-alone interpreter.
267** CHANGE it if you need longer lines.
268*/
269#define LUA_MAXINPUT512
270
271
272/*
273@@ lua_readline defines how to show a prompt and then read a line from
274@* the standard input.
275@@ lua_saveline defines how to "save" a read line in a "history".
276@@ lua_freeline defines how to free a line read by lua_readline.
277** CHANGE them if you want to improve this functionality (e.g., by using
278** GNU readline and history facilities).
279*/
280#if defined(LUA_USE_READLINE)
281#include <stdio.h>
282#include <readline/readline.h>
283#include <readline/history.h>
284#define lua_readline(L,b,p)((void)L, ((b)=readline(p)) != NULL)
285#define lua_saveline(L,idx) \
286if (lua_strlen(L,idx) > 0) /* non-empty line? */ \
287 add_history(lua_tostring(L, idx)); /* add it to history */
288#define lua_freeline(L,b)((void)L, free(b))
289#else
290#define lua_readline(L,b,p)\
291((void)L, fputs(p, stdout), fflush(stdout), /* show prompt */ \
292fgets(b, LUA_MAXINPUT, stdin) != NULL) /* get line */
293#define lua_saveline(L,idx){ (void)L; (void)idx; }
294#define lua_freeline(L,b){ (void)L; (void)b; }
295#endif
296
297#endif
298
299/* }================================================================== */
300
301
302/*
303@@ LUAI_GCPAUSE defines the default pause between garbage-collector cycles
304@* as a percentage.
305** CHANGE it if you want the GC to run faster or slower (higher values
306** mean larger pauses which mean slower collection.) You can also change
307** this value dynamically.
308*/
309#define LUAI_GCPAUSE200 /* 200% (wait memory to double before next GC) */
310
311
312/*
313@@ LUAI_GCMUL defines the default speed of garbage collection relative to
314@* memory allocation as a percentage.
315** CHANGE it if you want to change the granularity of the garbage
316** collection. (Higher values mean coarser collections. 0 represents
317** infinity, where each step performs a full collection.) You can also
318** change this value dynamically.
319*/
320#define LUAI_GCMUL200 /* GC runs 'twice the speed' of memory allocation */
321
322
323
324/*
325@@ LUA_COMPAT_GETN controls compatibility with old getn behavior.
326** CHANGE it (define it) if you want exact compatibility with the
327** behavior of setn/getn in Lua 5.0.
328*/
329#undef LUA_COMPAT_GETN
330
331/*
332@@ LUA_COMPAT_LOADLIB controls compatibility about global loadlib.
333** CHANGE it to undefined as soon as you do not need a global 'loadlib'
334** function (the function is still available as 'package.loadlib').
335*/
336#undef LUA_COMPAT_LOADLIB
337
338/*
339@@ LUA_COMPAT_VARARG controls compatibility with old vararg feature.
340** CHANGE it to undefined as soon as your programs use only '...' to
341** access vararg parameters (instead of the old 'arg' table).
342*/
343#define LUA_COMPAT_VARARG
344
345/*
346@@ LUA_COMPAT_MOD controls compatibility with old math.mod function.
347** CHANGE it to undefined as soon as your programs use 'math.fmod' or
348** the new '%' operator instead of 'math.mod'.
349*/
350#define LUA_COMPAT_MOD
351
352/*
353@@ LUA_COMPAT_LSTR controls compatibility with old long string nesting
354@* facility.
355** CHANGE it to 2 if you want the old behaviour, or undefine it to turn
356** off the advisory error when nesting [[...]].
357*/
358#define LUA_COMPAT_LSTR1
359
360/*
361@@ LUA_COMPAT_GFIND controls compatibility with old 'string.gfind' name.
362** CHANGE it to undefined as soon as you rename 'string.gfind' to
363** 'string.gmatch'.
364*/
365#define LUA_COMPAT_GFIND
366
367/*
368@@ LUA_COMPAT_OPENLIB controls compatibility with old 'luaL_openlib'
369@* behavior.
370** CHANGE it to undefined as soon as you replace to 'luaL_register'
371** your uses of 'luaL_openlib'
372*/
373#define LUA_COMPAT_OPENLIB
374
375
376
377/*
378@@ luai_apicheck is the assert macro used by the Lua-C API.
379** CHANGE luai_apicheck if you want Lua to perform some checks in the
380** parameters it gets from API calls. This may slow down the interpreter
381** a bit, but may be quite useful when debugging C code that interfaces
382** with Lua. A useful redefinition is to use assert.h.
383*/
384#if defined(LUA_USE_APICHECK)
385#include <assert.h>
386#define luai_apicheck(L,o){ (void)L; assert(o); }
387#else
388#define luai_apicheck(L,o){ (void)L; }
389#endif
390
391
392/*
393@@ LUAI_BITSINT defines the number of bits in an int.
394** CHANGE here if Lua cannot automatically detect the number of bits of
395** your machine. Probably you do not need to change this.
396*/
397/* avoid overflows in comparison */
398#if INT_MAX-20 < 32760
399#define LUAI_BITSINT16
400#elif INT_MAX > 2147483640L
401/* int has at least 32 bits */
402#define LUAI_BITSINT32
403#else
404#error "you must define LUA_BITSINT with number of bits in an integer"
405#endif
406
407
408/*
409@@ LUAI_UINT32 is an unsigned integer with at least 32 bits.
410@@ LUAI_INT32 is an signed integer with at least 32 bits.
411@@ LUAI_UMEM is an unsigned integer big enough to count the total
412@* memory used by Lua.
413@@ LUAI_MEM is a signed integer big enough to count the total memory
414@* used by Lua.
415** CHANGE here if for some weird reason the default definitions are not
416** good enough for your machine. (The definitions in the 'else'
417** part always works, but may waste space on machines with 64-bit
418** longs.) Probably you do not need to change this.
419*/
420#if LUAI_BITSINT >= 32
421#define LUAI_UINT32unsigned int
422#define LUAI_INT32int
423#define LUAI_MAXINT32INT_MAX
424#define LUAI_UMEMsize_t
425#define LUAI_MEMptrdiff_t
426#else
427/* 16-bit ints */
428#define LUAI_UINT32unsigned long
429#define LUAI_INT32long
430#define LUAI_MAXINT32LONG_MAX
431#define LUAI_UMEMunsigned long
432#define LUAI_MEMlong
433#endif
434
435
436/*
437@@ LUAI_MAXCALLS limits the number of nested calls.
438** CHANGE it if you need really deep recursive calls. This limit is
439** arbitrary; its only purpose is to stop infinite recursion before
440** exhausting memory.
441*/
442#define LUAI_MAXCALLS20000
443
444
445/*
446@@ LUAI_MAXCSTACK limits the number of Lua stack slots that a C function
447@* can use.
448** CHANGE it if you need lots of (Lua) stack space for your C
449** functions. This limit is arbitrary; its only purpose is to stop C
450** functions to consume unlimited stack space.
451*/
452#define LUAI_MAXCSTACK2048
453
454
455
456/*
457** {==================================================================
458** CHANGE (to smaller values) the following definitions if your system
459** has a small C stack. (Or you may want to change them to larger
460** values if your system has a large C stack and these limits are
461** too rigid for you.) Some of these constants control the size of
462** stack-allocated arrays used by the compiler or the interpreter, while
463** others limit the maximum number of recursive calls that the compiler
464** or the interpreter can perform. Values too large may cause a C stack
465** overflow for some forms of deep constructs.
466** ===================================================================
467*/
468
469
470/*
471@@ LUAI_MAXCCALLS is the maximum depth for nested C calls (short) and
472@* syntactical nested non-terminals in a program.
473*/
474#define LUAI_MAXCCALLS200
475
476
477/*
478@@ LUAI_MAXVARS is the maximum number of local variables per function
479@* (must be smaller than 250).
480*/
481#define LUAI_MAXVARS200
482
483
484/*
485@@ LUAI_MAXUPVALUES is the maximum number of upvalues per function
486@* (must be smaller than 250).
487*/
488#define LUAI_MAXUPVALUES60
489
490
491/*
492@@ LUAL_BUFFERSIZE is the buffer size used by the lauxlib buffer system.
493*/
494#define LUAL_BUFFERSIZEBUFSIZ
495
496/* }================================================================== */
497
498
499
500
501/*
502** {==================================================================
503@@ LUA_NUMBER is the type of numbers in Lua.
504** CHANGE the following definitions only if you want to build Lua
505** with a number type different from double. You may also need to
506** change lua_number2int & lua_number2integer.
507** ===================================================================
508*/
509
510#define LUA_NUMBER_DOUBLE
511#define LUA_NUMBERdouble
512
513/*
514@@ LUAI_UACNUMBER is the result of an 'usual argument conversion'
515@* over a number.
516*/
517#define LUAI_UACNUMBERdouble
518
519
520/*
521@@ LUA_NUMBER_SCAN is the format for reading numbers.
522@@ LUA_NUMBER_FMT is the format for writing numbers.
523@@ lua_number2str converts a number to a string.
524@@ LUAI_MAXNUMBER2STR is maximum size of previous conversion.
525@@ lua_str2number converts a string to a number.
526*/
527#define LUA_NUMBER_SCAN"%lf"
528#define LUA_NUMBER_FMT"%.14g"
529#define lua_number2str(s,n)sprintf((s), LUA_NUMBER_FMT, (n))
530#define LUAI_MAXNUMBER2STR32 /* 16 digits, sign, point, and \0 */
531#define lua_str2number(s,p)strtod((s), (p))
532
533
534/*
535@@ The luai_num* macros define the primitive operations over numbers.
536*/
537#if defined(LUA_CORE)
538#include <math.h>
539#define luai_numadd(a,b)((a)+(b))
540#define luai_numsub(a,b)((a)-(b))
541#define luai_nummul(a,b)((a)*(b))
542#define luai_numdiv(a,b)((a)/(b))
543#define luai_nummod(a,b)((a) - floor((a)/(b))*(b))
544#define luai_numpow(a,b)(pow(a,b))
545#define luai_numunm(a)(-(a))
546#define luai_numeq(a,b)((a)==(b))
547#define luai_numlt(a,b)((a)<(b))
548#define luai_numle(a,b)((a)<=(b))
549#define luai_numisnan(a)(!luai_numeq((a), (a)))
550#endif
551
552
553/*
554@@ lua_number2int is a macro to convert lua_Number to int.
555@@ lua_number2integer is a macro to convert lua_Number to lua_Integer.
556** CHANGE them if you know a faster way to convert a lua_Number to
557** int (with any rounding method and without throwing errors) in your
558** system. In Pentium machines, a naive typecast from double to int
559** in C is extremely slow, so any alternative is worth trying.
560*/
561
562/* Monotone local: lrint() is what we really want, but it's C99, so we
563 can't assume it. Also, remove horrible union hack that cannot be
564 relied upon. Note that if LUA_NUMBER_DOUBLE is not defined, no
565 special handling is necessary. */
566
567#if defined(LUA_NUMBER_DOUBLE) && defined(HAVE_LRINT)
568#define lua_number2int(i,d) ((i) = lrint(d))
569#define lua_number2integer(i,n) ((i) = lrint(n))
570
571/* On a Microsoft compiler on x86 and not SSE2, use assembler */
572#elif defined(LUA_NUMBER_DOUBLE) && defined(_MSC_VER)\
573 && (defined(__i386) || defined(__i386__) || defined(_M_IX86))\
574 && !defined(__SSE2__)
575
576#define lua_number2int(i,d) __asm fld d __asm fistp i
577#define lua_number2integer(i,n)lua_number2int(i, n)
578
579/* this option always works, but may be slow */
580#else
581
582#define lua_number2int(i,d)((i)=(int)(d))
583#define lua_number2integer(i,d)((i)=(lua_Integer)(d))
584
585#endif
586
587/* }================================================================== */
588
589
590/*
591@@ LUAI_USER_ALIGNMENT_T is a type that requires maximum alignment.
592** CHANGE it if your system requires alignments larger than double. (For
593** instance, if your system supports long doubles and they must be
594** aligned in 16-byte boundaries, then you should add long double in the
595** union.) Probably you do not need to change this.
596*/
597#define LUAI_USER_ALIGNMENT_Tunion { double u; void *s; long l; }
598
599
600/*
601@@ LUAI_THROW/LUAI_TRY define how Lua does exception handling.
602** CHANGE them if you prefer to use longjmp/setjmp even with C++
603** or if want/don't to use _longjmp/_setjmp instead of regular
604** longjmp/setjmp. By default, Lua handles errors with exceptions when
605** compiling as C++ code, with _longjmp/_setjmp when asked to use them,
606** and with longjmp/setjmp otherwise.
607*/
608#if defined(__cplusplus)
609/* C++ exceptions */
610#define LUAI_THROW(L,c)throw(c)
611#define LUAI_TRY(L,c,a)try { a } catch(...) \
612{ if ((c)->status == 0) (c)->status = -1; }
613#define luai_jmpbufint /* dummy variable */
614
615#elif defined(LUA_USE_ULONGJMP)
616/* in Unix, try _longjmp/_setjmp (more efficient) */
617#define LUAI_THROW(L,c)_longjmp((c)->b, 1)
618#define LUAI_TRY(L,c,a)if (_setjmp((c)->b) == 0) { a }
619#define luai_jmpbufjmp_buf
620
621#else
622/* default handling with long jumps */
623#define LUAI_THROW(L,c)longjmp((c)->b, 1)
624#define LUAI_TRY(L,c,a)if (setjmp((c)->b) == 0) { a }
625#define luai_jmpbufjmp_buf
626
627#endif
628
629
630/*
631@@ LUA_MAXCAPTURES is the maximum number of captures that a pattern
632@* can do during pattern-matching.
633** CHANGE it if you need more captures. This limit is arbitrary.
634*/
635#define LUA_MAXCAPTURES32
636
637
638/*
639@@ lua_tmpnam is the function that the OS library uses to create a
640@* temporary name.
641@@ LUA_TMPNAMBUFSIZE is the maximum size of a name created by lua_tmpnam.
642** CHANGE them if you have an alternative to tmpnam (which is considered
643** insecure) or if you want the original tmpnam anyway. By default, Lua
644** uses tmpnam except when POSIX is available, where it uses mkstemp.
645*/
646#if defined(loslib_c) || defined(luaall_c)
647
648#if defined(LUA_USE_MKSTEMP)
649#include <unistd.h>
650#define LUA_TMPNAMBUFSIZE32
651#define lua_tmpnam(b,e){ \
652strcpy(b, "/tmp/lua_XXXXXX"); \
653e = mkstemp(b); \
654if (e != -1) close(e); \
655e = (e == -1); }
656
657#else
658#define LUA_TMPNAMBUFSIZEL_tmpnam
659#define lua_tmpnam(b,e){ e = (tmpnam(b) == NULL); }
660#endif
661
662#endif
663
664
665/*
666@@ lua_popen spawns a new process connected to the current one through
667@* the file streams.
668** CHANGE it if you have a way to implement it in your system.
669*/
670#if defined(LUA_USE_POPEN)
671
672#define lua_popen(L,c,m)((void)L, popen(c,m))
673#define lua_pclose(L,file)((void)L, (pclose(file) != -1))
674
675#elif defined(LUA_WIN)
676
677#define lua_popen(L,c,m)((void)L, _popen(c,m))
678#define lua_pclose(L,file)((void)L, (_pclose(file) != -1))
679
680#else
681
682#define lua_popen(L,c,m)((void)((void)c, m), \
683luaL_error(L, LUA_QL("popen") " not supported"), (FILE*)0)
684#define lua_pclose(L,file)((void)((void)L, file), 0)
685
686#endif
687
688/*
689@@ LUA_DL_* define which dynamic-library system Lua should use.
690** CHANGE here if Lua has problems choosing the appropriate
691** dynamic-library system for your platform (either Windows' DLL, Mac's
692** dyld, or Unix's dlopen). If your system is some kind of Unix, there
693** is a good chance that it has dlopen, so LUA_DL_DLOPEN will work for
694** it. To use dlopen you also need to adapt the src/Makefile (probably
695** adding -ldl to the linker options), so Lua does not select it
696** automatically. (When you change the makefile to add -ldl, you must
697** also add -DLUA_USE_DLOPEN.)
698** If you do not want any kind of dynamic library, undefine all these
699** options.
700** By default, _WIN32 gets LUA_DL_DLL and MAC OS X gets LUA_DL_DYLD.
701*/
702#if defined(LUA_USE_DLOPEN)
703#define LUA_DL_DLOPEN
704#endif
705
706#if defined(LUA_WIN)
707#define LUA_DL_DLL
708#endif
709
710
711/*
712@@ LUAI_EXTRASPACE allows you to add user-specific data in a lua_State
713@* (the data goes just *before* the lua_State pointer).
714** CHANGE (define) this if you really need that. This value must be
715** a multiple of the maximum alignment required for your machine.
716*/
717#define LUAI_EXTRASPACE0
718
719
720/*
721@@ luai_userstate* allow user-specific actions on threads.
722** CHANGE them if you defined LUAI_EXTRASPACE and need to do something
723** extra when a thread is created/deleted/resumed/yielded.
724*/
725#define luai_userstateopen(L)((void)L)
726#define luai_userstateclose(L)((void)L)
727#define luai_userstatethread(L,L1)((void)L)
728#define luai_userstatefree(L)((void)L)
729#define luai_userstateresume(L,n)((void)L)
730#define luai_userstateyield(L,n)((void)L)
731
732
733/*
734@@ LUA_INTFRMLEN is the length modifier for integer conversions
735@* in 'string.format'.
736@@ LUA_INTFRM_T is the integer type correspoding to the previous length
737@* modifier.
738** CHANGE them if your system supports long long or does not support long.
739*/
740
741#if defined(LUA_USELONGLONG)
742
743#define LUA_INTFRMLEN"ll"
744#define LUA_INTFRM_Tlong long
745
746#else
747
748#define LUA_INTFRMLEN"l"
749#define LUA_INTFRM_Tlong
750
751#endif
752
753
754
755/* =================================================================== */
756
757/*
758** Local configuration. You can use this space to add your redefinitions
759** without modifying the main part of the file.
760*/
761
762/* Monotone local: make absolutely sure loadlib is a stub. */
763#undef LUA_DL_DLOPEN
764#undef LUA_DL_DLL
765#undef LUA_DL_DYLD
766
767
768#endif
769

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status