mirror of
https://github.com/lua/lua.git
synced 2025-01-28 06:03:00 +08:00
ok to use #elif' and
#if defined()'
This commit is contained in:
parent
524ae9fc3d
commit
f93051155c
12
liolib.c
12
liolib.c
@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: liolib.c,v 2.41 2003/04/30 20:24:38 roberto Exp roberto $
|
||||
** $Id: liolib.c,v 2.42 2003/05/14 19:03:43 roberto Exp roberto $
|
||||
** Standard I/O (and system) library
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@ -37,16 +37,12 @@
|
||||
** by default, posix systems get `popen'
|
||||
*/
|
||||
#ifndef USE_POPEN
|
||||
#ifdef _POSIX_C_SOURCE
|
||||
#if _POSIX_C_SOURCE >= 2
|
||||
#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 2
|
||||
#define USE_POPEN 1
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef USE_POPEN
|
||||
#else
|
||||
#define USE_POPEN 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: llimits.h,v 1.53 2003/04/28 19:26:16 roberto Exp roberto $
|
||||
** $Id: llimits.h,v 1.54 2003/04/28 19:57:50 roberto Exp roberto $
|
||||
** Limits, basic types, and some other `installation-dependent' definitions
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@ -22,15 +22,13 @@
|
||||
/* avoid overflows in comparison */
|
||||
#if INT_MAX-20 < 32760
|
||||
#define BITS_INT 16
|
||||
#else
|
||||
#if INT_MAX > 2147483640L
|
||||
#elif INT_MAX > 2147483640L
|
||||
/* machine has at least 32 bits */
|
||||
#define BITS_INT 32
|
||||
#else
|
||||
#error "you must define BITS_INT with number of bits in an integer"
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
|
26
loadlib.c
26
loadlib.c
@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: loadlib.c,v 1.3 2003/04/02 13:09:14 roberto Exp roberto $
|
||||
** $Id: loadlib.c,v 1.4 2003/04/07 20:11:53 roberto Exp roberto $
|
||||
** Dynamic library loader for Lua
|
||||
** See Copyright Notice in lua.h
|
||||
*
|
||||
@ -136,33 +136,13 @@ static int loadlib(lua_State *L)
|
||||
** Those systems support dlopen, so they should have defined USE_DLOPEN.
|
||||
** The default (no)implementation gives them a special error message.
|
||||
*/
|
||||
#ifdef linux
|
||||
#define LOADLIB
|
||||
#endif
|
||||
|
||||
#ifdef sun
|
||||
#define LOADLIB
|
||||
#endif
|
||||
|
||||
#ifdef sgi
|
||||
#define LOADLIB
|
||||
#endif
|
||||
|
||||
#ifdef BSD
|
||||
#define LOADLIB
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#define LOADLIB
|
||||
#endif
|
||||
|
||||
#ifdef LOADLIB
|
||||
#undef LOADLIB
|
||||
#if defined(linux) || defined(sun) || defined(sgi) || defined(BSD) || defined(_WIN32)
|
||||
#define LOADLIB "`loadlib' not installed (check your Lua configuration)"
|
||||
#else
|
||||
#define LOADLIB "`loadlib' not supported"
|
||||
#endif
|
||||
|
||||
|
||||
static int loadlib(lua_State *L)
|
||||
{
|
||||
lua_pushnil(L);
|
||||
|
Loading…
x
Reference in New Issue
Block a user