Skip to content

std::max causes compilation error on Windows #654

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
cacharle opened this issue Apr 14, 2025 · 0 comments · May be fixed by #656
Open

std::max causes compilation error on Windows #654

cacharle opened this issue Apr 14, 2025 · 0 comments · May be fixed by #656

Comments

@cacharle
Copy link

There is one use of std::max that doesn't use the (std::max) trick when the max macro is defined by Windows.

cppzmq/zmq.hpp

Line 2756 in 21c83ca

return static_cast<size_t>(std::max(rc, 0));

My current workaround is to add #define NOMINMAX to all my files but it would be nice if the library could handle it.

@cacharle cacharle changed the title std::max causes compilation error on Windows std::max causes compilation error on Windows Apr 14, 2025
cacharle added a commit to cacharle/cppzmq that referenced this issue Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant