summarylogtreecommitdiffstats
path: root/lzip-linux.patch
diff options
context:
space:
mode:
authorBaptiste Careil2019-12-16 18:43:38 +0100
committerBaptiste Careil2019-12-16 18:43:38 +0100
commit58d075d236147c8419750818cdb2b03b6f09ff98 (patch)
tree37e3e544c4d6ed7834691e540b9a189cccb8590c /lzip-linux.patch
parent05f22693d50c6eff5575a8b420b35d49c4eb7749 (diff)
downloadaur-58d075d236147c8419750818cdb2b03b6f09ff98.tar.gz
Added compilation of lzip as an attempt to support self-update
Diffstat (limited to 'lzip-linux.patch')
-rw-r--r--lzip-linux.patch70
1 files changed, 70 insertions, 0 deletions
diff --git a/lzip-linux.patch b/lzip-linux.patch
new file mode 100644
index 000000000000..e92febfc4a52
--- /dev/null
+++ b/lzip-linux.patch
@@ -0,0 +1,70 @@
+--- a/lzip.cpp 2016-05-17 22:53:16.000000000 +0200
++++ b/lzip.cpp 2019-12-16 17:58:11.855288565 +0100
+@@ -1,17 +1,18 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+-#include <io.h>
+
+-#include "_lib/zlib.h"
++#include "zlib.h"
+
+ extern "C" {
+-#include "_lib\lua.h"
+-#include "_lib\lauxlib.h"
+-#include "_lib\lualib.h"
+-#include "_lib\luajit.h"
++#include "lua.h"
++#include "lauxlib.h"
++#include "lualib.h"
++#include "luajit.h"
+ }
+
++#if defined(WIN32)
++#define DLLEXPORT __declspec(dllexport)
+ #if defined(_WIN64)
+ #pragma comment(lib, "_lib\\lua51_64")
+ #else
+@@ -26,6 +27,9 @@
+ #else
+ #pragma comment(lib, "_lib\\zlib32MT")
+ #endif
++#else
++#define DLLEXPORT __attribute__((visibility("default")))
++#endif
+
+ typedef unsigned char byte;
+ typedef unsigned int dword;
+@@ -656,7 +660,7 @@
+ if (n < 1) {
+ luaL_error(L, "Usage: zipFile:Read(count) or zipFile:read(\"*a\")");
+ }
+- int count;
++ int count = 0;
+ if (lua_isnumber(L, 1)) {
+ count = lua_tointeger(L, 1);
+ } else {
+@@ -673,6 +677,7 @@
+ byte* buf = new byte[count];
+ lzf->file->Read(buf, count);
+ lua_pushlstring(L, (char*)buf, count);
++ delete[] buf;
+ return 1;
+ }
+
+@@ -683,7 +688,7 @@
+ return 1;
+ }
+
+-extern "C" __declspec(dllexport) int luaopen_lzip(lua_State* L)
++extern "C" DLLEXPORT int luaopen_lzip(lua_State* L)
+ {
+ lua_settop(L, 0);
+ lua_newtable(L); // Library table
+@@ -742,4 +747,4 @@
+ lua_pop(L, 2);
+
+ return 1;
+-}
+\ No newline at end of file
++}