Skip to content
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

Not all headers protected from Windows min/max defines #45154

Open
abellgithub opened this issue Jan 2, 2025 · 2 comments
Open

Not all headers protected from Windows min/max defines #45154

abellgithub opened this issue Jan 2, 2025 · 2 comments

Comments

@abellgithub
Copy link

Describe the bug, including details regarding any error messages, version, and platform.

Not all headers that use min and max include arrow/util/windows_compatibility.h . This requires a user of arrow to disable these macros on Windows. As an example, line 748 of arrow/type.h uses std::numeric_limits<int32_t>::max(). This can also be fixed by disabling macro expansion (for example, (std::numeric_limits<int32_t>::max)() ) or the Windows macros can be disabled by defining NOMINMAX, which is done in windows_compatibility.h.

Component(s)

C++

@kou
Copy link
Member

kou commented Jan 2, 2025

(std::numeric_limits<int32_t>::max)() is better because it's not depend on the global NOMINMAX definition.
Could you open a pull request?

@abellgithub
Copy link
Author

Yes, I'll open a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants