Skip to content

Added NOMINMAX macro definition#40

Merged
vsg-dev merged 1 commit into
vsg-dev:masterfrom
olegded:patch-1
Feb 14, 2019
Merged

Added NOMINMAX macro definition#40
vsg-dev merged 1 commit into
vsg-dev:masterfrom
olegded:patch-1

Conversation

@olegded
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

olegded commented Feb 14, 2019

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

@rainergericke rainergericke mentioned this pull request Nov 9, 2024
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