Noticed that internal/stdbool.h and addr2line.c are the only two place
where missing/stdbool.h is included. Why not delete the file so that
we can merge internal/stdbool.h and missing/stdbool.h into one.
Saves comitters' daily life by avoid #include-ing everything from
internal.h to make each file do so instead. This would significantly
speed up incremental builds.
We take the following inclusion order in this changeset:
1. "ruby/config.h", where _GNU_SOURCE is defined (must be the very
first thing among everything).
2. RUBY_EXTCONF_H if any.
3. Standard C headers, sorted alphabetically.
4. Other system headers, maybe guarded by #ifdef
5. Everything else, sorted alphabetically.
Exceptions are those win32-related headers, which tend not be self-
containing (headers have inclusion order dependencies).
These headers need no rewrite. Just add some minor tweaks, like
addition of #include lines. Mainly cosmetic.
TIMET_MAX_PLUS_ONE was deleted because the macro was used from only
one place (directly write expression there).
Annotated MJIT_FUNC_EXPORTED functions as such. Declaration of
rb_sym_to_proc is moved into this file because the function is defined
in proc.c rather than string.c.
Improved readability by reducing the use of macros. Also moved some
part of internal/compilers.h into this file, because it seems to be the
right place for them.
This file containes other materials than in compile.c. I could perhaps
split them into files, but felt overkill. Just add comments that
describe the situations.
This file has almost nothing to do. Added some #ifdef lines and
rearranged file contents.
Those macros are unable to translate into inline functions, because they
are used as lvalues of assignments.
Reduce macros to make them inline functions, as well as mark
MJIT_FUNC_EXPORTED functions explicitly as such.
Definition of ar_hint_t is simplified. This has been the only possible
definition so far.
Improving readability by converting some macros into inline functions.
Also improved support for recent x86_64 processors, which have better
instructions for the purposes.
With these macros implemented we can write codes just like we can assume
the compiler being clang. MSC_VERSION_SINCE is defined to implement
those macros, but turned out to be handy for other places. The -fdeclspec
compiler flag is necessary for clang to properly handle __has_declspec().
Now that we no longer support old compilers, we can safely delete
several obsolete #ifdef gurads. Also because (as of writing) it is
impossible to compile the program using C++ compilers, lets just
entirely prohibit __cplusplus to reduce # of LOCs.
Note however that we still cannot eliminate __STDC_VERSION__ checks,
because MSVC does not define it, saying its C99 support is partial.
See also https://social.msdn.microsoft.com/Forums/vstudio/en-US/53a4fd75-9f97-48b2-aa63-2e2e5a15efa3
One day, I could not resist the way it was written. I finally started
to make the code clean. This changeset is the beginning of a series of
housekeeping commits. It is a simple refactoring; split internal.h into
files, so that we can divide and concur in the upcoming commits. No
lines of codes are either added or removed, except the obvious file
headers/footers. The generated binary is identical to the one before.