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

Windows min max macro imported unexpectedly #32

Open
shangjiaxuan opened this issue May 19, 2022 · 2 comments
Open

Windows min max macro imported unexpectedly #32

shangjiaxuan opened this issue May 19, 2022 · 2 comments

Comments

@shangjiaxuan
Copy link

Describe the bug
Building Geant4 version on windows imports min max macros from windows.h when using 2021.6.0 version of tbb on visual studio 16.11.1, which breaks code in PTL that uses std::min and std::max (e.g. in ThreadPool.hh line 468 in function void ThreadPool::execute_on_all_threads(FuncT&& _func)).

To Reproduce
Description contains reproduction details.

Expected behavior
Normal compilation.

Screenshots
non

Putting this block (or NOMINMAX) somewhere in the code should solve the problem. Still locating the include location.

#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#endif
@jrmadsen
Copy link
Owner

Ugh, yeah I’ve run into this problem several times in other projects. I’ll get it fixed and make an appveyor script for CI on windows

@shangjiaxuan
Copy link
Author

Located the position to be from the tbb include lines using static_asserts. WIN32_LEAN_AND_MEAN doesn't work, but NOMINMAX works.

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

No branches or pull requests

2 participants