diff options
author | moteus <mimir@newmail.ru> | 2013-05-27 12:45:09 +0400 |
---|---|---|
committer | moteus <mimir@newmail.ru> | 2013-05-27 12:45:09 +0400 |
commit | 920bc9762954454468d056a61391635cbd849406 (patch) | |
tree | 048c112f95fa578d239ae3e35b2aec0a482f0c23 /src/mime.c | |
parent | bd51d8c1a5bb30e6a358dee6e85963f777edfff4 (diff) | |
download | luasocket-920bc9762954454468d056a61391635cbd849406.tar.gz luasocket-920bc9762954454468d056a61391635cbd849406.tar.bz2 luasocket-920bc9762954454468d056a61391635cbd849406.zip |
Build with Lua 5.2 without LUA_COMPAT_MODULE flag.
LUASOCKET_USE_GLOBAL flag enable create global variables when load socket/mime modules.
Diffstat (limited to 'src/mime.c')
-rw-r--r-- | src/mime.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -81,7 +81,16 @@ static UC b64unbase[256]; | |||
81 | \*-------------------------------------------------------------------------*/ | 81 | \*-------------------------------------------------------------------------*/ |
82 | MIME_API int luaopen_mime_core(lua_State *L) | 82 | MIME_API int luaopen_mime_core(lua_State *L) |
83 | { | 83 | { |
84 | #if LUA_VERSION_NUM > 501 | ||
85 | lua_newtable(L); | ||
86 | #ifdef LUASOCKET_USE_GLOBAL | ||
87 | lua_setglobal(L,"mime"); | ||
88 | lua_getglobal(L,"mime"); | ||
89 | #endif | ||
90 | luaL_setfuncs(L,func,0); | ||
91 | #else | ||
84 | luaL_openlib(L, "mime", func, 0); | 92 | luaL_openlib(L, "mime", func, 0); |
93 | #endif | ||
85 | /* make version string available to scripts */ | 94 | /* make version string available to scripts */ |
86 | lua_pushstring(L, "_VERSION"); | 95 | lua_pushstring(L, "_VERSION"); |
87 | lua_pushstring(L, MIME_VERSION); | 96 | lua_pushstring(L, MIME_VERSION); |