mirror of
https://github.com/lunarmodules/luasocket.git
synced 2025-07-16 05:49:53 +02:00
Fix rockspec and serial.c module.
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
#include "compat.h"
|
||||
|
||||
#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM==501
|
||||
#if LUA_VERSION_NUM==501
|
||||
/*
|
||||
** Adapted from Lua 5.2
|
||||
*/
|
||||
|
16
src/serial.c
16
src/serial.c
@ -54,15 +54,6 @@ static luaL_Reg serial_methods[] = {
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
/* our socket creation function */
|
||||
/* this is an ad-hoc module that returns a single function
|
||||
* as such, do not include other functions in this array. */
|
||||
static luaL_Reg func[] = {
|
||||
{"serial", global_create},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------*\
|
||||
* Initializes module
|
||||
\*-------------------------------------------------------------------------*/
|
||||
@ -71,14 +62,7 @@ LUASOCKET_API int luaopen_socket_serial(lua_State *L) {
|
||||
auxiliar_newclass(L, "serial{client}", serial_methods);
|
||||
/* create class groups */
|
||||
auxiliar_add2group(L, "serial{client}", "serial{any}");
|
||||
#if LUA_VERSION_NUM > 501 && !defined(LUA_COMPAT_MODULE)
|
||||
lua_pushcfunction(L, global_create);
|
||||
(void) func;
|
||||
#else
|
||||
/* set function into socket namespace */
|
||||
luaL_openlib(L, "socket", func, 0);
|
||||
lua_pushcfunction(L, global_create);
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user