aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--luaconf.h55
1 files changed, 41 insertions, 14 deletions
diff --git a/luaconf.h b/luaconf.h
index c4bd3d51..219bfaa4 100644
--- a/luaconf.h
+++ b/luaconf.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: luaconf.h,v 1.67 2005/09/14 17:44:48 roberto Exp roberto $ 2** $Id: luaconf.h,v 1.68 2005/09/19 13:49:12 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*/
@@ -19,8 +19,6 @@
19*/ 19*/
20 20
21 21
22
23
24/* 22/*
25@@ LUA_ANSI controls the use of non-ansi features. 23@@ LUA_ANSI controls the use of non-ansi features.
26** CHANGE it (define it) if you want Lua to avoid the use of any 24** CHANGE it (define it) if you want Lua to avoid the use of any
@@ -31,6 +29,33 @@
31#endif 29#endif
32 30
33 31
32#if !defined(LUA_ANSI)
33
34#if defined(__linux__)
35#define LUA_USE_MKSTEMP
36#define LUA_USE_ISATTY
37#define LUA_USE_ULONGJMP
38#define LUA_USE_POPEN
39#endif
40
41#if defined(__APPLE__) && defined(__MACH__)
42#define LUA_USE_MKSTEMP
43#define LUA_USE_ISATTY
44#define LUA_USE_ULONGJMP
45#define LUA_USE_POPEN
46#define LUA_DL_DYLD
47#endif
48
49#if defined(_WIN32)
50#define LUA_DL_DLL
51#endif
52
53#endif
54
55
56
57
58
34/* 59/*
35@@ LUA_PATH_DEFAULT is the default path that Lua uses to look for 60@@ LUA_PATH_DEFAULT is the default path that Lua uses to look for
36@* Lua libraries. 61@* Lua libraries.
@@ -141,10 +166,12 @@
141#if defined(luaall_c) 166#if defined(luaall_c)
142#define LUAI_FUNC static 167#define LUAI_FUNC static
143#define LUAI_DATA /* empty */ 168#define LUAI_DATA /* empty */
169
144#elif defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 302) && \ 170#elif defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 302) && \
145 defined(__ELF__) 171 defined(__ELF__)
146#define LUAI_FUNC __attribute__((visibility("hidden"))) extern 172#define LUAI_FUNC __attribute__((visibility("hidden"))) extern
147#define LUAI_DATA LUAI_FUNC 173#define LUAI_DATA LUAI_FUNC
174
148#else 175#else
149#define LUAI_FUNC extern 176#define LUAI_FUNC extern
150#define LUAI_DATA extern 177#define LUAI_DATA extern
@@ -189,7 +216,7 @@
189** CHANGE it if you have a better definition for non-POSIX/non-Windows 216** CHANGE it if you have a better definition for non-POSIX/non-Windows
190** systems. 217** systems.
191*/ 218*/
192#if !defined(LUA_ANSI) && defined(_POSIX_C_SOURCE) 219#if defined(LUA_USE_ISATTY)
193#include <unistd.h> 220#include <unistd.h>
194#define lua_stdin_is_tty() isatty(0) 221#define lua_stdin_is_tty() isatty(0)
195#elif !defined(LUA_ANSI) && defined(_WIN32) 222#elif !defined(LUA_ANSI) && defined(_WIN32)
@@ -517,6 +544,8 @@ union luai_Cast { double l_d; long l_l; };
517/* 544/*
518@@ The luai_num* macros define the primitive operations over numbers. 545@@ The luai_num* macros define the primitive operations over numbers.
519*/ 546*/
547#if defined(LUA_CORE)
548#include <math.h>
520#define luai_numadd(L,a,b) ((a)+(b)) 549#define luai_numadd(L,a,b) ((a)+(b))
521#define luai_numsub(L,a,b) ((a)-(b)) 550#define luai_numsub(L,a,b) ((a)-(b))
522#define luai_nummul(L,a,b) ((a)*(b)) 551#define luai_nummul(L,a,b) ((a)*(b))
@@ -527,6 +556,7 @@ union luai_Cast { double l_d; long l_l; };
527#define luai_numeq(L,a,b) ((a)==(b)) 556#define luai_numeq(L,a,b) ((a)==(b))
528#define luai_numlt(L,a,b) ((a)<(b)) 557#define luai_numlt(L,a,b) ((a)<(b))
529#define luai_numle(L,a,b) ((a)<=(b)) 558#define luai_numle(L,a,b) ((a)<=(b))
559#endif
530 560
531/* }================================================================== */ 561/* }================================================================== */
532 562
@@ -589,7 +619,7 @@ union luai_Cast { double l_d; long l_l; };
589*/ 619*/
590#if defined(loslib_c) || defined(luaall_c) 620#if defined(loslib_c) || defined(luaall_c)
591 621
592#if !defined(LUA_ANSI) && defined(_POSIX_C_SOURCE) 622#if defined(LUA_USE_MKSTEMP)
593#include <unistd.h> 623#include <unistd.h>
594#define LUA_TMPNAMBUFSIZE 32 624#define LUA_TMPNAMBUFSIZE 32
595#define lua_tmpnam(b,e) { \ 625#define lua_tmpnam(b,e) { \
@@ -597,6 +627,7 @@ union luai_Cast { double l_d; long l_l; };
597 e = mkstemp(b); \ 627 e = mkstemp(b); \
598 if (e != -1) close(e); \ 628 if (e != -1) close(e); \
599 e = (e == -1); } 629 e = (e == -1); }
630
600#else 631#else
601#define LUA_TMPNAMBUFSIZE L_tmpnam 632#define LUA_TMPNAMBUFSIZE L_tmpnam
602#define lua_tmpnam(b,e) { e = (tmpnam(b) == NULL); } 633#define lua_tmpnam(b,e) { e = (tmpnam(b) == NULL); }
@@ -610,7 +641,7 @@ union luai_Cast { double l_d; long l_l; };
610@* the file streams. 641@* the file streams.
611** CHANGE it if you have a way to implement it in your system. 642** CHANGE it if you have a way to implement it in your system.
612*/ 643*/
613#if !defined(LUA_ANSI) && defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 2 644#if defined(LUA_USE_POPEN)
614 645
615#define lua_popen(L,c,m) popen(c,m) 646#define lua_popen(L,c,m) popen(c,m)
616#define lua_pclose(L,file) (pclose(file) != -1) 647#define lua_pclose(L,file) (pclose(file) != -1)
@@ -639,17 +670,12 @@ union luai_Cast { double l_d; long l_l; };
639** automatically. (When you change the makefile to add -ldl, you must 670** automatically. (When you change the makefile to add -ldl, you must
640** also add -DLUA_USE_DLOPEN.) 671** also add -DLUA_USE_DLOPEN.)
641** If you do not want any kind of dynamic library, undefine all these 672** If you do not want any kind of dynamic library, undefine all these
642** options (or just remove these definitions). 673** options.
674** By default, _WIN32 gets LUA_DL_DLL and MAC OS X gets LUA_DL_DYLD.
643*/ 675*/
644#if !defined(LUA_ANSI) 676#if defined(LUA_USE_DLOPEN)
645#if defined(_WIN32)
646#define LUA_DL_DLL
647#elif defined(__APPLE__) && defined(__MACH__)
648#define LUA_DL_DYLD
649#elif defined(LUA_USE_DLOPEN)
650#define LUA_DL_DLOPEN 677#define LUA_DL_DLOPEN
651#endif 678#endif
652#endif
653 679
654 680
655/* 681/*
@@ -667,6 +693,7 @@ union luai_Cast { double l_d; long l_l; };
667** extra when a thread is created/deleted/resumed/yielded. 693** extra when a thread is created/deleted/resumed/yielded.
668*/ 694*/
669#define luai_userstateopen(L) ((void)0) 695#define luai_userstateopen(L) ((void)0)
696#define luai_userstateclose(L) ((void)0)
670#define luai_userstatethread(L,L1) ((void)0) 697#define luai_userstatethread(L,L1) ((void)0)
671#define luai_userstatefree(L) ((void)0) 698#define luai_userstatefree(L) ((void)0)
672#define luai_userstateresume(L,n) ((void)0) 699#define luai_userstateresume(L,n) ((void)0)