commit 35023355f21d2c508e2614dc8383d7535dd3a80a
parent 39b79783297bee79db9853b63d199e120a009a8f
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Fri, 23 Feb 2001 14:27:50 -0300
details for wchar
Diffstat:
8 files changed, 30 insertions(+), 26 deletions(-)
diff --git a/lapi.c b/lapi.c
@@ -1,5 +1,5 @@
/*
-** $Id: lapi.c,v 1.132 2001/02/22 18:59:59 roberto Exp roberto $
+** $Id: lapi.c,v 1.133 2001/02/23 17:17:25 roberto Exp roberto $
** Lua API
** See Copyright Notice in lua.h
*/
@@ -22,8 +22,8 @@
#include "lvm.h"
-const l_char lua_ident[] = l_s("$Lua: ") l_s(LUA_VERSION) l_s(" ")
- l_s(LUA_COPYRIGHT) l_s(" $\n") l_s("$Authors: ") l_s(LUA_AUTHORS) l_s(" $");
+const l_char lua_ident[] = l_s("$Lua: ") LUA_VERSION l_s(" ")
+ LUA_COPYRIGHT l_s(" $\n") l_s("$Authors: ") LUA_AUTHORS l_s(" $");
diff --git a/lbaselib.c b/lbaselib.c
@@ -1,5 +1,5 @@
/*
-** $Id: lbaselib.c,v 1.26 2001/02/22 18:59:59 roberto Exp roberto $
+** $Id: lbaselib.c,v 1.27 2001/02/23 17:17:25 roberto Exp roberto $
** Basic library
** See Copyright Notice in lua.h
*/
@@ -35,7 +35,7 @@ static int luaB__ALERT (lua_State *L) {
*/
static int luaB__ERRORMESSAGE (lua_State *L) {
luaL_checktype(L, 1, LUA_TSTRING);
- lua_getglobal(L, l_s(LUA_ALERT));
+ lua_getglobal(L, LUA_ALERT);
if (lua_isfunction(L, -1)) { /* avoid error loop if _ALERT is not defined */
lua_Debug ar;
lua_pushliteral(L, l_s("error: "));
@@ -305,10 +305,10 @@ static int luaB_call (lua_State *L) {
luaL_checktype(L, 2, LUA_TTABLE);
n = lua_getn(L, 2);
if (!lua_isnull(L, 4)) { /* set new error method */
- lua_getglobal(L, l_s(LUA_ERRORMESSAGE));
+ lua_getglobal(L, LUA_ERRORMESSAGE);
err = lua_gettop(L); /* get index */
lua_pushvalue(L, 4);
- lua_setglobal(L, l_s(LUA_ERRORMESSAGE));
+ lua_setglobal(L, LUA_ERRORMESSAGE);
}
oldtop = lua_gettop(L); /* top before function-call preparation */
/* push function */
@@ -319,7 +319,7 @@ static int luaB_call (lua_State *L) {
status = lua_call(L, n, LUA_MULTRET);
if (err != 0) { /* restore old error method */
lua_pushvalue(L, err);
- lua_setglobal(L, l_s(LUA_ERRORMESSAGE));
+ lua_setglobal(L, LUA_ERRORMESSAGE);
}
if (status != 0) { /* error in call? */
if (strchr(options, l_c('x')))
@@ -637,8 +637,8 @@ static void deprecated_funcs (lua_State *L) {
/* }====================================================== */
static const luaL_reg base_funcs[] = {
- {l_s(LUA_ALERT), luaB__ALERT},
- {l_s(LUA_ERRORMESSAGE), luaB__ERRORMESSAGE},
+ {LUA_ALERT, luaB__ALERT},
+ {LUA_ERRORMESSAGE, luaB__ERRORMESSAGE},
{l_s("call"), luaB_call},
{l_s("collectgarbage"), luaB_collectgarbage},
{l_s("copytagmethods"), luaB_copytagmethods},
@@ -678,7 +678,7 @@ static const luaL_reg base_funcs[] = {
LUALIB_API void lua_baselibopen (lua_State *L) {
luaL_openl(L, base_funcs);
- lua_pushliteral(L, l_s(LUA_VERSION));
+ lua_pushliteral(L, LUA_VERSION);
lua_setglobal(L, l_s("_VERSION"));
deprecated_funcs(L);
}
diff --git a/ldo.c b/ldo.c
@@ -1,5 +1,5 @@
/*
-** $Id: ldo.c,v 1.127 2001/02/23 13:38:56 roberto Exp roberto $
+** $Id: ldo.c,v 1.128 2001/02/23 17:17:25 roberto Exp roberto $
** Stack and Call structure of Lua
** See Copyright Notice in lua.h
*/
@@ -335,7 +335,7 @@ struct lua_longjmp {
static void message (lua_State *L, const l_char *s) {
- luaV_getglobal(L, luaS_newliteral(L, l_s(LUA_ERRORMESSAGE)), L->top);
+ luaV_getglobal(L, luaS_newliteral(L, LUA_ERRORMESSAGE), L->top);
if (ttype(L->top) == LUA_TFUNCTION) {
incr_top;
setsvalue(L->top, luaS_new(L, s));
diff --git a/liolib.c b/liolib.c
@@ -1,5 +1,5 @@
/*
-** $Id: liolib.c,v 1.107 2001/02/22 17:15:18 roberto Exp roberto $
+** $Id: liolib.c,v 1.108 2001/02/23 17:17:25 roberto Exp roberto $
** Standard I/O (and system) library
** See Copyright Notice in lua.h
*/
@@ -638,7 +638,7 @@ static int errorfb (lua_State *L) {
luaL_addstring(&b, l_s("\n"));
}
luaL_pushresult(&b);
- lua_getglobal(L, l_s(LUA_ALERT));
+ lua_getglobal(L, LUA_ALERT);
if (lua_isfunction(L, -1)) { /* avoid loop if _ALERT is not defined */
lua_pushvalue(L, -2); /* error message */
lua_rawcall(L, 1, 0);
@@ -671,7 +671,7 @@ static const luaL_reg iolib[] = {
{l_s("tmpname"), io_tmpname},
{l_s("write"), io_write},
{l_s("writeto"), io_writeto},
- {l_s(LUA_ERRORMESSAGE), errorfb}
+ {LUA_ERRORMESSAGE, errorfb}
};
diff --git a/llimits.h b/llimits.h
@@ -1,5 +1,5 @@
/*
-** $Id: llimits.h,v 1.24 2001/02/22 17:15:18 roberto Exp roberto $
+** $Id: llimits.h,v 1.25 2001/02/23 17:17:25 roberto Exp roberto $
** Limits, basic types, and some other `installation-dependent' definitions
** See Copyright Notice in lua.h
*/
@@ -80,7 +80,9 @@ typedef unsigned char lu_byte;
/* macro to `unsign' a character */
-#define uchar(c) ((unsigned char)(c))
+#ifndef uchar
+#define uchar(c) ((unsigned char)(c))
+#endif
#define MAX_SIZET ((size_t)(~(size_t)0)-2)
diff --git a/lua.c b/lua.c
@@ -1,5 +1,5 @@
/*
-** $Id: lua.c,v 1.61 2001/02/20 18:15:33 roberto Exp roberto $
+** $Id: lua.c,v 1.62 2001/02/23 17:17:25 roberto Exp roberto $
** Lua stand-alone interpreter
** See Copyright Notice in lua.h
*/
@@ -118,7 +118,7 @@ static void print_message (void) {
static void print_version (void) {
- printf(l_s("%.80s %.80s\n"), l_s(LUA_VERSION), l_s(LUA_COPYRIGHT));
+ printf(l_s("%.80s %.80s\n"), LUA_VERSION, LUA_COPYRIGHT);
}
diff --git a/lua.h b/lua.h
@@ -1,5 +1,5 @@
/*
-** $Id: lua.h,v 1.88 2001/02/22 17:15:18 roberto Exp roberto $
+** $Id: lua.h,v 1.89 2001/02/23 17:17:25 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
@@ -17,13 +17,13 @@
-#define LUA_VERSION "Lua 4.1 (work)"
-#define LUA_COPYRIGHT "Copyright (C) 1994-2000 TeCGraf, PUC-Rio"
-#define LUA_AUTHORS "W. Celes, R. Ierusalimschy & L. H. de Figueiredo"
+#define LUA_VERSION l_s("Lua 4.1 (work)")
+#define LUA_COPYRIGHT l_s("Copyright (C) 1994-2000 TeCGraf, PUC-Rio")
+#define LUA_AUTHORS l_s("W. Celes, R. Ierusalimschy & L. H. de Figueiredo")
/* name of global variable with error handler */
-#define LUA_ERRORMESSAGE "_ERRORMESSAGE"
+#define LUA_ERRORMESSAGE l_s("_ERRORMESSAGE")
/* pre-defined references */
diff --git a/lualib.h b/lualib.h
@@ -1,5 +1,5 @@
/*
-** $Id: lualib.h,v 1.16 2001/02/22 17:15:18 roberto Exp roberto $
+** $Id: lualib.h,v 1.17 2001/02/23 17:17:25 roberto Exp roberto $
** Lua standard libraries
** See Copyright Notice in lua.h
*/
@@ -31,7 +31,9 @@ LUALIB_API void lua_dblibopen (lua_State *L);
*/
/* macro to `unsign' a character */
+#ifndef uchar
#define uchar(c) ((unsigned char)(c))
+#endif
/* integer type to hold the result of fgetc */
typedef int l_charint;