Skip to content

Conversation

@oldnewthing
Copy link
Member

If you pass -DWINRT_NATVIS to the compiler (to force natvis support even in retail builds), it defines the preprocessor symbol to 1, as if you had written

#define WINRT_NATVIS 1

This causes debug builds to generate a macro redefinition warning because the debug build force-defines WINRT_NATVIS as the empty macro.

We don't really care what it defined to, as long as it's defined. Guard the redefinition to avoid the spurious warning.

If you pass `-DWINRT_NATVIS` to the compiler, it defines
the preprocessor symbol to `1`, as if you had written

```cpp
#define WINRT_NATVIS 1
```

This causes debug builds to generate a macro redefinition warning
because the debug build force-defines `WINRT_NATVIS` as the empty
macro.

We don't really care what it defined to, as long as it's defined.
Guard the redefinition to avoid the spurious warning.
@oldnewthing
Copy link
Member Author

The Windows build system uses -DWINRT_NATVIS for internal developer builds to make debugging easier, but it results in these spurious warnings.

@kennykerr kennykerr merged commit 2d9ed4e into microsoft:master Oct 21, 2021
@oldnewthing oldnewthing deleted the natvis_redef branch October 21, 2021 17:55
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.

2 participants