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

Added NOMINMAX macro definition #40

Merged
merged 1 commit into from
Feb 14, 2019
Merged

Added NOMINMAX macro definition #40

merged 1 commit into from
Feb 14, 2019

Conversation

olegded
Copy link
Contributor

@olegded olegded commented Feb 13, 2019

Pull Request Template

Description

Without this macro, there are following errors in VS:

...\vsg\src\include\vsg/viewer/Window.h(156): warning C4003: not enough arguments for function-like macro invocation 'max'
1>...\vsg\src\include\vsg/viewer/Window.h(156): error C2589: '(': illegal token on right side of '::'
1>...\vsg\src\include\vsg/viewer/Window.h(156): error C2059: syntax error: ')'
1>...\vsg\src\include\vsg/viewer/Window.h(156): error C2062: type 'unknown-type' unexpected
1>...\vsg\src\include\vsg/viewer/Window.h(219): fatal error C1903: unable to recover from previous error(s); stopping compilation

Since we already in platform/win32/Win32_Window.h, I skipped the ifdef _WIN32 guard

Type of change

[x] Compiler error

How Has This Been Tested?

Compiling vsg, osg2vsg and running vsgExamples in RELEASE/DEBUG configurations on Windows10, 64-bit version, using CMake v 3.13.3 and VS Community Edition 2017 v15.9.6

Without this macro, there are following errors in VS:

```bash
...\vsg\src\include\vsg/viewer/Window.h(156): warning C4003: not enough arguments for function-like macro invocation 'max'
1>...\vsg\src\include\vsg/viewer/Window.h(156): error C2589: '(': illegal token on right side of '::'
1>...\vsg\src\include\vsg/viewer/Window.h(156): error C2059: syntax error: ')'
1>...\vsg\src\include\vsg/viewer/Window.h(156): error C2062: type 'unknown-type' unexpected
1>...\vsg\src\include\vsg/viewer/Window.h(219): fatal error C1903: unable to recover from previous error(s); stopping compilation
```

Since we already in `platform/win32/Win32_Window.h`, I skipped the `ifdef _WIN32` guard
@tomhog
Copy link
Contributor

tomhog commented Feb 14, 2019

The nominmax is interesting,

I and others have been building with VisualStudio 2017 Community (i'm on 15.9.1). I wonder why you had the issue, windows sdk version perhaps?

Not that is matters just interesting it's happening, and thanks for providing a fix.

@olegded
Copy link
Contributor Author

olegded commented Feb 14, 2019

@tomhog I'm using VS Community Edition 2017 v15.9.7, SDK 10.0.17763.132

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.

3 participants