aboutsummaryrefslogtreecommitdiff
path: root/src/mime.c
diff options
context:
space:
mode:
authormoteus <mimir@newmail.ru>2013-05-27 12:45:09 +0400
committermoteus <mimir@newmail.ru>2013-05-27 12:45:09 +0400
commit920bc9762954454468d056a61391635cbd849406 (patch)
tree048c112f95fa578d239ae3e35b2aec0a482f0c23 /src/mime.c
parentbd51d8c1a5bb30e6a358dee6e85963f777edfff4 (diff)
downloadluasocket-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.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mime.c b/src/mime.c
index dddd3d6..ea8876e 100644
--- a/src/mime.c
+++ b/src/mime.c
@@ -81,7 +81,16 @@ static UC b64unbase[256];
81\*-------------------------------------------------------------------------*/ 81\*-------------------------------------------------------------------------*/
82MIME_API int luaopen_mime_core(lua_State *L) 82MIME_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);