aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2003-05-14 18:01:53 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2003-05-14 18:01:53 -0300
commitf93051155c4a5e7b56f892c2b9222f38b40d3e81 (patch)
tree9e5a5747035de1d22cd7b1e6074a7b7720ecba00
parent524ae9fc3dd8acc69d587c3ed0599d8c95205381 (diff)
downloadlua-f93051155c4a5e7b56f892c2b9222f38b40d3e81.tar.gz
lua-f93051155c4a5e7b56f892c2b9222f38b40d3e81.tar.bz2
lua-f93051155c4a5e7b56f892c2b9222f38b40d3e81.zip
ok to use `#elif' and `#if defined()'
-rw-r--r--liolib.c12
-rw-r--r--llimits.h6
-rw-r--r--loadlib.c26
3 files changed, 9 insertions, 35 deletions
diff --git a/liolib.c b/liolib.c
index 02786883..4e9ddb7e 100644
--- a/liolib.c
+++ b/liolib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: liolib.c,v 2.41 2003/04/30 20:24:38 roberto Exp roberto $ 2** $Id: liolib.c,v 2.42 2003/05/14 19:03:43 roberto Exp roberto $
3** Standard I/O (and system) library 3** Standard I/O (and system) library
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -37,16 +37,12 @@
37** by default, posix systems get `popen' 37** by default, posix systems get `popen'
38*/ 38*/
39#ifndef USE_POPEN 39#ifndef USE_POPEN
40#ifdef _POSIX_C_SOURCE 40#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 2
41#if _POSIX_C_SOURCE >= 2
42#define USE_POPEN 1 41#define USE_POPEN 1
43#endif 42#else
44#endif
45#endif
46
47#ifndef USE_POPEN
48#define USE_POPEN 0 43#define USE_POPEN 0
49#endif 44#endif
45#endif
50 46
51 47
52 48
diff --git a/llimits.h b/llimits.h
index 6ca0f676..1d480e88 100644
--- a/llimits.h
+++ b/llimits.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: llimits.h,v 1.53 2003/04/28 19:26:16 roberto Exp roberto $ 2** $Id: llimits.h,v 1.54 2003/04/28 19:57:50 roberto Exp roberto $
3** Limits, basic types, and some other `installation-dependent' definitions 3** Limits, basic types, and some other `installation-dependent' definitions
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -22,15 +22,13 @@
22/* avoid overflows in comparison */ 22/* avoid overflows in comparison */
23#if INT_MAX-20 < 32760 23#if INT_MAX-20 < 32760
24#define BITS_INT 16 24#define BITS_INT 16
25#else 25#elif INT_MAX > 2147483640L
26#if INT_MAX > 2147483640L
27/* machine has at least 32 bits */ 26/* machine has at least 32 bits */
28#define BITS_INT 32 27#define BITS_INT 32
29#else 28#else
30#error "you must define BITS_INT with number of bits in an integer" 29#error "you must define BITS_INT with number of bits in an integer"
31#endif 30#endif
32#endif 31#endif
33#endif
34 32
35 33
36/* 34/*
diff --git a/loadlib.c b/loadlib.c
index ed40fbe4..961eeab5 100644
--- a/loadlib.c
+++ b/loadlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: loadlib.c,v 1.3 2003/04/02 13:09:14 roberto Exp roberto $ 2** $Id: loadlib.c,v 1.4 2003/04/07 20:11:53 roberto Exp roberto $
3** Dynamic library loader for Lua 3** Dynamic library loader for Lua
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5* 5*
@@ -136,33 +136,13 @@ static int loadlib(lua_State *L)
136** Those systems support dlopen, so they should have defined USE_DLOPEN. 136** Those systems support dlopen, so they should have defined USE_DLOPEN.
137** The default (no)implementation gives them a special error message. 137** The default (no)implementation gives them a special error message.
138*/ 138*/
139#ifdef linux 139#if defined(linux) || defined(sun) || defined(sgi) || defined(BSD) || defined(_WIN32)
140#define LOADLIB
141#endif
142
143#ifdef sun
144#define LOADLIB
145#endif
146
147#ifdef sgi
148#define LOADLIB
149#endif
150
151#ifdef BSD
152#define LOADLIB
153#endif
154
155#ifdef _WIN32
156#define LOADLIB
157#endif
158
159#ifdef LOADLIB
160#undef LOADLIB
161#define LOADLIB "`loadlib' not installed (check your Lua configuration)" 140#define LOADLIB "`loadlib' not installed (check your Lua configuration)"
162#else 141#else
163#define LOADLIB "`loadlib' not supported" 142#define LOADLIB "`loadlib' not supported"
164#endif 143#endif
165 144
145
166static int loadlib(lua_State *L) 146static int loadlib(lua_State *L)
167{ 147{
168 lua_pushnil(L); 148 lua_pushnil(L);