parent
7dce722b27
commit
c5930942ee
@ -1,36 +0,0 @@
|
||||
This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
This patch has been taken from:
|
||||
http://sourceforge.net/tracker/?func=detail&aid=2995373&group_id=6389&atid=306389
|
||||
|
||||
--- zziplib-0.13.59/zzip/__mmap.h 2013-10-03 22:23:32.467619238 -0400
|
||||
+++ zzip-patched/zzip/__mmap.h 2013-10-04 21:44:16.412881609 -0400
|
||||
@@ -63,14 +63,15 @@
|
||||
return 0;
|
||||
{
|
||||
HANDLE hFile = (HANDLE)_get_osfhandle(fd);
|
||||
+ HANDLE fileMapping = NULL;
|
||||
if (hFile)
|
||||
- *user = (int) CreateFileMapping (hFile, 0, PAGE_READONLY, 0, 0, NULL);
|
||||
- if (*user)
|
||||
+ fileMapping = CreateFileMapping(hFile, 0, PAGE_READONLY, 0, 0, NULL);
|
||||
+ if (fileMapping != NULL)
|
||||
{
|
||||
char* p = 0;
|
||||
- p = MapViewOfFile(*(HANDLE*)user, FILE_MAP_READ, 0, offs, len);
|
||||
- if (p) return p + offs;
|
||||
- CloseHandle (*(HANDLE*)user); *user = 1;
|
||||
+ p = MapViewOfFile(fileMapping, FILE_MAP_READ, 0, offs, len);
|
||||
+ CloseHandle (fileMapping);
|
||||
+ if (p) return p;
|
||||
}
|
||||
return MAP_FAILED;
|
||||
}
|
||||
@@ -78,7 +79,6 @@
|
||||
static void win32_munmap (long* user, char* fd_map, size_t len)
|
||||
{
|
||||
UnmapViewOfFile (fd_map);
|
||||
- CloseHandle (*(HANDLE*)user); *user = 1;
|
||||
}
|
||||
|
||||
#define _zzip_mmap(user, fd, offs, len) \
|
@ -0,0 +1,31 @@
|
||||
This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
Contains ad hoc patches for cross building.
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Hopper262 <hopper@whpress.com>
|
||||
Date: Sat, 23 Mar 2019 23:08:00 -0400
|
||||
Subject: [PATCH 1/1] Port ab78bba from gdraheim/zziplib
|
||||
|
||||
|
||||
diff --git a/zzip/__string.h b/zzip/__string.h
|
||||
index 1111111..2222222 100644
|
||||
--- a/zzip/__string.h
|
||||
+++ b/zzip/__string.h
|
||||
@@ -31,6 +31,7 @@ _zzip_strnlen(const char *p, size_t maxlen)
|
||||
#if defined ZZIP_HAVE_STRNDUP || defined strndup
|
||||
#define _zzip_strndup strndup
|
||||
#else
|
||||
+#include <stdlib.h>
|
||||
|
||||
/* if your system does not have strndup: */
|
||||
zzip__new__ static char *
|
||||
@@ -42,7 +43,7 @@ _zzip_strndup(char const *p, size_t maxlen)
|
||||
} else
|
||||
{
|
||||
size_t len = _zzip_strnlen(p, maxlen);
|
||||
- char* r = malloc(len + 1);
|
||||
+ char* r = (char *)malloc(len + 1);
|
||||
if (r == NULL)
|
||||
return NULL; /* errno = ENOMEM */
|
||||
r[len] = '\0';
|
Loading…
Reference in new issue