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

build(win): Fix windows.h pre-definitions #3965

Merged
merged 1 commit into from
Aug 28, 2023

Conversation

lgritz
Copy link
Collaborator

@lgritz lgritz commented Aug 27, 2023

  • Avoid possible double define of NOMINMAX in platform.h
  • Move other Windows symbol definitions into the cmake file instead of
    repeating them in certain .cpp files.

Fixes #3964

@jessey-git
Copy link
Contributor

The changes to platform.h look good.

For the others inside the libutil project, you could consider doing the following in cmake, rather than pollute the source files with any of the #defines:
https://github.com/OpenImageIO/oiio/blob/master/src/libutil/CMakeLists.txt#L37
add_definitions(-DWIN32_LEAN_AND_MEAN -DNOMINMAX -DNOGDI -DVC_EXTRALEAN)

Up to you though. The current changes are also ok.

@lgritz
Copy link
Collaborator Author

lgritz commented Aug 27, 2023

Oh, good suggestion. Yes, I will do that.

* Avoid possible double define of NOMINMAX in platform.h
* Move other Windows symbl definitions into the cmake file instead of
  repeating them in certain .cpp files.

Fixes 3964

Signed-off-by: Larry Gritz <[email protected]>
@lgritz lgritz merged commit 83c8853 into AcademySoftwareFoundation:master Aug 28, 2023
23 checks passed
@lgritz lgritz deleted the lg-win branch August 28, 2023 03:36
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.

Redefinition of NOMINMAX causes warning in Windows
2 participants