diff options
Diffstat (limited to '')
| -rw-r--r-- | liolib.c | 12 | ||||
| -rw-r--r-- | llimits.h | 6 | ||||
| -rw-r--r-- | loadlib.c | 26 |
3 files changed, 9 insertions, 35 deletions
| @@ -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 | ||
| @@ -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 | /* |
| @@ -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 | |||
| 166 | static int loadlib(lua_State *L) | 146 | static int loadlib(lua_State *L) |
| 167 | { | 147 | { |
| 168 | lua_pushnil(L); | 148 | lua_pushnil(L); |
