浏览代码

new macro LUA_COMPAT to control some compatibility macros

Roberto Ierusalimschy 17 年之前
父节点
当前提交
6b8725b0ee
共有 2 个文件被更改,包括 12 次插入2 次删除
  1. 3 1
      lua.h
  2. 9 1
      luaconf.h

+ 3 - 1
lua.h

@@ -1,5 +1,5 @@
 /*
 /*
-** $Id: lua.h,v 1.227 2008/02/11 19:16:02 roberto Exp roberto $
+** $Id: lua.h,v 1.228 2008/05/09 16:51:44 roberto Exp roberto $
 ** Lua - An Extensible Extension Language
 ** Lua - An Extensible Extension Language
 ** Lua.org, PUC-Rio, Brazil (http://www.lua.org)
 ** Lua.org, PUC-Rio, Brazil (http://www.lua.org)
 ** See Copyright Notice at the end of this file
 ** See Copyright Notice at the end of this file
@@ -282,6 +282,7 @@ LUA_API void lua_setallocf (lua_State *L, lua_Alloc f, void *ud);
 /*
 /*
 ** compatibility macros and functions
 ** compatibility macros and functions
 */
 */
+#if defined(LUA_COMPAT)
 
 
 #define lua_strlen(L,i)		lua_objlen(L, (i))
 #define lua_strlen(L,i)		lua_objlen(L, (i))
 
 
@@ -294,6 +295,7 @@ LUA_API void lua_setallocf (lua_State *L, lua_Alloc f, void *ud);
 #define lua_Chunkreader		lua_Reader
 #define lua_Chunkreader		lua_Reader
 #define lua_Chunkwriter		lua_Writer
 #define lua_Chunkwriter		lua_Writer
 
 
+#endif
 
 
 
 
 /*
 /*

+ 9 - 1
luaconf.h

@@ -1,5 +1,5 @@
 /*
 /*
-** $Id: luaconf.h,v 1.97 2008/04/07 18:58:42 roberto Exp roberto $
+** $Id: luaconf.h,v 1.98 2008/06/25 15:27:12 roberto Exp roberto $
 ** Configuration file for Lua
 ** Configuration file for Lua
 ** See Copyright Notice in lua.h
 ** See Copyright Notice in lua.h
 */
 */
@@ -323,6 +323,14 @@
 
 
 
 
 
 
+/*
+@@ LUA_COMPAT includes some macros and functions that supply some
+@* compatibility with previous versions.
+** CHANGE it (undefine it) if you do not need these compatibility facilities.
+*/
+#define LUA_COMPAT
+
+
 /*
 /*
 @@ LUA_COMPAT_VARARG controls compatibility with old vararg feature.
 @@ LUA_COMPAT_VARARG controls compatibility with old vararg feature.
 ** CHANGE it to undefined as soon as your programs use only '...' to
 ** CHANGE it to undefined as soon as your programs use only '...' to