Skip to content

build: avoid MIN macro for Windows#949

Merged
nmoinvaz merged 1 commit intozlib-ng:developfrom
Coeur:coeur/no-MIN
Feb 3, 2026
Merged

build: avoid MIN macro for Windows#949
nmoinvaz merged 1 commit intozlib-ng:developfrom
Coeur:coeur/no-MIN

Conversation

@Coeur
Copy link
Collaborator

@Coeur Coeur commented Feb 2, 2026

Fix #948.

While we could maybe add some #import <windows.h> or create our own macros, I feel the overhead is not needed for a single usage of MIN.

I use the ternary operator because it's already in use the line just below (restor =).

I also fix the documentation which had some outdated values. We know we're between PPMD8_MIN_ORDER (2) and PPMD8_MAX_ORDER (16), so the rest of the documentation should be a mem_size between 1 << 2-1 (2) and 1 << 8-1 (128).

@pmqs

@Coeur Coeur requested a review from nmoinvaz February 2, 2026 02:48
@Coeur
Copy link
Collaborator Author

Coeur commented Feb 3, 2026

@nmoinvaz this PR should be easy, replacing a MIN() with < ? :.

@nmoinvaz nmoinvaz merged commit 1040d35 into zlib-ng:develop Feb 3, 2026
27 of 29 checks passed
@Coeur Coeur deleted the coeur/no-MIN branch February 3, 2026 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

minizip-ng build fails on Windows with MinGW64 due to missing MIN macro

2 participants