Age | Commit message (Collapse) | Author |
|
According to MSVC manual (*1), cl.exe can skip including a header file
when that:
- contains #pragma once, or
- starts with #ifndef, or
- starts with #if ! defined.
GCC has a similar trick (*2), but it acts more stricter (e. g. there
must be _no tokens_ outside of #ifndef...#endif).
Sun C lacked #pragma once for a looong time. Oracle Developer Studio
12.5 finally implemented it, but we cannot assume such recent version.
This changeset modifies header files so that each of them include
strictly one #ifndef...#endif. I believe this is the most portable way
to trigger compiler optimizations. [Bug #16770]
*1: https://docs.microsoft.com/en-us/cpp/preprocessor/once
*2: https://gcc.gnu.org/onlinedocs/cppinternals/Guard-Macros.html
Notes:
Merged: https://github.com/ruby/ruby/pull/3023
|
|
Same as 133ae0807d661eac174b59c6e91c11a40975baea
|
|
This macro has to be truthy, otherwise the `+0` trick above evalues
RUBY3_HAS_BUILTIN(__builtin_unreachable) to be always false.
Notes:
Merged: https://github.com/ruby/ruby/pull/3011
|
|
Without this patch, 20k files are opened (openat syscall) because
of duplicate includes. This patch reduced it to 3k and build time
was reduced compile time of range.o from 15sec -> 3sec on my machine.
[Bug #16772]
Notes:
Merged: https://github.com/ruby/ruby/pull/3010
|
|
It turned out that compilation errors in icc were due to their having
broken __has_builtin. Let's just skip such situations.
|
|
Trying to fix icc breakage:
https://rubyci.org/logs/rubyci.s3.amazonaws.com/icc-x64/ruby-master/log/20200408T050004Z.fail.html.gz
It seems the macro had problems when a builtin does not exist for the
target compiler. Force evaluete to 0 then, by adding 0 to the
expression.
|
|
Split ruby.h
Notes:
Merged-By: shyouhei <shyouhei@ruby-lang.org>
|