[syslinux:master] lua: the COM32 API actually supports exit() of oslib
syslinux-bot for Ferenc Wágner
wferi at niif.hu
Sun Mar 2 13:48:17 PST 2014
Commit-ID: 3b4337a3b53a3bc5aec9a6efb59ab0462148e71c
Gitweb: http://www.syslinux.org/commit/3b4337a3b53a3bc5aec9a6efb59ab0462148e71c
Author: Ferenc Wágner <wferi at niif.hu>
AuthorDate: Fri, 11 Oct 2013 14:33:52 +0200
Committer: Ferenc Wágner <wferi at niif.hu>
CommitDate: Sat, 1 Mar 2014 17:40:34 +0100
lua: the COM32 API actually supports exit() of oslib
---
com32/lua/src/Makefile | 2 +-
com32/lua/src/loslib.c | 10 ++++++++++
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/com32/lua/src/Makefile b/com32/lua/src/Makefile
index 286a46c..09edaba 100644
--- a/com32/lua/src/Makefile
+++ b/com32/lua/src/Makefile
@@ -36,7 +36,7 @@ LIBLUA_OBJS += lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o
LIBLUA_OBJS += lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o
LIBLUA_OBJS += lauxlib.o lbaselib.o lbitlib.o lcorolib.o ldblib.o liolib.o
-LIBLUA_OBJS += lstrlib.o ltablib.o loadlib.o linit.o
+LIBLUA_OBJS += loslib.o lstrlib.o ltablib.o loadlib.o linit.o
CFLAGS += -DLUA_ANSI
diff --git a/com32/lua/src/loslib.c b/com32/lua/src/loslib.c
index 04f8f9c..a4c7c9d 100644
--- a/com32/lua/src/loslib.c
+++ b/com32/lua/src/loslib.c
@@ -6,7 +6,9 @@
#include <errno.h>
+#ifndef SYSLINUX
#include <locale.h>
+#endif
#include <stdlib.h>
#include <string.h>
#include <time.h>
@@ -20,6 +22,7 @@
#include "lualib.h"
+#ifndef SYSLINUX
/*
** list of valid conversion specifiers for the 'strftime' function
*/
@@ -111,6 +114,7 @@ static int os_tmpname (lua_State *L) {
lua_pushstring(L, buff);
return 1;
}
+#endif /* SYSLINUX */
static int os_getenv (lua_State *L) {
@@ -119,6 +123,7 @@ static int os_getenv (lua_State *L) {
}
+#ifndef SYSLINUX
static int os_clock (lua_State *L) {
lua_pushnumber(L, ((lua_Number)clock())/(lua_Number)CLOCKS_PER_SEC);
return 1;
@@ -284,6 +289,7 @@ static int os_setlocale (lua_State *L) {
lua_pushstring(L, setlocale(cat[op], l));
return 1;
}
+#endif /* SYSLINUX */
static int os_exit (lua_State *L) {
@@ -300,19 +306,23 @@ static int os_exit (lua_State *L) {
static const luaL_Reg syslib[] = {
+#ifndef SYSLINUX
{"clock", os_clock},
{"date", os_date},
#ifndef LUA_NUMBER_INTEGRAL
{"difftime", os_difftime},
#endif
{"execute", os_execute},
+#endif
{"exit", os_exit},
{"getenv", os_getenv},
+#ifndef SYSLINUX
{"remove", os_remove},
{"rename", os_rename},
{"setlocale", os_setlocale},
{"time", os_time},
{"tmpname", os_tmpname},
+#endif
{NULL, NULL}
};
More information about the Syslinux-commits
mailing list