[vlc-commits] contrib: lua: Do not use system nor popen on winrt

Hugo Beauzée-Luyssen git at videolan.org
Tue Aug 2 11:33:42 CEST 2016


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Tue Aug  2 11:32:13 2016 +0200| [fb80349b7ce77437765e862ccb915d4c249c8db0] | committer: Hugo Beauzée-Luyssen

contrib: lua: Do not use system nor popen on winrt

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=fb80349b7ce77437765e862ccb915d4c249c8db0
---

 contrib/src/lua/lua-winrt.patch | 37 +++++++++++++++++++++++++++++++++++++
 contrib/src/lua/rules.mak       |  3 +++
 2 files changed, 40 insertions(+)

diff --git a/contrib/src/lua/lua-winrt.patch b/contrib/src/lua/lua-winrt.patch
new file mode 100644
index 0000000..284e23c
--- /dev/null
+++ b/contrib/src/lua/lua-winrt.patch
@@ -0,0 +1,37 @@
+--- lua/src/loslib.c.orig	2016-08-02 11:27:51.549043853 +0200
++++ lua/src/loslib.c	2016-08-02 11:28:02.893091343 +0200
+@@ -35,12 +35,6 @@
+ }
+ 
+ 
+-static int os_execute (lua_State *L) {
+-  lua_pushinteger(L, system(luaL_optstring(L, 1, NULL)));
+-  return 1;
+-}
+-
+-
+ static int os_remove (lua_State *L) {
+   const char *filename = luaL_checkstring(L, 1);
+   return os_pushresult(L, remove(filename) == 0, filename);
+@@ -221,7 +215,6 @@
+   {"clock",     os_clock},
+   {"date",      os_date},
+   {"difftime",  os_difftime},
+-  {"execute",   os_execute},
+   {"exit",      os_exit},
+   {"getenv",    os_getenv},
+   {"remove",    os_remove},
+--- lua/src/luaconf.h.orig	2016-08-02 11:26:59.264878408 +0200
++++ lua/src/luaconf.h	2016-08-02 11:27:02.136885122 +0200
+@@ -665,11 +665,6 @@
+ 
+ #elif defined(LUA_WIN)
+ 
+-#define lua_popen(L,c,m)	((void)L, _popen(c,m))
+-#define lua_pclose(L,file)	((void)L, (_pclose(file) != -1))
+-
+-#else
+-
+ #define lua_popen(L,c,m)	((void)((void)c, m),  \
+ 		luaL_error(L, LUA_QL("popen") " not supported"), (FILE*)0)
+ #define lua_pclose(L,file)		((void)((void)L, file), 0)
diff --git a/contrib/src/lua/rules.mak b/contrib/src/lua/rules.mak
index 8be4af2..cd8cc14 100644
--- a/contrib/src/lua/rules.mak
+++ b/contrib/src/lua/rules.mak
@@ -45,6 +45,9 @@ lua: lua-$(LUA_VERSION).tar.gz .sum-lua
 	$(APPLY) $(SRC)/lua/luac-32bits.patch
 	$(APPLY) $(SRC)/lua/no-localeconv.patch
 	$(APPLY) $(SRC)/lua/lua-ios-support.patch
+ifdef HAVE_WINSTORE
+	$(APPLY) $(SRC)/lua/lua-winrt.patch
+endif
 ifdef HAVE_DARWIN_OS
 	(cd $(UNPACK_DIR) && \
 	sed -e 's%gcc%$(CC)%' \



More information about the vlc-commits mailing list