diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-07-02 08:38:13 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-07-02 08:38:13 -0300 |
commit | 7192afafeeb1a96b3de60af90a72cd8762b09d94 (patch) | |
tree | d1e7e061822f755c33cc497d98ea451c7e7e32e8 /lmathlib.c | |
parent | a139e2e003e0b62b7d34eeda20dd2354e74885f9 (diff) | |
download | lua-7192afafeeb1a96b3de60af90a72cd8762b09d94.tar.gz lua-7192afafeeb1a96b3de60af90a72cd8762b09d94.tar.bz2 lua-7192afafeeb1a96b3de60af90a72cd8762b09d94.zip |
new module policy: C modules do not create globals and do not register
themselves with 'require' (let 'require' do its work); new auxiliary
functions luaL_newlib/luaL_newlibtable/luaL_setfuncs/luaL_requiref.
Old luaL_register will be deprecated.
Diffstat (limited to 'lmathlib.c')
-rw-r--r-- | lmathlib.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lmathlib.c,v 1.73 2009/03/17 17:55:39 roberto Exp roberto $ | 2 | ** $Id: lmathlib.c,v 1.74 2009/11/24 12:05:44 roberto Exp roberto $ |
3 | ** Standard mathematical library | 3 | ** Standard mathematical library |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -263,7 +263,7 @@ static const luaL_Reg mathlib[] = { | |||
263 | ** Open math library | 263 | ** Open math library |
264 | */ | 264 | */ |
265 | LUAMOD_API int luaopen_math (lua_State *L) { | 265 | LUAMOD_API int luaopen_math (lua_State *L) { |
266 | luaL_register(L, LUA_MATHLIBNAME, mathlib); | 266 | luaL_newlib(L, mathlib); |
267 | lua_pushnumber(L, PI); | 267 | lua_pushnumber(L, PI); |
268 | lua_setfield(L, -2, "pi"); | 268 | lua_setfield(L, -2, "pi"); |
269 | lua_pushnumber(L, HUGE_VAL); | 269 | lua_pushnumber(L, HUGE_VAL); |