소스 검색

macro 'mark' renamed 'EOFMARK' ('mark' is too easy to confict, e.g.
in alllua.c)

Roberto Ierusalimschy 14 년 전
부모
커밋
682cce3813
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 4
      lua.c

+ 4 - 4
lua.c

@@ -1,5 +1,5 @@
 /*
 /*
-** $Id: lua.c,v 1.195 2010/12/03 17:20:50 roberto Exp roberto $
+** $Id: lua.c,v 1.196 2011/02/07 12:27:13 roberto Exp roberto $
 ** Lua stand-alone interpreter
 ** Lua stand-alone interpreter
 ** See Copyright Notice in lua.h
 ** See Copyright Notice in lua.h
 */
 */
@@ -245,14 +245,14 @@ static const char *get_prompt (lua_State *L, int firstline) {
 }
 }
 
 
 /* mark in error messages for incomplete statements */
 /* mark in error messages for incomplete statements */
-#define mark	"<eof>"
-#define marklen	(sizeof(mark) - 1)
+#define EOFMARK		"<eof>"
+#define marklen		(sizeof(EOFMARK) - 1)
 
 
 static int incomplete (lua_State *L, int status) {
 static int incomplete (lua_State *L, int status) {
   if (status == LUA_ERRSYNTAX) {
   if (status == LUA_ERRSYNTAX) {
     size_t lmsg;
     size_t lmsg;
     const char *msg = lua_tolstring(L, -1, &lmsg);
     const char *msg = lua_tolstring(L, -1, &lmsg);
-    if (lmsg >= marklen && strcmp(msg + lmsg - marklen, mark) == 0) {
+    if (lmsg >= marklen && strcmp(msg + lmsg - marklen, EOFMARK) == 0) {
       lua_pop(L, 1);
       lua_pop(L, 1);
       return 1;
       return 1;
     }
     }