wrap std::min + std::max in () to avoid issues building brotli on windows #114

Closed
opened 2026-01-29 20:35:32 +00:00 by claunia · 2 comments
Owner

Originally created by @mbevin on GitHub (May 31, 2016).

windef.h (included by windows.h) defines min+max macros, so to avoid compilation issues on windows whenever include brotli headers after including windows headers (which can be very tricky to avoid/workaround in some projects), its best to either:

  • convert lines like std::min(a,b) to (std::min)(a,b), or
  • keep such code out of the headers that get pulled in when including encode.h / decode.h
Originally created by @mbevin on GitHub (May 31, 2016). windef.h (included by windows.h) defines min+max macros, so to avoid compilation issues on windows whenever include brotli headers after including windows headers (which can be very tricky to avoid/workaround in some projects), its best to either: - convert lines like std::min(a,b) to (std::min)(a,b), or - keep such code out of the headers that get pulled in when including encode.h / decode.h
Author
Owner

@eustas commented on GitHub (Jun 2, 2016):

New version of brotli encoder is almost ready to be published. In new version there is no std::* at all.

@eustas commented on GitHub (Jun 2, 2016): New version of brotli encoder is almost ready to be published. In new version there is no std::\* at all.
Author
Owner

@eustas commented on GitHub (Jun 16, 2016):

Fixed in v0.5

@eustas commented on GitHub (Jun 16, 2016): Fixed in v0.5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/brotli#114