aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFerenc Wágner <wferi@niif.hu>2013-10-11 14:33:52 +0200
committerFerenc Wágner <wferi@niif.hu>2014-03-01 17:40:34 +0100
commit3b4337a3b53a3bc5aec9a6efb59ab0462148e71c (patch)
treef955d80068f819ce35f58bf260ab71b2e5ae400a
parent76cf504d96ffa7532d732feceee333ac442f7d30 (diff)
downloadsyslinux-3b4337a3b53a3bc5aec9a6efb59ab0462148e71c.tar.gz
syslinux-3b4337a3b53a3bc5aec9a6efb59ab0462148e71c.tar.xz
syslinux-3b4337a3b53a3bc5aec9a6efb59ab0462148e71c.zip
lua: the COM32 API actually supports exit() of oslib
-rw-r--r--com32/lua/src/Makefile2
-rw-r--r--com32/lua/src/loslib.c10
2 files changed, 11 insertions, 1 deletions
diff --git a/com32/lua/src/Makefile b/com32/lua/src/Makefile
index 286a46c6..09edaba1 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 04f8f9cb..a4c7c9d6 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}
};