aboutsummaryrefslogtreecommitdiff
path: root/lbuiltin.c
diff options
context:
space:
mode:
Diffstat (limited to 'lbuiltin.c')
-rw-r--r--lbuiltin.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/lbuiltin.c b/lbuiltin.c
index 6cfd3a37..8418da29 100644
--- a/lbuiltin.c
+++ b/lbuiltin.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lbuiltin.c,v 1.4 1997/10/23 16:28:48 roberto Exp roberto $ 2** $Id: lbuiltin.c,v 1.5 1997/10/24 17:17:24 roberto Exp roberto $
3** Built-in functions 3** Built-in functions
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -455,23 +455,11 @@ static struct luaL_reg int_funcs[] = {
455 455
456void luaB_predefine (void) 456void luaB_predefine (void)
457{ 457{
458 int i;
459 TaggedString *ts;
460 TObject o;
461 /* pre-register mem error messages, to avoid loop when error arises */ 458 /* pre-register mem error messages, to avoid loop when error arises */
462 luaS_newfixedstring(tableEM); 459 luaS_newfixedstring(tableEM);
463 luaS_newfixedstring(memEM); 460 luaS_newfixedstring(memEM);
464 for (i=0; i<INTFUNCSIZE; i++) { 461 luaL_openlib(int_funcs, (sizeof(int_funcs)/sizeof(int_funcs[0])));
465 ts = luaS_new(int_funcs[i].name); 462 lua_pushstring(LUA_VERSION);
466 fvalue(&o) = int_funcs[i].func; 463 lua_setglobal("_VERSION");
467 ttype(&o) = LUA_T_CPROTO;
468 luaF_simpleclosure(&o);
469 luaS_rawsetglobal(ts, &o);
470 }
471 ts = luaS_new("_VERSION");
472 ttype(&o) = LUA_T_STRING;
473 tsvalue(&o) = luaS_new(LUA_VERSION);
474 luaS_rawsetglobal(ts, &o);
475} 464}
476 465
477