* Change _ctype.h and __locale to cctype and clocale
* Change _wctype.h to cwctype in game.cpp
* Change __functional_base to functional
* Remove libcxx internal headers
* Remove UNIX system headers
* Fix clang-tidy error with -nostdinc++
This is failing on Visual Studio with no sign of a fix coming soon. The
failure isn't super critical, and the code under test is not likely to
change, so marking this test mayfail should be pretty low risk.
The existing string_formatter test has a weird behaviour where a bunch
of unrelated things that were CAPTUREd get printed out when any of the
tests fail. This can be seen in the current Appveyor test failures. I
think this is actually a Catch2 bug, or possibly a limitation of how
Catch2 implements required-throw tests, but I'm too lazy to investigate
that so I'm just working around it.
Basically, the tests that throw an error are not removing their strings
from Catch2's output state, so they are still printed out for later test
failures even though they are unrelated.
Fix by separating out the throw-based tests into a separate test case.
* Disable space check after unicode ellipses
* Fix spacing
* Suppress false positives
* Do not remove spaces before ellipses and colons to suppress false positives
* Fix spacing of raw strings
* Update text style check test
* Enable cata-text-style
* Enable bugprone-use-after-move
Enable this clang-tidy check and deal with associated warnings.
Mostly these were suppressions for things in the tests that are
specifically testing move constructor semantics, but one case was a
genuine latent bug.
* Fix mismatched declaration name
This error seems to have crept into master.
* Add IWYU pragma: keep
* Run IWYU and astyle
* Run IWYU a second time
* Prevent #include <cxxabi.h>
Unclear why IWYU thinks this is needed. It isn't, and it causes
problems on Visual Studio.
A first step towards IWYU support. Doing the sorting first because it
makes reviewing any additions or removals of headers much simpler.
The IWYU order is:
- Associated headers
- Misc system headers
- C++ STL headers
- Other project headers
The biggest change is moving system headers before project headers (they
are usually afterwards in Cata at the moment.
The associated header for a cpp file is the header file which declares
the functions defined in that cpp file. Normally that's the one which
shares the same name (up to extension), and if so IWYU figures it out
automatically.
However, in this project there are many corner cases, so we need to use
IWYU pragma: associated to tell it which header (or, in some cases,
which headers) is the associated header. We are unusual in having
multiple associated headers for some files, which might lead to
discovering some interesting IWYU bugs later, but in theory it is
supported.
That was the only place that actually called it anyway.
Now there is only one function: `raw_string_format` (which is now public in `string_formatter` so the test code can call it).
- Rename `string_format` to `raw_string_format`.
- Removed the overload of `string_format` that takes a `std::string`. The other overload (taking a `const char*`) will be used instead.
Add `string_formatter` class and helper function `string_format` (which takes the place of the previously removed / renamed version).
As the implementation of it is in another header, include the new header "string_formatter.h" where it is used.
Add tests for the new code.