aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDiego Nehab <diego@impa.br>2015-08-21 22:31:29 -0300
committerDiego Nehab <diego@impa.br>2015-08-21 22:31:29 -0300
commitb211838648c1cb092e96e3ae721932a212808d96 (patch)
treed83c909c5eaed8832743b1ce003ca8648a244121 /src
parent9322eacefd719878ccfbc3220873a2a07af41291 (diff)
downloadluasocket-b211838648c1cb092e96e3ae721932a212808d96.tar.gz
luasocket-b211838648c1cb092e96e3ae721932a212808d96.tar.bz2
luasocket-b211838648c1cb092e96e3ae721932a212808d96.zip
Fix rockspec and serial.c module.
Diffstat (limited to 'src')
-rw-r--r--src/compat.c2
-rw-r--r--src/serial.c16
2 files changed, 1 insertions, 17 deletions
diff --git a/src/compat.c b/src/compat.c
index bc5cc0e..c2d99cb 100644
--- a/src/compat.c
+++ b/src/compat.c
@@ -1,6 +1,6 @@
1#include "compat.h" 1#include "compat.h"
2 2
3#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM==501 3#if LUA_VERSION_NUM==501
4/* 4/*
5** Adapted from Lua 5.2 5** Adapted from Lua 5.2
6*/ 6*/
diff --git a/src/serial.c b/src/serial.c
index dedbeb5..7bdb21c 100644
--- a/src/serial.c
+++ b/src/serial.c
@@ -54,15 +54,6 @@ static luaL_Reg serial_methods[] = {
54 {NULL, NULL} 54 {NULL, NULL}
55}; 55};
56 56
57/* our socket creation function */
58/* this is an ad-hoc module that returns a single function
59 * as such, do not include other functions in this array. */
60static luaL_Reg func[] = {
61 {"serial", global_create},
62 {NULL, NULL}
63};
64
65
66/*-------------------------------------------------------------------------*\ 57/*-------------------------------------------------------------------------*\
67* Initializes module 58* Initializes module
68\*-------------------------------------------------------------------------*/ 59\*-------------------------------------------------------------------------*/
@@ -71,14 +62,7 @@ LUASOCKET_API int luaopen_socket_serial(lua_State *L) {
71 auxiliar_newclass(L, "serial{client}", serial_methods); 62 auxiliar_newclass(L, "serial{client}", serial_methods);
72 /* create class groups */ 63 /* create class groups */
73 auxiliar_add2group(L, "serial{client}", "serial{any}"); 64 auxiliar_add2group(L, "serial{client}", "serial{any}");
74#if LUA_VERSION_NUM > 501 && !defined(LUA_COMPAT_MODULE)
75 lua_pushcfunction(L, global_create);
76 (void) func;
77#else
78 /* set function into socket namespace */
79 luaL_openlib(L, "socket", func, 0);
80 lua_pushcfunction(L, global_create); 65 lua_pushcfunction(L, global_create);
81#endif
82 return 1; 66 return 1;
83} 67}
84 68