Commit Graph

356 Commits

Author SHA1 Message Date
Martin Raiber
60ec4a72b9
Merge pull request #305 from rojer/warnings
Fix unused arg warnings when building with MINIZ_NO_TIME
2024-05-16 21:05:51 +02:00
Martin Raiber
3cc84f4f0c
Merge pull request #306 from rojer/lm_redefine
Do not redefine TDEFL_LESS_MEMORY if already defined
2024-05-16 21:05:24 +02:00
Deomid rojer Ryabkov
2552e6d45a Do not redefine TDEFL_LESS_MEMORY if already defined 2024-03-23 19:57:23 +00:00
Deomid rojer Ryabkov
622aea128a Fix unused arg warnings when building with MINIZ_NO_TIME 2024-03-23 19:55:43 +00:00
Martin Raiber
16413c213d
Merge pull request #299 from DavidKorczynski/fix-fuzzer-build
Fix OSS-Fuzz build
2024-01-06 11:53:43 +01:00
David Korczynski
a77af68d92 fix OSS-Fuzz build
Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=64398

Signed-off-by: David Korczynski <david@adalogics.com>
2024-01-02 03:16:18 -08:00
Martin Raiber
e5700656b3
Merge pull request #287 from Wertzui123/Wertzui123-patch-1
Don't redefine `WIN32_LEAN_AND_MEAN` if already defined
2023-11-19 21:09:11 +01:00
Martin Raiber
4d6f89cb0a
Merge pull request #288 from jpcha2/master
Remove parameter check in `tinfl_decompress` that breaks `tinfl_decompress_mem_to_heap`
2023-11-19 20:57:40 +01:00
Martin
f8a09fe199 Fix step description 2023-11-19 20:55:38 +01:00
Martin
6cfbb0d1d8 Fix preset file 2023-11-19 20:54:09 +01:00
Martin
fa8ef4584b Fix preset file 2023-11-19 20:52:45 +01:00
Martin
039b1d2962 Use unix makefiles generator 2023-11-19 20:50:45 +01:00
Martin Raiber
32bb60d989
Update c-cpp.yml 2023-11-19 20:47:38 +01:00
Martin
05ab4dc05c Add some catch2 tests 2023-11-19 20:45:17 +01:00
Martin
697f010d70 Revert parameter check
Check breaks tinfl_decompress_mem_to_heap
2023-11-19 20:27:07 +01:00
John Paul Chacha
bd9e22f577
Merge pull request #2 from jpcha2/jpcha2-patch-1-param-check-tinfl_decompress
Update miniz_tinfl.c to remove parameter check that breaks tinfl_decompress_mem_to_heap()
2023-10-09 09:20:34 +03:00
John Paul Chacha
9aef68479f
Update miniz_tinfl.c
Remove parameter check that breaks tinfl_decompress_mem_to_heap() (see discussion on pull request #268)
2023-10-09 08:39:00 +03:00
Wertzui123
69763e8811
Don't redefine WIN32_LEAN_AND_MEAN if already defined 2023-10-07 14:13:08 +02:00
Martin Raiber
18795fa61e
Merge pull request #286 from Sororfortuna/patch-1
Bump cmake minimum version
2023-09-28 20:07:39 +02:00
Martin Raiber
96b0c0fc64
Merge pull request #266 from fabiangreffrath/lfs_linux64
Fix missing large file support warning on 64-bit Linux
2023-09-28 20:07:21 +02:00
Martin Raiber
acfba6a21d
Merge pull request #280 from nyq/nyq-s_tdefl_num_probes-cpp
Update miniz_tdef.c to enable compiling in forced-C++ mode
2023-09-28 20:05:56 +02:00
Martin Raiber
93ded54847
Merge pull request #282 from nyq/nyq-fix-version-in-comment
Update miniz.h to correctly reflect release version in the title comment
2023-09-28 20:03:00 +02:00
Martin Raiber
a23a38bf53
Merge pull request #283 from nyq/nyq-fix-min-max-conflicts
Prevent min/max conflicts between windows.h and std namespace
2023-09-28 20:00:07 +02:00
Igor Alexey
d0190e5cdf
bump cmake minimum version 2023-09-28 09:01:25 -03:00
Nyq
90a5b2f89b
Prevent min/max conflicts between windows.h and std namespace
Miniz started including windows.h from version 3.0.0 and on when compiling for Windows using MSVC.

windows.h header file is known to conflict with C++ std namespace by defining its own min/max macros. It is a common practice to disable these ancient macros in windows.h by declaring NOMINMAX macro prior to including windows.h in code.

While this issue does not affect miniz directly due to the fact that it is straight-C code and it does not use min/max from C++ std namespace, it does affect other projects like miniz-cpp which wrap and amalgamate miniz and then both compile in C++ mode and use min/max from std namespace.

It is therefore proposed to prefix inclusion of windows.h in miniz_zip.c by the following lines:

#ifndef NOMINMAX
#define NOMINMAX
#endif
2023-08-15 07:21:03 -04:00
Nyq
6f09a0f0b5
Update miniz.h to correctly reflect release version in the title comment
The version number in the title comment (line 1) was not updated since version 3.0.0, which causes confusion between versions 3.0.0, 3.0.1 and 3.0.2. It would be good if the title comment in this header file was updated for each release as it is exactly that this comment is being looked at by most programmers when checking the library version in their code trees.
2023-08-15 06:58:55 -04:00
Nyq
fd55960854
Update miniz_zip.c to prevent compilation warning when compiling for Windows in straight C mode
Summary:
Added conditional macro definition to prevent MSVC compiler warning C5105 when compiling for Windows in straight C mode

Details:
Since version 3.0.0 miniz_zip.c includes windows.h header file when compiling for Windows using MSVC. However, when compiling miniz_zip.c using MSVC17 in straight-C mode (no C++), this inclusion causes warning C5105:

winbase.h(9531,5): warning C5105: macro expansion producing 'defined' has undefined behavior

This warning is not produced when compiling in C++ mode.

In order to prevent the warning, any straight-C code that wants to include windows.h should make an additional define before including:
#ifndef __cplusplus
#define MICROSOFT_WINDOWS_WINBASE_H_DEFINE_INTERLOCKED_CPLUSPLUS_OVERLOADS 0
#endif
#include <windows.h>
2023-08-15 05:39:55 -04:00
Nyq
b0af33a61b
Update miniz_tdef.c to enable compiling in forced-C++ mode
Summary:
Merged definition of static const mz_uint s_tdefl_num_probes[11] with its declaration to avoid compilation error when compiling in forced-C++mode

Details:
When miniz_tdef.c is compiled in C++ mode (either by forcing the compiler to treat the input as C++ or by renaming the file into miniz.cpp), MSVC17 produces the following error:
```
miniz_tdef.cpp(2113,22): error C2086: 'const mz_uint s_tdefl_num_probes[11]': redefinition
miniz_tdef.cpp(1254,22): message : see declaration of 's_tdefl_num_probes'
```
This happens because in miniz_tdef.c we have the following:

```
/*Line 606:*/ static const mz_uint s_tdefl_num_probes[11];
/*Line 1465:*/ static const mz_uint s_tdefl_num_probes[11] = { 0, 1, 6, 32, 16, 32, 128, 256, 512, 768, 1500 };
```
While miniz_tdef.c is a C source file and not C++, sometimes it is used in C++ projects where settings are such that mixed C/C++ compilation is not allowed and all input source files are treated as forced C++. So there would be no harm to make a small adjustment so that the source code is conformant with both C and C++ requirements.

There are two ways it can be done:
Option 1: change line 606 from `static const mz_uint s_tdefl_num_probes[11];` to `extern const mz_uint s_tdefl_num_probes[11];`
Option2: eliminate line 1465 entirely and move line 2113 into line 1254 so that the code looks like this:
```
/*Line 606:*/ static const mz_uint s_tdefl_num_probes[11] = { 0, 1, 6, 32, 16, 32, 128, 256, 512, 768, 1500 };
/*Line 1465:*/ //Nothing here
```
Either option works for both C and C++ and really there is no harm in simply moving the full definition up like in option B and avoid duplication.

This change implements option B.
2023-08-15 04:50:07 -04:00
Martin Raiber
9ae305f6e1
Merge pull request #268 from jpcha2/master
Ensure correct integer promotion when adding
2023-04-12 21:10:11 +02:00
Martin Raiber
d9d197c926
Merge pull request #270 from J5lx/mingw32-unicode
Fix Unicode paths on MinGW32
2023-04-12 21:07:54 +02:00
Jakob Gahde
654bf8bdeb
Fix Unicode paths on MinGW32 2023-02-14 07:10:06 +01:00
jpcha2
fe6330e1d8
Update miniz_tinfl.c
Additional parameter checks
2023-01-17 12:25:12 +03:00
jpcha2
f259216256
Merge pull request #1 from jpcha2/jpcha2-patch-1-int64-promotion-order
Update miniz_zip.c
2023-01-17 11:52:16 +03:00
jpcha2
f0709ed3f5
Update miniz_zip.c
Code Quality (Avoid Integer Overflow): Ensure correct order of integer size promotion when doing additions by placing the mz_uint64 value first or explicitly casting the first value to mz_uint64.
2023-01-17 11:49:41 +03:00
Martin Raiber
293d4db1b7
Increment version 2023-01-15 12:55:58 +01:00
Martin Raiber
12680974d1
Increment version 2023-01-15 12:55:30 +01:00
Martin Raiber
ad8dedc1b3
Update ChangeLog.md 2023-01-15 12:52:28 +01:00
Martin Raiber
08c03ff478
Merge pull request #264 from jpcha2/patch-1
Update miniz_zip.c
2023-01-15 12:51:17 +01:00
Fabian Greffrath
2ec92b4852 Fix missing large file support warning on 64-bit Linux
Pragmatic approach: Treat Linux on x86_64 the same as Mac OS X and FreeBSD,
i.e. as a Unix-like 64-bit operating system with know large file support.

Fixes #257
2022-12-14 10:12:10 +01:00
jpcha2
78e9404362
Update miniz_zip.c
Bugfix: MultiByteToWideChar() is being called with a byte count instead of a character count. This will cause a buffer overrun.
2022-11-21 04:36:20 +03:00
Martin Raiber
963a27a112
Increment version 2022-11-06 13:47:54 +01:00
Martin Raiber
2363190ebf
Increment version 2022-11-06 13:47:03 +01:00
Martin Raiber
7265019066
Update changelog 2022-11-06 13:43:12 +01:00
Martin Raiber
83341a5605
Merge pull request #263 from nekonomicon/match_dist
Fix variable declaration.
2022-11-06 13:42:00 +01:00
Martin Raiber
39622ead92
Test compile with MINIZ_USE_UNALIGNED_LOADS_AND_STORES=1 2022-11-06 12:40:00 +01:00
Andrey Akhmichin
ab052e6e58
Fix variable declaration. 2022-11-06 14:55:25 +05:00
Martin
39f65158c7 Update changelog 2022-10-23 18:40:45 +02:00
Martin Raiber
ca0cdfc52d
Merge pull request #252 from JonLiu1993/vcpkg-instructions
Add vcpkg installation instructions
2022-08-25 22:03:10 +02:00
Martin Raiber
7b9bcf7f94
Merge pull request #234 from gtreshchev/bit-shift-fix
Bit shift fix
2022-08-25 22:02:34 +02:00
Martin Raiber
92ab73ac32
Merge pull request #236 from Dialga/patch-1
Fix callback typo
2022-08-25 22:02:06 +02:00