diff --git a/internal/c/libqb.cpp b/internal/c/libqb.cpp index eae2987dc..6aedf9fb9 100644 --- a/internal/c/libqb.cpp +++ b/internal/c/libqb.cpp @@ -16454,7 +16454,7 @@ void sub_put2(int32 i,int64 offset,void *element,int32 passed){ #endif #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" #else #include "parts/zlib/src.c" diff --git a/internal/c/parts/zlib/src.c b/internal/c/parts/zlib/src.c index 0ea89f4e5..0d5a9fa57 100644 --- a/internal/c/parts/zlib/src.c +++ b/internal/c/parts/zlib/src.c @@ -1,8 +1,10 @@ #ifdef QB64_WINDOWS - #include "download\zlib.h" + #include "download\\zlib.h" +#else + #include #endif + qbs *func__deflate(qbs *text){ - #ifdef QB64_WINDOWS uLongf filesize = (uint32)text->len; //length of the text uLongf compsize = compressBound(filesize); unsigned char *dest = (unsigned char *)malloc(compsize); @@ -11,13 +13,9 @@ memcpy(ret->chr, dest, compsize); free(dest); return ret; - #else - return text; - #endif } qbs *func__inflate(qbs *text, int64 originalsize, int32 passed){ - #ifdef QB64_WINDOWS int32 result=0; if (passed==1){ uLongf uncompsize = originalsize; @@ -41,7 +39,4 @@ free(dest); return ret; } - #else - return text; - #endif } \ No newline at end of file diff --git a/source/qb64.bas b/source/qb64.bas index 4777910d5..4050ddabe 100644 --- a/source/qb64.bas +++ b/source/qb64.bas @@ -11971,13 +11971,15 @@ END IF IF DEPENDENCY(DEPENDENCY_ZLIB) THEN 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\" 'rebuild? IF _FILEEXISTS(d$ + "os\" + o$ + "\src.a") = 0 THEN Build d$ + "os\" + o$ END IF libs$ = libs$ + " " + "parts\zlib\os\" + o$ + "\src.a -lz" + ELSE + libs$ = libs$ + " -lz" END IF END IF