mirror of
https://github.com/QB64Official/qb64.git
synced 2024-07-05 10:00:23 +00:00
Gets _DEFLATE$ and _INFLATE$ to work on macOS.
This commit is contained in:
parent
81106cb5a2
commit
44c80201f2
|
@ -16454,7 +16454,7 @@ void sub_put2(int32 i,int64 offset,void *element,int32 passed){
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEPENDENCY_ZLIB
|
#ifdef DEPENDENCY_ZLIB
|
||||||
#ifdef QB64_BACKSLASH_FILESYSTEM //change slashes depending on OS, I guess? Included by copying audio template, and it works. (SMcNeill comment)
|
#ifdef QB64_BACKSLASH_FILESYSTEM
|
||||||
#include "parts\\zlib\\src.c"
|
#include "parts\\zlib\\src.c"
|
||||||
#else
|
#else
|
||||||
#include "parts/zlib/src.c"
|
#include "parts/zlib/src.c"
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
#ifdef QB64_WINDOWS
|
#ifdef QB64_WINDOWS
|
||||||
#include "download\zlib.h"
|
#include "download\\zlib.h"
|
||||||
|
#else
|
||||||
|
#include <zlib.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
qbs *func__deflate(qbs *text){
|
qbs *func__deflate(qbs *text){
|
||||||
#ifdef QB64_WINDOWS
|
|
||||||
uLongf filesize = (uint32)text->len; //length of the text
|
uLongf filesize = (uint32)text->len; //length of the text
|
||||||
uLongf compsize = compressBound(filesize);
|
uLongf compsize = compressBound(filesize);
|
||||||
unsigned char *dest = (unsigned char *)malloc(compsize);
|
unsigned char *dest = (unsigned char *)malloc(compsize);
|
||||||
|
@ -11,13 +13,9 @@
|
||||||
memcpy(ret->chr, dest, compsize);
|
memcpy(ret->chr, dest, compsize);
|
||||||
free(dest);
|
free(dest);
|
||||||
return ret;
|
return ret;
|
||||||
#else
|
|
||||||
return text;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
qbs *func__inflate(qbs *text, int64 originalsize, int32 passed){
|
qbs *func__inflate(qbs *text, int64 originalsize, int32 passed){
|
||||||
#ifdef QB64_WINDOWS
|
|
||||||
int32 result=0;
|
int32 result=0;
|
||||||
if (passed==1){
|
if (passed==1){
|
||||||
uLongf uncompsize = originalsize;
|
uLongf uncompsize = originalsize;
|
||||||
|
@ -41,7 +39,4 @@
|
||||||
free(dest);
|
free(dest);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
return text;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
|
@ -11971,13 +11971,15 @@ END IF
|
||||||
|
|
||||||
IF DEPENDENCY(DEPENDENCY_ZLIB) THEN
|
IF DEPENDENCY(DEPENDENCY_ZLIB) THEN
|
||||||
defines$ = defines$ + defines_header$ + "DEPENDENCY_ZLIB"
|
defines$ = defines$ + defines_header$ + "DEPENDENCY_ZLIB"
|
||||||
IF win THEN 'ZLIB is only supported for windows versions so far
|
IF os$ = "WIN" THEN
|
||||||
d$ = "internal\c\parts\zlib\"
|
d$ = "internal\c\parts\zlib\"
|
||||||
'rebuild?
|
'rebuild?
|
||||||
IF _FILEEXISTS(d$ + "os\" + o$ + "\src.a") = 0 THEN
|
IF _FILEEXISTS(d$ + "os\" + o$ + "\src.a") = 0 THEN
|
||||||
Build d$ + "os\" + o$
|
Build d$ + "os\" + o$
|
||||||
END IF
|
END IF
|
||||||
libs$ = libs$ + " " + "parts\zlib\os\" + o$ + "\src.a -lz"
|
libs$ = libs$ + " " + "parts\zlib\os\" + o$ + "\src.a -lz"
|
||||||
|
ELSE
|
||||||
|
libs$ = libs$ + " -lz"
|
||||||
END IF
|
END IF
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue