diff options
author | 卜部昌平 <[email protected]> | 2019-12-04 17:16:30 +0900 |
---|---|---|
committer | 卜部昌平 <[email protected]> | 2019-12-26 20:45:12 +0900 |
commit | 5e22f873ed26092522f9bfc617d729bac88b284f () | |
tree | 8d66856526cd7efa87b46c966298e6f42d67e68f /internal.h | |
parent | 33e9601938a79dae149caa88ff1bc06d376dd376 (diff) |
decouple internal.h headers
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).
Notes: Merged: https://.com/ruby/ruby/pull/2711
-rw-r--r-- | internal.h | 102 |
1 files changed, 45 insertions, 57 deletions
@@ -18,17 +18,9 @@ # error not for C++ #endif -#include "ruby/encoding.h" -#include "ruby/io.h" -#include "internal/stdbool.h" -#include "internal/bits.h" - #define LIKELY(x) RB_LIKELY(x) #define UNLIKELY(x) RB_UNLIKELY(x) -#include "internal/compilers.h" -#include "internal/sanitizers.h" - #define numberof(array) ((int)(sizeof(array) / sizeof((array)[0]))) #define roomof(x, y) (((x) + (y) - 1) / (y)) #define type_roomof(x, y) roomof(sizeof(x), sizeof(y)) @@ -36,54 +28,50 @@ /* Prevent compiler from reordering access */ #define ACCESS_ONCE(type,x) (*((volatile type *)&(x))) -#include "internal/serial.h" -#include "internal/static_assert.h" -#include "internal/time.h" -#include "internal/fixnum.h" -#include "internal/bignum.h" -#include "internal/rational.h" -#include "internal/numeric.h" -#include "internal/complex.h" -#include "internal/hash.h" -#include "internal/missing.h" -#include "internal/struct.h" -#include "internal/class.h" -#include "internal/imemo.h" -#include "internal/compar.h" -#include "internal/variable.h" -#include "internal/array.h" -#include "internal/debug.h" -#include "internal/compile.h" -#include "internal/cont.h" -#include "internal/dir.h" -#include "internal/encoding.h" -#include "internal/enum.h" -#include "internal/eval.h" -#include "internal/error.h" -#include "internal/file.h" -#include "internal/gc.h" -#include "internal/io.h" -#include "internal/load.h" -#include "internal/loadpath.h" -#include "internal/math.h" -#include "internal/mjit.h" -#include "internal/object.h" -#include "internal/parse.h" -#include "internal/proc.h" -#include "internal/process.h" -#include "internal/range.h" -#include "internal/re.h" -#include "internal/signal.h" -#include "internal/string.h" -#include "internal/symbol.h" -#include "internal/thread.h" -#include "internal/transcode.h" -#include "internal/enc.h" -#include "internal/util.h" -#include "internal/vm.h" -#include "internal/enumerator.h" -#include "internal/random.h" -#include "internal/inits.h" -#include "internal/warnings.h" #endif /* RUBY_INTERNAL_H */ |