Refactor to "include-what-you-use"
This patchset aims to make future refactoring and cleanups simpler by ensuring that each file includes what it uses - see https://include-what-you-use.org/ for some more details about this concept and the tool used to help perform the refactoring.
No functional change is intended or expected and all tests are passing.
The include-what-you-use tool is awkward to use with the current state of the build system - and will always be difficult to use in a multi-platform safe way. However, I hope to provide a non manual process for running with the tool in the future.
There is still cleanup work to be done in the headers, but this
concludes the major include-what-you-use refactoring. No functional
change is intended or expected and all tests are passing.
It is now a lot easier to see what is used from each header and work on
possible refactoring in the future.
The include-what-you-use tool is awkward to use with the current state
of the build system - and will always be difficult to use in a
multi-platform safe way. However, I hope to provide a non manual
process for running with the tool in the future.
* Add close window support for Windows
* Support logoff and shudown events as well
Without this change, when you close the terminal/shell window, it won't have the time to clean up which can cause authentication errors if you try to reconnect.
Blocking here infinitely is fine since when our main thread returns, it will shut down anyway
I found Go is doing this when I was searching, and there's a comment explained how it works: https://github.com/golang/go/issues/41884#issuecomment-706695923