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

IWYU support (part 3): Improve Visual Studio compatibility #27785

Merged
merged 4 commits into from
Jan 22, 2019

Conversation

jbytheway
Copy link
Contributor

Summary

SUMMARY: Infrastructure "Rationalize Visual Studio compatibility code"

Purpose of change

The attempt at running IWYU led to some issues on Visual Studio (see CI failures on #27713). Looking through the AppVeyor build log, this is an attempt to resolve those.

Describe the solution

  • Tell IWYU about two compatibility headers: the existing posix_time.h and a new math_defines.h.
  • Add a mapping for a libstdc++ debug header I'd missed last time (debug/deque).
  • Manually add a strings.h include in a place which will not be compiled by Visual Studio, so that IWYU will not add it amongst the general includes.

Running IWYU broke the compile on VS because of it's complicated
handling of math.h constants.

This provides a single header to access those constants, and we can use
IWYU to force people to include it, so that devs on other platforms are
less likely to write code that breaks on VS.

Also, this should make it possible to run IWYU without breaking the VS
build.
This needs to be added by hand because it's non-Windows only, and IWYU
will add it in a place where Windows will choke on it.
Missed this before; highlighted by a VS compile error.
IWYU needs to know that this is our compatibility header in order to use
the correct includes.
@ZhilkinSerg ZhilkinSerg added [C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style labels Jan 22, 2019
@ZhilkinSerg ZhilkinSerg merged commit d07e1e4 into CleverRaven:master Jan 22, 2019
@jbytheway jbytheway deleted the iwyu_vs_fixes branch January 22, 2019 22:37
jbytheway added a commit to jbytheway/Cataclysm-DDA that referenced this pull request Jan 23, 2019
This was removed in CleverRaven#27785 from posix_time.h and should have been added
back into posix_time.cpp, but wasn't.   Has been breaking the Mingw CI.
ThinkInvis pushed a commit to ThinkInvis/Cataclysm-DDA that referenced this pull request Jan 24, 2019
This was removed in CleverRaven#27785 from posix_time.h and should have been added
back into posix_time.cpp, but wasn't.   Has been breaking the Mingw CI.
ThinkInvis pushed a commit to ThinkInvis/Cataclysm-DDA that referenced this pull request Jan 24, 2019
This was removed in CleverRaven#27785 from posix_time.h and should have been added
back into posix_time.cpp, but wasn't.   Has been breaking the Mingw CI.
ThinkInvis pushed a commit to ThinkInvis/Cataclysm-DDA that referenced this pull request Jan 24, 2019
This was removed in CleverRaven#27785 from posix_time.h and should have been added
back into posix_time.cpp, but wasn't.   Has been breaking the Mingw CI.
ThinkInvis pushed a commit to ThinkInvis/Cataclysm-DDA that referenced this pull request Jan 24, 2019
This was removed in CleverRaven#27785 from posix_time.h and should have been added
back into posix_time.cpp, but wasn't.   Has been breaking the Mingw CI.
ThinkInvis pushed a commit to ThinkInvis/Cataclysm-DDA that referenced this pull request Jan 24, 2019
This was removed in CleverRaven#27785 from posix_time.h and should have been added
back into posix_time.cpp, but wasn't.   Has been breaking the Mingw CI.
ThinkInvis pushed a commit to ThinkInvis/Cataclysm-DDA that referenced this pull request Jan 24, 2019
This was removed in CleverRaven#27785 from posix_time.h and should have been added
back into posix_time.cpp, but wasn't.   Has been breaking the Mingw CI.
ThinkInvis pushed a commit to ThinkInvis/Cataclysm-DDA that referenced this pull request Jan 24, 2019
This was removed in CleverRaven#27785 from posix_time.h and should have been added
back into posix_time.cpp, but wasn't.   Has been breaking the Mingw CI.
ThinkInvis pushed a commit to ThinkInvis/Cataclysm-DDA that referenced this pull request Jan 24, 2019
This was removed in CleverRaven#27785 from posix_time.h and should have been added
back into posix_time.cpp, but wasn't.   Has been breaking the Mingw CI.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants