1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

include what you use.

This reverts commit 443389effc.
This reverts commit d94960f22e.

Inclusion of header files must be explicit.  Every file shall directly
include what is necessary.

https://github.com/include-what-you-use/include-what-you-use says:

> When every file includes what it uses, then it is possible to edit any
> file and remove unused headers, without fear of accidentally breaking
> the upwards dependencies of that file. It also becomes easy to
> automatically track and update dependencies in the source code.

Though we don't use iwyu itself, the principle quoted above is a good
thing that we can agree.

Now that include guards were added to every and all of the headers
inside of our project this changeset does not increase compile time, at
least on my machine.
This commit is contained in:
卜部昌平 2020-04-12 15:42:45 +09:00
parent 4ff3f20540
commit c37a357c13
Notes: git 2020-04-13 16:06:29 +09:00
40 changed files with 57 additions and 21 deletions

View file

@ -21,6 +21,9 @@
* @brief Defines #RUBY3_TOKEN_PASTE.
*/
#include "ruby/3/config.h"
#include "ruby/3/compiler_since.h"
#include "ruby/3/has/warning.h"
#include "ruby/3/warning_push.h"
/* :TODO: add your compiler here. There are many compilers that can suppress
* warnings via pragmas, but not all of them accept such things inside of `#if`