summaryrefslogtreecommitdiff
path: root/include/ruby/3/has
AgeCommit message (Collapse)Author
2020-04-13add #include guard hack卜部昌平
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
2020-04-10RUBY3_HAS_ATTRIBUTE: fix fallbacks卜部昌平
Same as 133ae0807d661eac174b59c6e91c11a40975baea
2020-04-10RUBY3_HAS_BUILTIN: fix __builtin_unreachable卜部昌平
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
2020-04-10reduce duplicate include.Koichi Sasada
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
2020-04-08RUBY3_HAS_BUILTIN: icc has broken __has_builtin卜部昌平
It turned out that compilation errors in icc were due to their having broken __has_builtin. Let's just skip such situations.
2020-04-08RUBY3_HAS_BUILTIN: fix for nonexistent builtin卜部昌平
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.
2020-04-08Merge pull request #2991 from shyouhei/ruby.h卜部昌平
Split ruby.h Notes: Merged-By: shyouhei <shyouhei@ruby-lang.org>