LUA_COMPAT2.5 may use #ifdef instead of #if

This commit is contained in:
Roberto Ierusalimschy 1998-01-02 15:46:32 -02:00
parent 90d87e3a78
commit 964c503a63
5 changed files with 13 additions and 17 deletions

4
lapi.c
View File

@ -1,5 +1,5 @@
/*
** $Id: lapi.c,v 1.15 1997/12/18 18:32:39 roberto Exp roberto $
** $Id: lapi.c,v 1.16 1997/12/22 17:52:20 roberto Exp roberto $
** Lua API
** See Copyright Notice in lua.h
*/
@ -580,7 +580,7 @@ lua_Object lua_getref (int ref)
#if LUA_COMPAT2_5
#ifdef LUA_COMPAT2_5
/*
** API: set a function as a fallback
*/

View File

@ -1,5 +1,5 @@
/*
** $Id: lbuiltin.c,v 1.19 1997/12/18 18:32:39 roberto Exp roberto $
** $Id: lbuiltin.c,v 1.20 1997/12/30 17:57:45 roberto Exp roberto $
** Built-in functions
** See Copyright Notice in lua.h
*/
@ -464,7 +464,7 @@ static void testC (void)
** Internal functions
*/
static struct luaL_reg int_funcs[] = {
#if LUA_COMPAT2_5
#ifdef LUA_COMPAT2_5
{"setfallback", luaT_setfallback},
#endif
#ifdef DEBUG

4
ltm.c
View File

@ -1,5 +1,5 @@
/*
** $Id: ltm.c,v 1.11 1997/12/11 17:21:11 roberto Exp roberto $
** $Id: ltm.c,v 1.12 1997/12/15 16:17:20 roberto Exp roberto $
** Tag methods
** See Copyright Notice in lua.h
*/
@ -174,7 +174,7 @@ char *luaT_travtagmethods (int (*fn)(TObject *))
* ===================================================================
* compatibility with old fallback system
*/
#if LUA_COMPAT2_5
#ifdef LUA_COMPAT2_5
#include "lapi.h"

10
lua.h
View File

@ -1,5 +1,5 @@
/*
** $Id: lua.h,v 1.11 1997/12/15 17:47:55 roberto Exp roberto $
** $Id: lua.h,v 1.12 1997/12/18 18:32:39 roberto Exp roberto $
** Lua - An Extensible Extension Language
** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil
** e-mail: lua@tecgraf.puc-rio.br
@ -146,15 +146,11 @@ long lua_collectgarbage (long limit);
/* ==========================================================================
** for compatibility with old versions. Avoid using these macros/functions
** If your program does not use any of these, define LUA_COMPAT2_5 to 0
** If your program does need any of these, define LUA_COMPAT2_5
*/
#ifndef LUA_COMPAT2_5
#define LUA_COMPAT2_5 1
#endif
#if LUA_COMPAT2_5
#ifdef LUA_COMPAT2_5
lua_Object lua_setfallback (char *event, lua_CFunction fallback);

View File

@ -1,5 +1,5 @@
#
## $Id: makefile,v 1.7 1997/12/17 20:48:58 roberto Exp roberto $
## $Id: makefile,v 1.8 1997/12/23 19:24:36 roberto Exp roberto $
## Makefile
## See Copyright Notice in lua.h
#
@ -15,11 +15,11 @@
# facilities ("strerror" and "locale.h"). Although they are ANSI,
# SunOS does not comply; so, add "-DOLD_ANSI" on SunOS
#
# define LUA_COMPAT2_5=0 if yous system does not need to be compatible with
# define LUA_COMPAT2_5 if yous system does need to be compatible with
# version 2.5 (or older)
CONFIG = -DPOPEN -D_POSIX_SOURCE -DLUA_COMPAT2_5=0
#CONFIG = -DLUA_COMPAT2_5=0 -DOLD_ANSI -DDEBUG
CONFIG = -DPOPEN -D_POSIX_SOURCE
#CONFIG = -DLUA_COMPAT2_5 -DOLD_ANSI -DDEBUG
# Compilation parameters