kuba-- / zip

A portable, simple zip library written in C
MIT License
1.42k stars 276 forks source link

64-bit Linux compatibility #308

Closed abrasat closed 1 year ago

abrasat commented 1 year ago

Can the zip library be used also on 64-bit Linux applications? On 64-bit Linux systems the "unsigned long" datatype has 8-bytes (but on 64-bit Windows only 4-bytes !) (see here ) From miniz.h:

...
/* For more compatibility with zlib, miniz.c uses unsigned long for some
 * parameters/struct members. Beware: mz_ulong can be either 32 or 64-bits! */
typedef unsigned long mz_ulong;
...

Maybe "unsigned long" should be replaced with "uint32_t" (defined in stdint.h)

kuba-- commented 1 year ago

Yes, it works on x64 systems. It's mainly related to size_t and off_t https://github.com/kuba--/zip/blob/master/src/zip.h#L37C1-L37C1

abrasat commented 1 year ago

Ok, thanks. You mean it should not be a problem to zip a file on Windows and then unzip it on Linux 64-bit?

kuba-- commented 1 year ago

I believe so.