summaryrefslogtreecommitdiff
path: root/include/ruby
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2020-04-10 14:11:40 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2020-04-13 16:06:00 +0900
commit4ff3f205408ff8bb413d69151105d301858136ba (patch)
tree0494fea3f4cdb82ec1d34e462438389dfea8b8da /include/ruby
parenta3f6f67967644f34226b4424227d2eec52fedd45 (diff)
add #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
Notes: Merged: https://github.com/ruby/ruby/pull/3023
Diffstat (limited to 'include/ruby')
-rw-r--r--include/ruby/3/anyargs.h8
-rw-r--r--include/ruby/3/arithmetic.h5
-rw-r--r--include/ruby/3/arithmetic/char.h6
-rw-r--r--include/ruby/3/arithmetic/double.h6
-rw-r--r--include/ruby/3/arithmetic/fixnum.h6
-rw-r--r--include/ruby/3/arithmetic/gid_t.h6
-rw-r--r--include/ruby/3/arithmetic/int.h6
-rw-r--r--include/ruby/3/arithmetic/intptr_t.h6
-rw-r--r--include/ruby/3/arithmetic/long.h6
-rw-r--r--include/ruby/3/arithmetic/long_long.h6
-rw-r--r--include/ruby/3/arithmetic/mode_t.h6
-rw-r--r--include/ruby/3/arithmetic/off_t.h6
-rw-r--r--include/ruby/3/arithmetic/pid_t.h6
-rw-r--r--include/ruby/3/arithmetic/short.h6
-rw-r--r--include/ruby/3/arithmetic/size_t.h6
-rw-r--r--include/ruby/3/arithmetic/st_data_t.h6
-rw-r--r--include/ruby/3/arithmetic/uid_t.h6
-rw-r--r--include/ruby/3/assume.h6
-rw-r--r--include/ruby/3/attr/alloc_size.h12
-rw-r--r--include/ruby/3/attr/artificial.h12
-rw-r--r--include/ruby/3/attr/cold.h13
-rw-r--r--include/ruby/3/attr/const.h20
-rw-r--r--include/ruby/3/attr/constexpr.h24
-rw-r--r--include/ruby/3/attr/deprecated.h11
-rw-r--r--include/ruby/3/attr/diagnose_if.h11
-rw-r--r--include/ruby/3/attr/enum_extensibility.h12
-rw-r--r--include/ruby/3/attr/error.h12
-rw-r--r--include/ruby/3/attr/flag_enum.h12
-rw-r--r--include/ruby/3/attr/forceinline.h13
-rw-r--r--include/ruby/3/attr/format.h18
-rw-r--r--include/ruby/3/attr/maybe_unused.h14
-rw-r--r--include/ruby/3/attr/noalias.h12
-rw-r--r--include/ruby/3/attr/nodiscard.h15
-rw-r--r--include/ruby/3/attr/noexcept.h11
-rw-r--r--include/ruby/3/attr/noinline.h13
-rw-r--r--include/ruby/3/attr/nonnull.h12
-rw-r--r--include/ruby/3/attr/noreturn.h11
-rw-r--r--include/ruby/3/attr/pure.h19
-rw-r--r--include/ruby/3/attr/restrict.h11
-rw-r--r--include/ruby/3/attr/returns_nonnull.h11
-rw-r--r--include/ruby/3/attr/warning.h12
-rw-r--r--include/ruby/3/attr/weakref.h12
-rw-r--r--include/ruby/3/cast.h11
-rw-r--r--include/ruby/3/compiler_is.h13
-rw-r--r--include/ruby/3/compiler_is/apple.h11
-rw-r--r--include/ruby/3/compiler_is/clang.h11
-rw-r--r--include/ruby/3/compiler_is/gcc.h11
-rw-r--r--include/ruby/3/compiler_is/intel.h11
-rw-r--r--include/ruby/3/compiler_is/msvc.h11
-rw-r--r--include/ruby/3/compiler_is/sunpro.h11
-rw-r--r--include/ruby/3/compiler_since.h7
-rw-r--r--include/ruby/3/config.h6
-rw-r--r--include/ruby/3/constant_p.h12
-rw-r--r--include/ruby/3/core.h5
-rw-r--r--include/ruby/3/core/rarray.h6
-rw-r--r--include/ruby/3/core/rbasic.h6
-rw-r--r--include/ruby/3/core/rbignum.h6
-rw-r--r--include/ruby/3/core/rclass.h6
-rw-r--r--include/ruby/3/core/rdata.h6
-rw-r--r--include/ruby/3/core/rfile.h6
-rw-r--r--include/ruby/3/core/rhash.h6
-rw-r--r--include/ruby/3/core/rmatch.h6
-rw-r--r--include/ruby/3/core/robject.h6
-rw-r--r--include/ruby/3/core/rregexp.h6
-rw-r--r--include/ruby/3/core/rstring.h6
-rw-r--r--include/ruby/3/core/rstruct.h6
-rw-r--r--include/ruby/3/core/rtypeddata.h6
-rw-r--r--include/ruby/3/ctype.h6
-rw-r--r--include/ruby/3/dllexport.h6
-rw-r--r--include/ruby/3/dosish.h6
-rw-r--r--include/ruby/3/error.h6
-rw-r--r--include/ruby/3/eval.h6
-rw-r--r--include/ruby/3/event.h6
-rw-r--r--include/ruby/3/fl_type.h6
-rw-r--r--include/ruby/3/gc.h6
-rw-r--r--include/ruby/3/glob.h6
-rw-r--r--include/ruby/3/globals.h6
-rw-r--r--include/ruby/3/has/attribute.h11
-rw-r--r--include/ruby/3/has/builtin.h11
-rw-r--r--include/ruby/3/has/c_attribute.h11
-rw-r--r--include/ruby/3/has/cpp_attribute.h17
-rw-r--r--include/ruby/3/has/declspec_attribute.h12
-rw-r--r--include/ruby/3/has/extension.h12
-rw-r--r--include/ruby/3/has/feature.h12
-rw-r--r--include/ruby/3/has/warning.h12
-rw-r--r--include/ruby/3/intern/array.h6
-rw-r--r--include/ruby/3/intern/bignum.h6
-rw-r--r--include/ruby/3/intern/class.h6
-rw-r--r--include/ruby/3/intern/compar.h6
-rw-r--r--include/ruby/3/intern/complex.h6
-rw-r--r--include/ruby/3/intern/cont.h6
-rw-r--r--include/ruby/3/intern/dir.h6
-rw-r--r--include/ruby/3/intern/enum.h6
-rw-r--r--include/ruby/3/intern/enumerator.h6
-rw-r--r--include/ruby/3/intern/error.h6
-rw-r--r--include/ruby/3/intern/eval.h6
-rw-r--r--include/ruby/3/intern/file.h6
-rw-r--r--include/ruby/3/intern/gc.h6
-rw-r--r--include/ruby/3/intern/hash.h6
-rw-r--r--include/ruby/3/intern/io.h6
-rw-r--r--include/ruby/3/intern/load.h6
-rw-r--r--include/ruby/3/intern/marshal.h6
-rw-r--r--include/ruby/3/intern/numeric.h6
-rw-r--r--include/ruby/3/intern/object.h6
-rw-r--r--include/ruby/3/intern/parse.h6
-rw-r--r--include/ruby/3/intern/proc.h6
-rw-r--r--include/ruby/3/intern/process.h6
-rw-r--r--include/ruby/3/intern/random.h6
-rw-r--r--include/ruby/3/intern/range.h6
-rw-r--r--include/ruby/3/intern/rational.h6
-rw-r--r--include/ruby/3/intern/re.h6
-rw-r--r--include/ruby/3/intern/ruby.h6
-rw-r--r--include/ruby/3/intern/select.h6
-rw-r--r--include/ruby/3/intern/select/largesize.h6
-rw-r--r--include/ruby/3/intern/select/posix.h6
-rw-r--r--include/ruby/3/intern/select/win32.h6
-rw-r--r--include/ruby/3/intern/signal.h6
-rw-r--r--include/ruby/3/intern/sprintf.h6
-rw-r--r--include/ruby/3/intern/string.h6
-rw-r--r--include/ruby/3/intern/struct.h6
-rw-r--r--include/ruby/3/intern/thread.h7
-rw-r--r--include/ruby/3/intern/time.h8
-rw-r--r--include/ruby/3/intern/variable.h6
-rw-r--r--include/ruby/3/intern/vm.h6
-rw-r--r--include/ruby/3/interpreter.h7
-rw-r--r--include/ruby/3/iterator.h6
-rw-r--r--include/ruby/3/memory.h6
-rw-r--r--include/ruby/3/method.h6
-rw-r--r--include/ruby/3/module.h6
-rw-r--r--include/ruby/3/newobj.h6
-rw-r--r--include/ruby/3/rgengc.h6
-rw-r--r--include/ruby/3/scan_args.h6
-rw-r--r--include/ruby/3/special_consts.h7
-rw-r--r--include/ruby/3/static_assert.h16
-rw-r--r--include/ruby/3/stdalign.h16
-rw-r--r--include/ruby/3/stdbool.h6
-rw-r--r--include/ruby/3/symbol.h6
-rw-r--r--include/ruby/3/token_paste.h11
-rw-r--r--include/ruby/3/value.h6
-rw-r--r--include/ruby/3/value_type.h6
-rw-r--r--include/ruby/3/variable.h8
-rw-r--r--include/ruby/3/warning_push.h11
-rw-r--r--include/ruby/3/xmalloc.h6
-rw-r--r--include/ruby/assert.h6
-rw-r--r--include/ruby/backward.h10
-rw-r--r--include/ruby/backward/2/assume.h6
-rw-r--r--include/ruby/backward/2/attributes.h6
-rw-r--r--include/ruby/backward/2/bool.h6
-rw-r--r--include/ruby/backward/2/extern.h11
-rw-r--r--include/ruby/backward/2/gcc_version_since.h6
-rw-r--r--include/ruby/backward/2/inttypes.h6
-rw-r--r--include/ruby/backward/2/limits.h6
-rw-r--r--include/ruby/backward/2/long_long.h11
-rw-r--r--include/ruby/backward/2/r_cast.h6
-rw-r--r--include/ruby/backward/2/rmodule.h7
-rw-r--r--include/ruby/backward/2/stdalign.h6
-rw-r--r--include/ruby/backward/2/stdarg.h6
-rw-r--r--include/ruby/backward/classext.h15
-rw-r--r--include/ruby/backward/cxxanyargs.hpp5
-rw-r--r--include/ruby/backward/rubyio.h12
-rw-r--r--include/ruby/backward/rubysig.h27
-rw-r--r--include/ruby/backward/st.h12
-rw-r--r--include/ruby/backward/util.h12
-rw-r--r--include/ruby/debug.h25
-rw-r--r--include/ruby/defines.h6
-rw-r--r--include/ruby/encoding.h24
-rw-r--r--include/ruby/intern.h28
-rw-r--r--include/ruby/io.h24
-rw-r--r--include/ruby/missing.h7
-rw-r--r--include/ruby/re.h24
-rw-r--r--include/ruby/regex.h22
-rw-r--r--include/ruby/ruby.h28
-rw-r--r--include/ruby/subst.h10
-rw-r--r--include/ruby/thread.h24
-rw-r--r--include/ruby/thread_native.h23
-rw-r--r--include/ruby/util.h24
-rw-r--r--include/ruby/version.h31
-rw-r--r--include/ruby/vm.h24
178 files changed, 876 insertions, 803 deletions
diff --git a/include/ruby/3/anyargs.h b/include/ruby/3/anyargs.h
index 7c2aa05c218..7eff1b2cc98 100644
--- a/include/ruby/3/anyargs.h
+++ b/include/ruby/3/anyargs.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_ANYARGS_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_ANYARGS_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -65,8 +67,6 @@
* `__builtin_types_compatible_p`, and in doing so we need to distinguish
* ::rb_f_notimplement from others, by type.
*/
-#ifndef RUBY3_ANYARGS_H
-#define RUBY3_ANYARGS_H
#include "ruby/3/attr/maybe_unused.h"
#include "ruby/3/attr/nonnull.h"
#include "ruby/3/attr/weakref.h"
@@ -371,4 +371,4 @@ RUBY3_ANYARGS_DECL(rb_define_method, VALUE, const char *)
#endif
-#endif /* RUBY3_ANYARGS_H */
+#endif /* RUBY3_ANYARGS_H */
diff --git a/include/ruby/3/arithmetic.h b/include/ruby/3/arithmetic.h
index 366014ac773..5dcdfcd9e48 100644
--- a/include/ruby/3/arithmetic.h
+++ b/include/ruby/3/arithmetic.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_ARITHMETIC_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_ARITHMETIC_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -33,3 +35,4 @@
#include "ruby/3/arithmetic/size_t.h"
#include "ruby/3/arithmetic/st_data_t.h"
#include "ruby/3/arithmetic/uid_t.h"
+#endif /* RUBY3_ARITHMETIC_H */
diff --git a/include/ruby/3/arithmetic/char.h b/include/ruby/3/arithmetic/char.h
index 94329b7a9eb..03afa0a4062 100644
--- a/include/ruby/3/arithmetic/char.h
+++ b/include/ruby/3/arithmetic/char.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_ARITHMETIC_CHAR_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_ARITHMETIC_CHAR_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Arithmetic conversion between C's `char` and Ruby's.
*/
-#ifndef RUBY3_ARITHMETIC_CHAR_H
-#define RUBY3_ARITHMETIC_CHAR_H
#include "ruby/3/arithmetic/int.h" /* NUM2INT is here, but */
#include "ruby/3/arithmetic/long.h" /* INT2FIX is here.*/
#include "ruby/3/attr/artificial.h"
diff --git a/include/ruby/3/arithmetic/double.h b/include/ruby/3/arithmetic/double.h
index 82e9fdc3b1b..4a37611a21c 100644
--- a/include/ruby/3/arithmetic/double.h
+++ b/include/ruby/3/arithmetic/double.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_ARITHMETIC_DOUBLE_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_ARITHMETIC_DOUBLE_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Arithmetic conversion between C's `double` and Ruby's.
*/
-#ifndef RUBY3_ARITHMETIC_DOUBLE_H
-#define RUBY3_ARITHMETIC_DOUBLE_H
#include "ruby/3/attr/pure.h"
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
diff --git a/include/ruby/3/arithmetic/fixnum.h b/include/ruby/3/arithmetic/fixnum.h
index e995b5f3f88..d7214e080b8 100644
--- a/include/ruby/3/arithmetic/fixnum.h
+++ b/include/ruby/3/arithmetic/fixnum.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_ARITHMETIC_FIXNUM_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_ARITHMETIC_FIXNUM_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Handling of integers formerly known as Fixnums.
*/
-#ifndef RUBY3_ARITHMETIC_FIXNUM_H
-#define RUBY3_ARITHMETIC_FIXNUM_H
#include "ruby/backward/2/limits.h"
#define FIXABLE RB_FIXABLE
diff --git a/include/ruby/3/arithmetic/gid_t.h b/include/ruby/3/arithmetic/gid_t.h
index ebdd4d21f69..7c4c1b00ed0 100644
--- a/include/ruby/3/arithmetic/gid_t.h
+++ b/include/ruby/3/arithmetic/gid_t.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_ARITHMETIC_GID_T_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_ARITHMETIC_GID_T_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -28,3 +30,5 @@
#ifndef NUM2GIDT
# define NUM2GIDT RB_NUM2LONG
#endif
+
+#endif /* RUBY3_ARITHMETIC_GID_T_H */
diff --git a/include/ruby/3/arithmetic/int.h b/include/ruby/3/arithmetic/int.h
index 36485167cc3..8c2e9f2bd86 100644
--- a/include/ruby/3/arithmetic/int.h
+++ b/include/ruby/3/arithmetic/int.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_ARITHMETIC_INT_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_ARITHMETIC_INT_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Arithmetic conversion between C's `int` and Ruby's.
*/
-#ifndef RUBY3_ARITHMETIC_INT_H
-#define RUBY3_ARITHMETIC_INT_H
#include "ruby/3/config.h"
#include "ruby/3/arithmetic/fixnum.h"
#include "ruby/3/arithmetic/intptr_t.h"
diff --git a/include/ruby/3/arithmetic/intptr_t.h b/include/ruby/3/arithmetic/intptr_t.h
index fd8043a10de..7eabf75a800 100644
--- a/include/ruby/3/arithmetic/intptr_t.h
+++ b/include/ruby/3/arithmetic/intptr_t.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_ARITHMETIC_INTPTR_T_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_ARITHMETIC_INTPTR_T_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Arithmetic conversion between C's `intptr_t` and Ruby's.
*/
-#ifndef RUBY3_ARITHMETIC_INTPTR_T_H
-#define RUBY3_ARITHMETIC_INTPTR_T_H
#include "ruby/3/config.h"
#ifdef HAVE_STDINT_H
diff --git a/include/ruby/3/arithmetic/long.h b/include/ruby/3/arithmetic/long.h
index 7925669baf2..46ff76d63e5 100644
--- a/include/ruby/3/arithmetic/long.h
+++ b/include/ruby/3/arithmetic/long.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_ARITHMETIC_LONG_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_ARITHMETIC_LONG_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -26,8 +28,6 @@
* understand the difference of `int` and `long` when they designed those
* macros.
*/
-#ifndef RUBY3_ARITHMETIC_LONG_H
-#define RUBY3_ARITHMETIC_LONG_H
#include "ruby/3/config.h"
#include "ruby/3/arithmetic/fixnum.h" /* FIXABLE */
#include "ruby/3/arithmetic/intptr_t.h" /* rb_int2big etc.*/
diff --git a/include/ruby/3/arithmetic/long_long.h b/include/ruby/3/arithmetic/long_long.h
index 571edfe8c4b..1dfe0f6f71b 100644
--- a/include/ruby/3/arithmetic/long_long.h
+++ b/include/ruby/3/arithmetic/long_long.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_ARITHMETIC_LONG_LONG_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_ARITHMETIC_LONG_LONG_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Arithmetic conversion between C's `long long` and Ruby's.
*/
-#ifndef RUBY3_ARITHMETIC_LONG_LONG_H
-#define RUBY3_ARITHMETIC_LONG_LONG_H
#include "ruby/3/value.h"
#include "ruby/3/dllexport.h"
#include "ruby/3/special_consts.h"
diff --git a/include/ruby/3/arithmetic/mode_t.h b/include/ruby/3/arithmetic/mode_t.h
index 54ccd376f8a..ea6386305a2 100644
--- a/include/ruby/3/arithmetic/mode_t.h
+++ b/include/ruby/3/arithmetic/mode_t.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_ARITHMETIC_MODE_T_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_ARITHMETIC_MODE_T_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -28,3 +30,5 @@
#ifndef MODET2NUM
# define MODET2NUM RB_INT2NUM
#endif
+
+#endif /* RUBY3_ARITHMETIC_MODE_T_H */
diff --git a/include/ruby/3/arithmetic/off_t.h b/include/ruby/3/arithmetic/off_t.h
index dd964b54469..03d07562576 100644
--- a/include/ruby/3/arithmetic/off_t.h
+++ b/include/ruby/3/arithmetic/off_t.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_ARITHMETIC_OFF_T_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_ARITHMETIC_OFF_T_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -43,3 +45,5 @@
#else
# define NUM2OFFT RB_NUM2INT
#endif
+
+#endif /* RUBY3_ARITHMETIC_OFF_T_H */
diff --git a/include/ruby/3/arithmetic/pid_t.h b/include/ruby/3/arithmetic/pid_t.h
index bca0248d2ad..e63d9e30490 100644
--- a/include/ruby/3/arithmetic/pid_t.h
+++ b/include/ruby/3/arithmetic/pid_t.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_ARITHMETIC_PID_T_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_ARITHMETIC_PID_T_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -28,3 +30,5 @@
#ifndef NUM2PIDT
# define NUM2PIDT RB_NUM2LONG
#endif
+
+#endif /* RUBY3_ARITHMETIC_PID_T_H */
diff --git a/include/ruby/3/arithmetic/short.h b/include/ruby/3/arithmetic/short.h
index fd2106c216d..4fb07a8d036 100644
--- a/include/ruby/3/arithmetic/short.h
+++ b/include/ruby/3/arithmetic/short.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_ARITHMETIC_SHORT_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_ARITHMETIC_SHORT_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -21,8 +23,6 @@
* Shyouhei wonders: why there is no SHORT2NUM, given there are both
* #USHORT2NUM and #CHR2FIX?
*/
-#ifndef RUBY3_ARITHMETIC_SHORT_H
-#define RUBY3_ARITHMETIC_SHORT_H
#include "ruby/3/value.h"
#include "ruby/3/dllexport.h"
#include "ruby/3/special_consts.h"
diff --git a/include/ruby/3/arithmetic/size_t.h b/include/ruby/3/arithmetic/size_t.h
index 70161c3ab03..848a3f1271c 100644
--- a/include/ruby/3/arithmetic/size_t.h
+++ b/include/ruby/3/arithmetic/size_t.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_ARITHMETIC_SIZE_T_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_ARITHMETIC_SIZE_T_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -45,3 +47,5 @@
# define NUM2SIZET RB_NUM2UINT
# define NUM2SSIZET RB_NUM2INT
#endif
+
+#endif /* RUBY3_ARITHMETIC_SIZE_T_H */
diff --git a/include/ruby/3/arithmetic/st_data_t.h b/include/ruby/3/arithmetic/st_data_t.h
index a4917a42f44..f9a28ce1db7 100644
--- a/include/ruby/3/arithmetic/st_data_t.h
+++ b/include/ruby/3/arithmetic/st_data_t.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_ARITHMERIC_ST_DATA_T_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_ARITHMERIC_ST_DATA_T_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Arithmetic conversion between C's `st_data_t` and Ruby's.
*/
-#ifndef RUBY3_ARITHMERIC_ST_DATA_T_H
-#define RUBY3_ARITHMERIC_ST_DATA_T_H
#include "ruby/3/arithmetic/fixnum.h"
#include "ruby/3/arithmetic/long.h"
#include "ruby/3/attr/artificial.h"
diff --git a/include/ruby/3/arithmetic/uid_t.h b/include/ruby/3/arithmetic/uid_t.h
index 45b1f5a9ca6..c49b79e9348 100644
--- a/include/ruby/3/arithmetic/uid_t.h
+++ b/include/ruby/3/arithmetic/uid_t.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_ARITHMETIC_UID_T_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_ARITHMETIC_UID_T_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -28,3 +30,5 @@
#ifndef NUM2UIDT
# define NUM2UIDT RB_NUM2LONG
#endif
+
+#endif /* RUBY3_ARITHMETIC_UID_T_H */
diff --git a/include/ruby/3/assume.h b/include/ruby/3/assume.h
index 3d60aee81a5..13928db9348 100644
--- a/include/ruby/3/assume.h
+++ b/include/ruby/3/assume.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_ASSUME_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_ASSUME_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -23,8 +25,6 @@
* - #RUBY3_ASSUME could fallback to #RUBY3_UNREACHABLE.
* - #RUBY3_UNREACHABLE could fallback to #RUBY3_ASSUME.
*/
-#ifndef RUBY3_ASSUME_H
-#define RUBY3_ASSUME_H
#include "ruby/3/config.h"
#include "ruby/3/cast.h"
#include "ruby/3/has/builtin.h"
diff --git a/include/ruby/3/attr/alloc_size.h b/include/ruby/3/attr/alloc_size.h
index 8296e9dcfd4..251a19f7f35 100644
--- a/include/ruby/3/attr/alloc_size.h
+++ b/include/ruby/3/attr/alloc_size.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_ATTR_ALLOC_SIZE_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_ATTR_ALLOC_SIZE_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -20,12 +22,10 @@
*/
/** Wraps (or simulates) `__attribute__((alloc_size))` */
-#if defined(RUBY3_ATTR_ALLOC_SIZE)
-# /* Take that. */
-
-#elif RUBY3_HAS_ATTRIBUTE(alloc_size)
+#if RUBY3_HAS_ATTRIBUTE(alloc_size)
# define RUBY3_ATTR_ALLOC_SIZE(tuple) __attribute__((__alloc_size__ tuple))
-
#else
# define RUBY3_ATTR_ALLOC_SIZE(tuple) /* void */
#endif
+
+#endif /* RUBY3_ATTR_ALLOC_SIZE_H */
diff --git a/include/ruby/3/attr/artificial.h b/include/ruby/3/attr/artificial.h
index 5e94a048f94..a9f305daabb 100644
--- a/include/ruby/3/attr/artificial.h
+++ b/include/ruby/3/attr/artificial.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_ATTR_ARTIFICIAL_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_ATTR_ARTIFICIAL_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -34,12 +36,10 @@
*/
/** Wraps (or simulates) `__attribute__((artificial))` */
-#if defined(RUBY3_ATTR_ARTIFICIAL)
-# /* Take that. */
-
-#elif RUBY3_HAS_ATTRIBUTE(artificial)
+#if RUBY3_HAS_ATTRIBUTE(artificial)
# define RUBY3_ATTR_ARTIFICIAL() __attribute__((__artificial__))
-
#else
# define RUBY3_ATTR_ARTIFICIAL() /* void */
#endif
+
+#endif /* RUBY3_ATTR_ARTIFICIAL_H */
diff --git a/include/ruby/3/attr/cold.h b/include/ruby/3/attr/cold.h
index 27f92763f18..5b5263feb05 100644
--- a/include/ruby/3/attr/cold.h
+++ b/include/ruby/3/attr/cold.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_ATTR_COLD_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_ATTR_COLD_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -21,17 +23,14 @@
#include "ruby/3/compiler_is.h"
/** Wraps (or simulates) `__attribute__((cold))` */
-#if defined(RUBY3_ATTR_COLD)
-# /* Take that. */
-
-#elif RUBY3_COMPILER_IS(SunPro)
+#if RUBY3_COMPILER_IS(SunPro)
# /* Recent SunPro has __has_attribute, and is borken. */
# /* It reports it has attribute cold, reality isn't (warnings issued). */
# define RUBY3_ATTR_COLD() /* void */
-
#elif RUBY3_HAS_ATTRIBUTE(cold)
# define RUBY3_ATTR_COLD() __attribute__((__cold__))
-
#else
# define RUBY3_ATTR_COLD() /* void */
#endif
+
+#endif /* RUBY3_ATTR_COLD_H */
diff --git a/include/ruby/3/attr/const.h b/include/ruby/3/attr/const.h
index 689889cb656..d97495c647c 100644
--- a/include/ruby/3/attr/const.h
+++ b/include/ruby/3/attr/const.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_ATTR_CONST_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_ATTR_CONST_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -21,30 +23,22 @@
#include "ruby/3/has/declspec_attribute.h"
/** Wraps (or simulates) `__attribute__((const))` */
-#if defined(RUBY3_ATTR_CONST)
-# /* Take that. */
-
-#elif RUBY3_HAS_ATTRIBUTE(const)
+#if RUBY3_HAS_ATTRIBUTE(const)
# define RUBY3_ATTR_CONST() __attribute__((__const__))
-
#elif RUBY3_HAS_DECLSPEC_ATTRIBUTE(noalias)
# /* If a function can be a const, that is also a noalias. */
# define RUBY3_ATTR_CONST() __declspec(noalias)
-
#elif RUBY3_COMPILER_SINCE(SunPro, 5, 10, 0)
# define RUBY3_ATTR_CONST() _Pragma("no_side_effect")
-
#else
# define RUBY3_ATTR_CONST() /* void */
#endif
/** Enables #RUBY3_ATTR_CONST iff. #RUBY_NDEBUG. */
-#if defined(RUBY3_ATTR_CONST_ON_NDEBUG)
-# /* Take that. */
-
-#elif RUBY_NDEBUG
+#if RUBY_NDEBUG
# define RUBY3_ATTR_CONST_ON_NDEBUG() RUBY3_ATTR_CONST()
-
#else
# define RUBY3_ATTR_CONST_ON_NDEBUG() /* void */
#endif
+
+#endif /* RUBY3_ATTR_CONST_H */
diff --git a/include/ruby/3/attr/constexpr.h b/include/ruby/3/attr/constexpr.h
index 11842d87c02..582d9fd0002 100644
--- a/include/ruby/3/attr/constexpr.h
+++ b/include/ruby/3/attr/constexpr.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_ATTR_CONSTEXPR_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_ATTR_CONSTEXPR_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -21,11 +23,8 @@
#include "ruby/3/has/feature.h"
#include "ruby/3/compiler_is.h"
-/** @cond INTERNAL_MACRO*/
-#if defined(RUBY3_ATTR_CONSTEXPR)
-# /* Take that. */
-
-#elif ! defined(__cplusplus)
+/** @cond INTERNAL_MACRO */
+#if ! defined(__cplusplus)
# /* Makes no sense. */
# define RUBY3_HAS_ATTR_CONSTEXPR_CXX11 0
# define RUBY3_HAS_ATTR_CONSTEXPR_CXX14 0
@@ -63,10 +62,7 @@
/** @endcond */
/** Wraps (or simulates) C++11 `constexpr`. */
-#if defined(RUBY3_ATTR_CONSTEXPR)
-# /* Take that. */
-
-#elif RUBY3_HAS_ATTR_CONSTEXPR_CXX14
+#if RUBY3_HAS_ATTR_CONSTEXPR_CXX14
# define RUBY3_ATTR_CONSTEXPR(_) constexpr
#elif RUBY3_HAS_ATTR_CONSTEXPR_CXX11
@@ -79,12 +75,10 @@
#endif
/** Enables #RUBY3_ATTR_CONSTEXPR iff. #RUBY_NDEBUG. */
-#if defined(RUBY3_ATTR_CONSTEXPR_ON_NDEBUG)
-# /* Take that. */
-
-#elif RUBY_NDEBUG
+#if RUBY_NDEBUG
# define RUBY3_ATTR_CONSTEXPR_ON_NDEBUG(_) RUBY3_ATTR_CONSTEXPR(_)
-
#else
# define RUBY3_ATTR_CONSTEXPR_ON_NDEBUG(_) /* void */
#endif
+
+#endif /* RUBY3_ATTR_CONSTEXPR_H */
diff --git a/include/ruby/3/attr/deprecated.h b/include/ruby/3/attr/deprecated.h
index 629f7c9fc51..9f939a5e8c6 100644
--- a/include/ruby/3/attr/deprecated.h
+++ b/include/ruby/3/attr/deprecated.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_ATTR_DEPRECATED_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_ATTR_DEPRECATED_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -24,10 +26,7 @@
#include "ruby/3/has/extension.h"
/** Wraps (or simulates) `[[deprecated]]` */
-#if defined(RUBY3_ATTR_DEPRECATED)
-# /* Take that. */
-
-#elif RUBY3_HAS_EXTENSION(attribute_deprecated_with_message)
+#if RUBY3_HAS_EXTENSION(attribute_deprecated_with_message)
# define RUBY3_ATTR_DEPRECATED(msg) __attribute__((__deprecated__ msg))
#elif RUBY3_COMPILER_SINCE(GCC, 4, 5, 0)
@@ -54,3 +53,5 @@
#else
# define RUBY3_ATTR_DEPRECATED(msg) /* void */
#endif
+
+#endif /* RUBY3_ATTR_DEPRECATED_H */
diff --git a/include/ruby/3/attr/diagnose_if.h b/include/ruby/3/attr/diagnose_if.h
index a363c4cdb3e..488c3ec7ad3 100644
--- a/include/ruby/3/attr/diagnose_if.h
+++ b/include/ruby/3/attr/diagnose_if.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_ATTR_DIAGNOSE_IF_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_ATTR_DIAGNOSE_IF_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -20,10 +22,7 @@
*/
/** Wraps (or simulates) `__attribute__((diagnose_if))` */
-#if defined(RUBY3_ATTR_DIAGNOSE_IF)
-# /* Take that. */
-
-#elif RUBY3_COMPILER_BEFORE(Clang, 5, 0, 0)
+#if RUBY3_COMPILER_BEFORE(Clang, 5, 0, 0)
# /* https://bugs.llvm.org/show_bug.cgi?id=34319 */
# define RUBY3_ATTR_DIAGNOSE_IF(_, __, ___) /* void */
@@ -37,3 +36,5 @@
#else
# define RUBY3_ATTR_DIAGNOSE_IF(_, __, ___) /* void */
#endif
+
+#endif /* RUBY3_ATTR_DIAGNOSE_IF_H */
diff --git a/include/ruby/3/attr/enum_extensibility.h b/include/ruby/3/attr/enum_extensibility.h
index 0631057383f..a56d1a54b81 100644
--- a/include/ruby/3/attr/enum_extensibility.h
+++ b/include/ruby/3/attr/enum_extensibility.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_ATTR_ENUM_EXTENSIBILITY_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_ATTR_ENUM_EXTENSIBILITY_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -20,12 +22,10 @@
*/
/** Wraps (or simulates) `__attribute__((enum_extensibility))` */
-#if defined(RUBY3_ATTR_ENUM_EXTENSIBILITY)
-# /* Take that. */
-
-#elif RUBY3_HAS_ATTRIBUTE(enum_extensibility)
+#if RUBY3_HAS_ATTRIBUTE(enum_extensibility)
# define RUBY3_ATTR_ENUM_EXTENSIBILITY(_) __attribute__((__enum_extensibility__(_)))
-
#else
# define RUBY3_ATTR_ENUM_EXTENSIBILITY(_) /* void */
#endif
+
+#endif /* RUBY3_ATTR_ENUM_EXTENSIBILITY_H */
diff --git a/include/ruby/3/attr/error.h b/include/ruby/3/attr/error.h
index ec9383aace7..ee5e3290aea 100644
--- a/include/ruby/3/attr/error.h
+++ b/include/ruby/3/attr/error.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_ATTR_ERROR_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_ATTR_ERROR_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -20,12 +22,10 @@
*/
/** Wraps (or simulates) `__attribute__((error))` */
-#if defined(RUBY3_ATTR_ERROR)
-# /* Take that. */
-
-#elif RUBY3_HAS_ATTRIBUTE(error)
+#if RUBY3_HAS_ATTRIBUTE(error)
# define RUBY3_ATTR_ERROR(msg) __attribute__((__error__ msg))
-
#else
# define RUBY3_ATTR_ERROR(msg) /* void */
#endif
+
+#endif /* RUBY3_ATTR_ERROR_H */
diff --git a/include/ruby/3/attr/flag_enum.h b/include/ruby/3/attr/flag_enum.h
index 5e7e9982f97..7165347bd7d 100644
--- a/include/ruby/3/attr/flag_enum.h
+++ b/include/ruby/3/attr/flag_enum.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_ATTR_FLAG_ENUM_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_ATTR_FLAG_ENUM_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -21,12 +23,10 @@
*/
/** Wraps (or simulates) `__attribute__((flag_enum)` */
-#if defined(RUBY3_ATTR_FLAG_ENUM)
-# /* Take that. */
-
-#elif RUBY3_HAS_ATTRIBUTE(flag_enum)
+#if RUBY3_HAS_ATTRIBUTE(flag_enum)
# define RUBY3_ATTR_FLAG_ENUM() __attribute__((__flag_enum__))
-
#else
# define RUBY3_ATTR_FLAG_ENUM() /* void */
#endif
+
+#endif /* RUBY3ATTR_FLAG_ENUM_H */
diff --git a/include/ruby/3/attr/forceinline.h b/include/ruby/3/attr/forceinline.h
index 6d279235b8e..3c865e9c4b8 100644
--- a/include/ruby/3/attr/forceinline.h
+++ b/include/ruby/3/attr/forceinline.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_ATTR_FORCEINLINE_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_ATTR_FORCEINLINE_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -25,15 +27,12 @@
* `__forceinline` are mutually exclusive. We have to mimic that behaviour for
* non-MSVC compilers.
*/
-#if defined(RUBY3_ATTR_FORCEINLINE)
-# /* Take that. */
-
-#elif RUBY3_COMPILER_SINCE(MSVC, 12, 0, 0)
+#if RUBY3_COMPILER_SINCE(MSVC, 12, 0, 0)
# define RUBY3_ATTR_FORCEINLINE() __forceinline
-
#elif RUBY3_HAS_ATTRIBUTE(always_inline)
# define RUBY3_ATTR_FORCEINLINE() __attribute__((__always_inline__)) inline
-
#else
# define RUBY3_ATTR_FORCEINLINE() inline
#endif
+
+#endif /* RUBY3_ATTR_FORCEINLINE_H */
diff --git a/include/ruby/3/attr/format.h b/include/ruby/3/attr/format.h
index de8e2f53c42..c234034afef 100644
--- a/include/ruby/3/attr/format.h
+++ b/include/ruby/3/attr/format.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_ATTR_FORMAT_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_ATTR_FORMAT_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -20,22 +22,16 @@
*/
/** Wraps (or simulates) `__attribute__((format))` */
-#if defined(RUBY3_ATTR_FORMAT)
-# /* Take that. */
-
-#elif RUBY3_HAS_ATTRIBUTE(format)
+#if RUBY3_HAS_ATTRIBUTE(format)
# define RUBY3_ATTR_FORMAT(x, y, z) __attribute__((__format__(x, y, z)))
-
#else
# define RUBY3_ATTR_FORMAT(x, y, z) /* void */
#endif
-#if defined(RUBY3_PRINTF_FORMAT)
-# /* Take that. */
-
-#elif defined(__MINGW_PRINTF_FORMAT)
+#if defined(__MINGW_PRINTF_FORMAT)
# define RUBY3_PRINTF_FORMAT __MINGW_PRINTF_FORMAT
-
#else
# define RUBY3_PRINTF_FORMAT __printf__
#endif
+
+#endif /* RUBY3_ATTR_FORMAT_H */
diff --git a/include/ruby/3/attr/maybe_unused.h b/include/ruby/3/attr/maybe_unused.h
index 29a8c35bfcb..f814804e9f2 100644
--- a/include/ruby/3/attr/maybe_unused.h
+++ b/include/ruby/3/attr/maybe_unused.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_ATTR_MAYBE_UNUSED_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_ATTR_MAYBE_UNUSED_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -22,18 +24,14 @@
#include "ruby/3/has/cpp_attribute.h"
/** Wraps (or simulates) `[[maybe_unused]]` */
-#if defined(RUBY3_ATTR_MAYBE_UNUSED)
-# /* Take that. */
-
-#elif RUBY3_HAS_CPP_ATTRIBUTE(maybe_unused)
+#if RUBY3_HAS_CPP_ATTRIBUTE(maybe_unused)
# define RUBY3_ATTR_MAYBE_UNUSED() [[maybe_unused]]
-
#elif RUBY3_HAS_C_ATTRIBUTE(maybe_unused)
# define RUBY3_ATTR_MAYBE_UNUSED() [[maybe_unused]]
-
#elif RUBY3_HAS_ATTRIBUTE(unused)
# define RUBY3_ATTR_MAYBE_UNUSED() __attribute__((__unused__))
-
#else
# define RUBY3_ATTR_MAYBE_UNUSED() /* void */
#endif
+
+#endif /* RUBY3_ATTR_MAYBE_UNUSED */
diff --git a/include/ruby/3/attr/noalias.h b/include/ruby/3/attr/noalias.h
index c15f1480cb4..49ad11999d7 100644
--- a/include/ruby/3/attr/noalias.h
+++ b/include/ruby/3/attr/noalias.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_ATTR_NOALIAS_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_ATTR_NOALIAS_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -47,12 +49,10 @@
#include "ruby/3/has/declspec_attribute.h"
/** Wraps (or simulates) `__declspec((noalias))` */
-#if defined(RUBY3_ATTR_NOALIAS)
-# /* Take that. */
-
-#elif RUBY3_HAS_DECLSPEC_ATTRIBUTE(noalias)
+#if RUBY3_HAS_DECLSPEC_ATTRIBUTE(noalias)
# define RUBY3_ATTR_NOALIAS() __declspec(noalias)
-
#else
# define RUBY3_ATTR_NOALIAS() /* void */
#endif
+
+#endif /* RUBY3_ATTR_NOALIAS_H */
diff --git a/include/ruby/3/attr/nodiscard.h b/include/ruby/3/attr/nodiscard.h
index 342a1da7ad4..0142d22bd4e 100644
--- a/include/ruby/3/attr/nodiscard.h
+++ b/include/ruby/3/attr/nodiscard.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_ATTR_NODISCARD_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_ATTR_NODISCARD_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -26,22 +28,17 @@
* nodiscard attribute can have a message why the result shall not be ignoed.
* However GCC attribute and SAL annotation cannot take them.
*/
-#if defined(RUBY3_ATTR_NODISCARD)
-# /* Take that. */
-
-#elif RUBY3_HAS_CPP_ATTRIBUTE(nodiscard)
+#if RUBY3_HAS_CPP_ATTRIBUTE(nodiscard)
# define RUBY3_ATTR_NODISCARD() [[nodiscard]]
-
#elif RUBY3_HAS_C_ATTRIBUTE(nodiscard)
# define RUBY3_ATTR_NODISCARD() [[nodiscard]]
-
#elif RUBY3_HAS_ATTRIBUTE(warn_unused_result)
# define RUBY3_ATTR_NODISCARD() __attribute__((__warn_unused_result__))
-
#elif defined(_Check_return_)
# /* Take SAL definition. */
# define RUBY3_ATTR_NODISCARD() _Check_return_
-
#else
# define RUBY3_ATTR_NODISCARD() /* void */
#endif
+
+#endif /* RUBY3_ATTR_NODISCARD_H */
diff --git a/include/ruby/3/attr/noexcept.h b/include/ruby/3/attr/noexcept.h
index 1bc90de88c5..a99ca0b35c0 100644
--- a/include/ruby/3/attr/noexcept.h
+++ b/include/ruby/3/attr/noexcept.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_ATTR_NOEXCEPT_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_ATTR_NOEXCEPT_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -62,10 +64,7 @@
#include "ruby/3/has/feature.h"
/** Wraps (or simulates) C++11 `noexcept` */
-#if defined(RUBY3_ATTR_NOEXCEPT)
-# /* Take that. */
-
-#elif ! defined(__cplusplus)
+#if ! defined(__cplusplus)
# /* Doesn't make sense. */
# define RUBY3_ATTR_NOEXCEPT(_) /* void */
@@ -87,3 +86,5 @@
#else
# define RUBY3_ATTR_NOEXCEPT(_) /* void */
#endif
+
+#endif /* RUBY3_ATTR_NOEXCEPT_H */
diff --git a/include/ruby/3/attr/noinline.h b/include/ruby/3/attr/noinline.h
index 4483c4c8d69..e5eca8eaef2 100644
--- a/include/ruby/3/attr/noinline.h
+++ b/include/ruby/3/attr/noinline.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_ATTR_NOINLINE_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_ATTR_NOINLINE_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -21,15 +23,12 @@
#include "ruby/3/has/declspec_attribute.h"
/** Wraps (or simulates) `__declspec(noinline)` */
-#if defined(RUBY3_ATTR_NOINLINE)
-# /* Take that. */
-
-#elif RUBY3_HAS_DECLSPEC_ATTRIBUTE(noinline)
+#if RUBY3_HAS_DECLSPEC_ATTRIBUTE(noinline)
# define RUBY3_ATTR_NOINLINE() __declspec(noinline)
-
#elif RUBY3_HAS_ATTRIBUTE(noinline)
# define RUBY3_ATTR_NOINLINE() __attribute__((__noinline__))
-
#else
# define RUBY3_ATTR_NOINLINE() /* void */
#endif
+
+#endif /* RUBY3_ATTR_NOINLINE_H */
diff --git a/include/ruby/3/attr/nonnull.h b/include/ruby/3/attr/nonnull.h
index 0431c5a363b..4c2f3f1ca06 100644
--- a/include/ruby/3/attr/nonnull.h
+++ b/include/ruby/3/attr/nonnull.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_ATTR_NONNULL_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_ATTR_NONNULL_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -20,12 +22,10 @@
*/
/** Wraps (or simulates) `__attribute__((nonnull))` */
-#if defined(RUBY3_ATTR_NONNULL)
-# /* Take that. */
-
-#elif RUBY3_HAS_ATTRIBUTE(nonnull)
+#if RUBY3_HAS_ATTRIBUTE(nonnull)
# define RUBY3_ATTR_NONNULL(list) __attribute__((__nonnull__ list))
-
#else
# define RUBY3_ATTR_NONNULL(list) /* void */
#endif
+
+#endif /* RUBY3_ATTR_NONNULL_H */
diff --git a/include/ruby/3/attr/noreturn.h b/include/ruby/3/attr/noreturn.h
index 2dc940116a1..2b7051428d7 100644
--- a/include/ruby/3/attr/noreturn.h
+++ b/include/ruby/3/attr/noreturn.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_ATTR_NORETURN_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_ATTR_NORETURN_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -22,10 +24,7 @@
#include "ruby/3/has/declspec_attribute.h"
/** Wraps (or simulates) `[[noreturn]]` */
-#if defined(RUBY3_ATTR_NORETURN)
-# /* Take that. */
-
-#elif RUBY3_COMPILER_SINCE(SunPro, 5, 10, 0)
+#if RUBY3_COMPILER_SINCE(SunPro, 5, 10, 0)
# define RUBY3_ATTR_NORETURN() _Pragma("does_not_return")
#elif RUBY3_HAS_DECLSPEC_ATTRIBUTE(noreturn)
@@ -47,3 +46,5 @@
#else
# define RUBY3_ATTR_NORETURN() /* void */
#endif
+
+#endif /* RUBY3_ATTR_NORETURN_H */
diff --git a/include/ruby/3/attr/pure.h b/include/ruby/3/attr/pure.h
index 530b0cf3b44..038fd2abdbb 100644
--- a/include/ruby/3/attr/pure.h
+++ b/include/ruby/3/attr/pure.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_ATTR_PURE_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_ATTR_PURE_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -21,26 +23,19 @@
#include "ruby/assert.h"
/** Wraps (or simulates) `__attribute__((pure))` */
-#if defined(RUBY3_ATTR_PURE)
-# /* Take that. */
-
-#elif RUBY3_HAS_ATTRIBUTE(pure)
+#if RUBY3_HAS_ATTRIBUTE(pure)
# define RUBY3_ATTR_PURE() __attribute__((__pure__))
-
#elif RUBY3_COMPILER_SINCE(SunPro, 5, 10, 0)
# define RUBY3_ATTR_PURE() _Pragma("does_not_write_global_data")
-
#else
# define RUBY3_ATTR_PURE() /* void */
#endif
/** Enables #RUBY3_ATTR_PURE iff. #RUBY_NDEBUG. */
-#if defined(RUBY3_ATTR_PURE_ON_NDEBUG)
-# /* Take that. */
-
-#elif RUBY_NDEBUG
+#if RUBY_NDEBUG
# define RUBY3_ATTR_PURE_ON_NDEBUG() RUBY3_ATTR_PURE()
-
#else
# define RUBY3_ATTR_PURE_ON_NDEBUG() /* void */
#endif
+
+#endif /* RUBY3_ATTR_PURE_H */
diff --git a/include/ruby/3/attr/restrict.h b/include/ruby/3/attr/restrict.h
index c42ad99a01f..f6d7936b3a8 100644
--- a/include/ruby/3/attr/restrict.h
+++ b/include/ruby/3/attr/restrict.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_ATTR_RESTRICT_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_ATTR_RESTRICT_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -24,10 +26,7 @@
* `__has_declspec_attribute()` which involves macro substitution. */
/** Wraps (or simulates) `__declspec(restrict)` */
-#if defined(RUBY3_ATTR_RESTRICT)
-# /* Take that. */
-
-#elif RUBY3_COMPILER_SINCE(MSVC, 14, 0, 0)
+#if RUBY3_COMPILER_SINCE(MSVC, 14, 0, 0)
# define RUBY3_ATTR_RESTRICT() __declspec(RUBY3_TOKEN_PASTE(re, strict))
#elif RUBY3_HAS_ATTRIBUTE(malloc)
@@ -39,3 +38,5 @@
#else
# define RUBY3_ATTR_RESTRICT() /* void */
#endif
+
+#endif /* RUBY3_ATTR_RESTRICT_H */
diff --git a/include/ruby/3/attr/returns_nonnull.h b/include/ruby/3/attr/returns_nonnull.h
index aefee7ef30b..eb8db1d045d 100644
--- a/include/ruby/3/attr/returns_nonnull.h
+++ b/include/ruby/3/attr/returns_nonnull.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_ATTR_RETURNS_NONNULL_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_ATTR_RETURNS_NONNULL_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -20,10 +22,7 @@
*/
/** Wraps (or simulates) `__attribute__((returns_nonnull))` */
-#if defined(RUBY3_ATTR_RETURNS_NONNULL)
-# /* Take that. */
-
-#elif defined(_Ret_nonnull_)
+#if defined(_Ret_nonnull_)
# /* Take SAL definition. */
# define RUBY3_ATTR_RETURNS_NONNULL() _Ret_nonnull_
@@ -33,3 +32,5 @@
#else
# define RUBY3_ATTR_RETURNS_NONNULL() /* void */
#endif
+
+#endif /* RUBY3_ATTR_RETURNS_NONNULL_H */
diff --git a/include/ruby/3/attr/warning.h b/include/ruby/3/attr/warning.h
index 6323b6e2feb..0c64e6a8344 100644
--- a/include/ruby/3/attr/warning.h
+++ b/include/ruby/3/attr/warning.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_ATTR_WARNING_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_ATTR_WARNING_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -20,12 +22,10 @@
*/
/** Wraps (or simulates) `__attribute__((warning))` */
-#if defined(RUBY3_ATTR_WARNING)
-# /* Take that. */
-
-#elif RUBY3_HAS_ATTRIBUTE(warning)
+#if RUBY3_HAS_ATTRIBUTE(warning)
# define RUBY3_ATTR_WARNING(msg) __attribute__((__warning__ msg))
-
#else
# define RUBY3_ATTR_WARNING(msg) /* void */
#endif
+
+#endif /* RUBY3_ATTR_WARNING_H */
diff --git a/include/ruby/3/attr/weakref.h b/include/ruby/3/attr/weakref.h
index 28b901d44f0..a5402662197 100644
--- a/include/ruby/3/attr/weakref.h
+++ b/include/ruby/3/attr/weakref.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_ATTR_WEAKREF_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_ATTR_WEAKREF_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -20,12 +22,10 @@
*/
/** Wraps (or simulates) `__attribute__((weakref))` */
-#if defined(RUBY3_ATTR_WEAKREF)
-# /* Take that. */
-
-#elif RUBY3_HAS_ATTRIBUTE(weakref)
+#if RUBY3_HAS_ATTRIBUTE(weakref)
# define RUBY3_ATTR_WEAKREF(sym) __attribute__((__weakref__(# sym)))
-
#else
# define RUBY3_ATTR_WEAKREF(sym) /* void */
#endif
+
+#endif /* RUBY3_ATTR_WEAKREF_H */
diff --git a/include/ruby/3/cast.h b/include/ruby/3/cast.h
index 10caa809e5e..7f0dce90101 100644
--- a/include/ruby/3/cast.h
+++ b/include/ruby/3/cast.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_CAST_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_CAST_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -24,10 +26,7 @@
* warnings. Ruby internals are pure C so they should not bother.
*/
-#if defined(RUBY3_CAST)
-# /* Take that. */
-
-#elif ! defined(__cplusplus)
+#if ! defined(__cplusplus)
# define RUBY3_CAST(expr) (expr)
#elif RUBY3_COMPILER_SINCE(GCC, 4, 6, 0)
@@ -47,3 +46,5 @@
# define RUBY3_CAST(expr) (expr)
#endif
/** @endcond */
+
+#endif /* RUBY3_CAST_H */
diff --git a/include/ruby/3/compiler_is.h b/include/ruby/3/compiler_is.h
index 9f8b81315d1..3da099a9c19 100644
--- a/include/ruby/3/compiler_is.h
+++ b/include/ruby/3/compiler_is.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_COMPILER_IS_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_COMPILER_IS_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -25,12 +27,7 @@
* @retval true It is.
* @retval false It isn't.
*/
-#ifndef RUBY3_COMPILER_IS_INCLUDED
-#define RUBY3_COMPILER_IS_INCLUDED
-
-#ifndef RUBY3_COMPILER_IS
-# define RUBY3_COMPILER_IS(cc) RUBY3_COMPILER_IS_ ## cc
-#endif
+#define RUBY3_COMPILER_IS(cc) RUBY3_COMPILER_IS_ ## cc
#include "ruby/3/compiler_is/apple.h"
#include "ruby/3/compiler_is/clang.h"
@@ -45,4 +42,4 @@
*
* - ARM's armclang: ditto, it can be clang-backended. */
-#endif // RUBY3_COMPILER_IS_INCLUDED
+#endif /* RUBY3_COMPILER_IS_H */
diff --git a/include/ruby/3/compiler_is/apple.h b/include/ruby/3/compiler_is/apple.h
index bd08b7dd633..b4ff8fd211d 100644
--- a/include/ruby/3/compiler_is/apple.h
+++ b/include/ruby/3/compiler_is/apple.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_COMPILER_IS_APPLE_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_COMPILER_IS_APPLE_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -23,10 +25,7 @@
* from LLVM's, when it comes to compiler detection business in this header
* file.
*/
-#if defined(RUBY3_COMPILER_IS_Apple)
-# /* Take that. */
-
-#elif ! defined(__clang__)
+#if ! defined(__clang__)
# define RUBY3_COMPILER_IS_Apple 0
#elif ! defined(__apple_build_version__)
@@ -38,3 +37,5 @@
# define RUBY3_COMPILER_VERSION_MINOR __clang_minor__
# define RUBY3_COMPILER_VERSION_PATCH __clang_patchlevel__
#endif
+
+#endif /* RUBY3_COMPILER_IS_APPLE_H */
diff --git a/include/ruby/3/compiler_is/clang.h b/include/ruby/3/compiler_is/clang.h
index a5be006022a..5f07b3b5ed5 100644
--- a/include/ruby/3/compiler_is/clang.h
+++ b/include/ruby/3/compiler_is/clang.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_COMPILER_IS_CLANG_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_COMPILER_IS_CLANG_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -20,10 +22,7 @@
*/
#include "ruby/3/compiler_is/apple.h"
-#if defined(RUBY3_COMPILER_IS_Clang)
-# /* Take that. */
-
-#elif ! defined(__clang__)
+#if ! defined(__clang__)
# define RUBY3_COMPILER_IS_Clang 0
#elif RUBY3_COMPILER_IS(Apple)
@@ -35,3 +34,5 @@
# define RUBY3_COMPILER_VERSION_MINOR __clang_minor__
# define RUBY3_COMPILER_VERSION_PATCH __clang_patchlevel__
#endif
+
+#endif /* RUBY3_COMPILER_IS_CLANG_H */
diff --git a/include/ruby/3/compiler_is/gcc.h b/include/ruby/3/compiler_is/gcc.h
index 6b0a5f62cff..2fc030c010e 100644
--- a/include/ruby/3/compiler_is/gcc.h
+++ b/include/ruby/3/compiler_is/gcc.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_COMPILER_IS_GCC_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_COMPILER_IS_GCC_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -22,10 +24,7 @@
#include "ruby/3/compiler_is/clang.h"
#include "ruby/3/compiler_is/intel.h"
-#if defined(RUBY3_COMPILER_IS_GCC)
-# /* Take that. */
-
-#elif ! defined(__GNUC__)
+#if ! defined(__GNUC__)
# define RUBY3_COMPILER_IS_GCC 0
#elif RUBY3_COMPILER_IS(Apple)
@@ -43,3 +42,5 @@
# define RUBY3_COMPILER_VERSION_MINOR __GNUC_MINOR__
# define RUBY3_COMPILER_VERSION_PATCH __GNUC_PATCHLEVEL__
#endif
+
+#endif /* RUBY3_COMPILER_IS_GCC_H */
diff --git a/include/ruby/3/compiler_is/intel.h b/include/ruby/3/compiler_is/intel.h
index 7a1fa0fc9a9..605d2d3bdb4 100644
--- a/include/ruby/3/compiler_is/intel.h
+++ b/include/ruby/3/compiler_is/intel.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_COMPILER_IS_INTEL_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_COMPILER_IS_INTEL_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,10 +20,7 @@
* extension libraries. They could be written in C++98.
* @brief Defines #RUBY3_COMPILER_IS_Intel.
*/
-#if defined(RUBY3_COMPILER_IS_Intel)
-# /* Take that. */
-
-#elif ! defined(__INTEL_COMPILER)
+#if ! defined(__INTEL_COMPILER)
# define RUBY3_COMPILER_IS_Intel 0
#elif ! defined(__INTEL_COMPILER_UPDATE)
@@ -38,3 +37,5 @@
# define RUBY3_COMPILER_VERSION_MINOR (__INTEL_COMPILER % 100 / 10)
# define RUBY3_COMPILER_VERSION_PATCH __INTEL_COMPILER_UPDATE
#endif
+
+#endif /* RUBY3_COMPILER_IS_INTEL_H */
diff --git a/include/ruby/3/compiler_is/msvc.h b/include/ruby/3/compiler_is/msvc.h
index beb8076046b..e2c72a1175a 100644
--- a/include/ruby/3/compiler_is/msvc.h
+++ b/include/ruby/3/compiler_is/msvc.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_COMPILER_IS_MSVC_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_COMPILER_IS_MSVC_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -21,10 +23,7 @@
#include "ruby/3/compiler_is/clang.h"
#include "ruby/3/compiler_is/intel.h"
-#if defined(RUBY3_COMPILER_IS_MSVC)
-# /* Take that. */
-
-#elif ! defined(_MSC_VER)
+#if ! defined(_MSC_VER)
# define RUBY3_COMPILER_IS_MSVC 0
#elif RUBY3_COMPILER_IS(Clang)
@@ -54,3 +53,5 @@
# define RUBY3_COMPILER_VERSION_MINOR (_MSC_VER % 100)
# define RUBY3_COMPILER_VERSION_PATCH 0
#endif
+
+#endif /* RUBY3_COMPILER_IS_MSVC_H */
diff --git a/include/ruby/3/compiler_is/sunpro.h b/include/ruby/3/compiler_is/sunpro.h
index b71997658be..4c90e09dffb 100644
--- a/include/ruby/3/compiler_is/sunpro.h
+++ b/include/ruby/3/compiler_is/sunpro.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_COMPILER_IS_SUNPRO_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_COMPILER_IS_SUNPRO_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,10 +20,7 @@
* extension libraries. They could be written in C++98.
* @brief Defines #RUBY3_COMPILER_IS_SunPro.
*/
-#if defined(RUBY3_COMPILER_IS_SunPro)
-# /* Take that. */
-
-#elif ! (defined(__SUNPRO_C) || defined(__SUNPRO_CC))
+#if ! (defined(__SUNPRO_C) || defined(__SUNPRO_CC))
# define RUBY3_COMPILER_IS_SunPro 0
#elif defined(__SUNPRO_C) && __SUNPRO_C >= 0x5100
@@ -52,3 +51,5 @@
# define TERSE_COMPILER_VERSION_MINOR (__SUNPRO_CC >> 4 & 0xF)
# define TERSE_COMPILER_VERSION_PATCH (__SUNPRO_CC & 0xF)
#endif
+
+#endif /* RUBY3_COMPILER_IS_SUNPRO_H */
diff --git a/include/ruby/3/compiler_since.h b/include/ruby/3/compiler_since.h
index f5d8bdd2f8e..365f39ffb0f 100644
--- a/include/ruby/3/compiler_since.h
+++ b/include/ruby/3/compiler_since.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_COMPILER_SINCE_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_COMPILER_SINCE_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -19,7 +21,6 @@
* @brief Defines #RUBY3_COMPILER_SINCE.
*/
#include "ruby/3/compiler_is.h"
-#ifndef RUBY3_COMPILER_SINCE
/**
* @brief Checks if the compiler is of given brand and is newer than or equal
@@ -57,4 +58,4 @@
((RUBY3_COMPILER_VERSION_MINOR == (y)) && \
(RUBY3_COMPILER_VERSION_PATCH < (z)))))))
-#endif /* RUBY3_COMPILER_SINCE */
+#endif /* RUBY3_COMPILER_SINCE_H */
diff --git a/include/ruby/3/config.h b/include/ruby/3/config.h
index 12489c7c161..158e8635cb3 100644
--- a/include/ruby/3/config.h
+++ b/include/ruby/3/config.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_CONFIG_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_CONFIG_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Thin wrapper to ruby/config.h
*/
-#ifndef RUBY3_CONFIG_H
-#define RUBY3_CONFIG_H
#include "ruby/config.h"
#ifdef RUBY_EXTCONF_H
diff --git a/include/ruby/3/constant_p.h b/include/ruby/3/constant_p.h
index e1b45c08b50..13781f80198 100644
--- a/include/ruby/3/constant_p.h
+++ b/include/ruby/3/constant_p.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_CONSTANT_P_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_CONSTANT_P_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -26,12 +28,10 @@
*/
#include "ruby/3/has/builtin.h"
-#if defined(RUBY3_CONSTANT_P)
-# /* Take that. */
-
-#elif RUBY3_HAS_BUILTIN(__builtin_constant_p)
+#if RUBY3_HAS_BUILTIN(__builtin_constant_p)
# define RUBY3_CONSTANT_P(expr) __builtin_constant_p(expr)
-
#else
# define RUBY3_CONSTANT_P(expr) 0
#endif
+
+#endif /* RUBY3_CONSTANT_P_H */
diff --git a/include/ruby/3/core.h b/include/ruby/3/core.h
index be8a50a5fbf..00b3a6104fe 100644
--- a/include/ruby/3/core.h
+++ b/include/ruby/3/core.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_CORE_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_CORE_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -30,3 +32,4 @@
#include "ruby/3/core/rstring.h"
#include "ruby/3/core/rstruct.h"
#include "ruby/3/core/rtypeddata.h"
+#endif /* RUBY3_CORE_H */
diff --git a/include/ruby/3/core/rarray.h b/include/ruby/3/core/rarray.h
index cd8767a8a8c..3234daae90d 100644
--- a/include/ruby/3/core/rarray.h
+++ b/include/ruby/3/core/rarray.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_RARRAY_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_RARRAY_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Defines struct ::RArray.
*/
-#ifndef RUBY3_RARRAY_H
-#define RUBY3_RARRAY_H
#include "ruby/3/arithmetic/long.h"
#include "ruby/3/attr/artificial.h"
#include "ruby/3/attr/constexpr.h"
diff --git a/include/ruby/3/core/rbasic.h b/include/ruby/3/core/rbasic.h
index 510dd38da6e..4f6fa576aaa 100644
--- a/include/ruby/3/core/rbasic.h
+++ b/include/ruby/3/core/rbasic.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_RBASIC_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_RBASIC_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Defines struct ::RBasic.
*/
-#ifndef RUBY3_RBASIC_H
-#define RUBY3_RBASIC_H
#include "ruby/3/attr/artificial.h"
#include "ruby/3/attr/constexpr.h"
#include "ruby/3/attr/forceinline.h"
diff --git a/include/ruby/3/core/rbignum.h b/include/ruby/3/core/rbignum.h
index c1183e3ea61..09a478c2f89 100644
--- a/include/ruby/3/core/rbignum.h
+++ b/include/ruby/3/core/rbignum.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_RBIGNUM_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_RBIGNUM_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Routines to manipulate struct ::RBignum.
*/
-#ifndef RUBY3_RBIGNUM_H
-#define RUBY3_RBIGNUM_H
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
#include "ruby/3/value_type.h"
diff --git a/include/ruby/3/core/rclass.h b/include/ruby/3/core/rclass.h
index a54b34f5ba8..e492da5ae50 100644
--- a/include/ruby/3/core/rclass.h
+++ b/include/ruby/3/core/rclass.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_RCLASS_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_RCLASS_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Routines to manipulate struct ::RClass.
*/
-#ifndef RUBY3_RCLASS_H
-#define RUBY3_RCLASS_H
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
#include "ruby/3/cast.h"
diff --git a/include/ruby/3/core/rdata.h b/include/ruby/3/core/rdata.h
index 651ceed0d72..6df6ea9e6d0 100644
--- a/include/ruby/3/core/rdata.h
+++ b/include/ruby/3/core/rdata.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_RDATA_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_RDATA_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Defines struct ::RData.
*/
-#ifndef RUBY3_RDATA_H
-#define RUBY3_RDATA_H
#include "ruby/3/config.h"
#ifdef STDC_HEADERS
diff --git a/include/ruby/3/core/rfile.h b/include/ruby/3/core/rfile.h
index 2b80a96e40c..0b12d7bba43 100644
--- a/include/ruby/3/core/rfile.h
+++ b/include/ruby/3/core/rfile.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_RFILE_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_RFILE_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Defines struct ::RFile.
*/
-#ifndef RUBY3_RFILE_H
-#define RUBY3_RFILE_H
#include "ruby/3/core/rbasic.h"
#include "ruby/3/cast.h"
diff --git a/include/ruby/3/core/rhash.h b/include/ruby/3/core/rhash.h
index 37781301414..e8f9901aa59 100644
--- a/include/ruby/3/core/rhash.h
+++ b/include/ruby/3/core/rhash.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_RHASH_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_RHASH_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -30,8 +32,6 @@
*
* Shyouhei stopped thinking. Let them be as is.
*/
-#ifndef RUBY3_RHASH_H
-#define RUBY3_RHASH_H
#include "ruby/3/config.h"
#ifdef STDC_HEADERS
diff --git a/include/ruby/3/core/rmatch.h b/include/ruby/3/core/rmatch.h
index fff62f14736..f89cea849c1 100644
--- a/include/ruby/3/core/rmatch.h
+++ b/include/ruby/3/core/rmatch.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_RMATCH_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_RMATCH_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Defines struct ::RMatch.
*/
-#ifndef RUBY3_RMATCH_H
-#define RUBY3_RMATCH_H
#include "ruby/3/attr/artificial.h"
#include "ruby/3/attr/pure.h"
#include "ruby/3/attr/returns_nonnull.h"
diff --git a/include/ruby/3/core/robject.h b/include/ruby/3/core/robject.h
index 82887a8c51b..3f298214a92 100644
--- a/include/ruby/3/core/robject.h
+++ b/include/ruby/3/core/robject.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_ROBJECT_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_ROBJECT_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Defines struct ::RObject.
*/
-#ifndef RUBY3_ROBJECT_H
-#define RUBY3_ROBJECT_H
#include "ruby/3/config.h"
#ifdef HAVE_STDINT_H
diff --git a/include/ruby/3/core/rregexp.h b/include/ruby/3/core/rregexp.h
index 1f30808e8a0..0978c00c744 100644
--- a/include/ruby/3/core/rregexp.h
+++ b/include/ruby/3/core/rregexp.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_RREGEXP_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_RREGEXP_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Defines struct ::RRegexp.
*/
-#ifndef RUBY3_RREGEXP_H
-#define RUBY3_RREGEXP_H
#include "ruby/3/attr/artificial.h"
#include "ruby/3/attr/pure.h"
#include "ruby/3/cast.h"
diff --git a/include/ruby/3/core/rstring.h b/include/ruby/3/core/rstring.h
index 244b90e96cc..8951dd0d301 100644
--- a/include/ruby/3/core/rstring.h
+++ b/include/ruby/3/core/rstring.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_RSTRING_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_RSTRING_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Defines struct ::RString.
*/
-#ifndef RUBY3_RSTRING_H
-#define RUBY3_RSTRING_H
#include "ruby/3/config.h"
#include "ruby/3/arithmetic/long.h"
#include "ruby/3/attr/artificial.h"
diff --git a/include/ruby/3/core/rstruct.h b/include/ruby/3/core/rstruct.h
index 55db1b3fc02..d474697e4ec 100644
--- a/include/ruby/3/core/rstruct.h
+++ b/include/ruby/3/core/rstruct.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_RSTRUCT_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_RSTRUCT_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Routines to manipulate struct ::RStruct.
*/
-#ifndef RUBY3_RSTRUCT_H
-#define RUBY3_RSTRUCT_H
#include "ruby/3/attr/artificial.h"
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
diff --git a/include/ruby/3/core/rtypeddata.h b/include/ruby/3/core/rtypeddata.h
index cc00fa25007..d46fd5c5198 100644
--- a/include/ruby/3/core/rtypeddata.h
+++ b/include/ruby/3/core/rtypeddata.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_RTYPEDDATA_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_RTYPEDDATA_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Defines struct ::RTypedData.
*/
-#ifndef RUBY3_RTYPEDDATA_H
-#define RUBY3_RTYPEDDATA_H
#include "ruby/3/config.h"
#ifdef STDC_HEADERS
diff --git a/include/ruby/3/ctype.h b/include/ruby/3/ctype.h
index 41fb6733df0..76927bf9a10 100644
--- a/include/ruby/3/ctype.h
+++ b/include/ruby/3/ctype.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_CTYPE_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_CTYPE_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Our own, locale independent, character handling routines.
*/
-#ifndef RUBY3_CTYPE_H
-#define RUBY3_CTYPE_H
#include "ruby/3/config.h"
#ifdef STDC_HEADERS
diff --git a/include/ruby/3/dllexport.h b/include/ruby/3/dllexport.h
index 20b3d2eb596..5d6ae28d41b 100644
--- a/include/ruby/3/dllexport.h
+++ b/include/ruby/3/dllexport.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_DLLEXPORT_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_DLLEXPORT_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Tewaking visibility of C variables/functions.
*/
-#ifndef RUBY3_DLLEXPORT_H
-#define RUBY3_DLLEXPORT_H
#include "ruby/3/config.h"
#include "ruby/3/compiler_is.h"
diff --git a/include/ruby/3/dosish.h b/include/ruby/3/dosish.h
index 8e17fade6fd..06a84b01684 100644
--- a/include/ruby/3/dosish.h
+++ b/include/ruby/3/dosish.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_DOSISH_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_DOSISH_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Support for so-called dosish systems.
*/
-#ifndef RUBY3_DOSISH_H
-#define RUBY3_DOSISH_H
#ifdef __CYGWIN__
#undef _WIN32
#endif
diff --git a/include/ruby/3/error.h b/include/ruby/3/error.h
index e45b03d90ab..49892199d46 100644
--- a/include/ruby/3/error.h
+++ b/include/ruby/3/error.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_ERROR_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_ERROR_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Declares ::rb_raise().
*/
-#ifndef RUBY3_ERROR_H
-#define RUBY3_ERROR_H
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
#include "ruby/backward/2/attributes.h"
diff --git a/include/ruby/3/eval.h b/include/ruby/3/eval.h
index 01fd80dc75c..d438581bd68 100644
--- a/include/ruby/3/eval.h
+++ b/include/ruby/3/eval.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_EVAL_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_EVAL_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Declares ::rb_eval_string().
*/
-#ifndef RUBY3_EVAL_H
-#define RUBY3_EVAL_H
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
diff --git a/include/ruby/3/event.h b/include/ruby/3/event.h
index 30eb1d815be..83f6709031f 100644
--- a/include/ruby/3/event.h
+++ b/include/ruby/3/event.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_EVENT_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_EVENT_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Debugging and tracing APIs.
*/
-#ifndef RUBY3_EVENT_H
-#define RUBY3_EVENT_H
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
diff --git a/include/ruby/3/fl_type.h b/include/ruby/3/fl_type.h
index 62b6f1b9c6a..2adb6006c7b 100644
--- a/include/ruby/3/fl_type.h
+++ b/include/ruby/3/fl_type.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_FL_TYPE_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_FL_TYPE_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Defines enum ::ruby_fl_type.
*/
-#ifndef RUBY3_FL_TYPE_H
-#define RUBY3_FL_TYPE_H
#include "ruby/3/config.h" /* for ENUM_OVER_INT */
#include "ruby/3/attr/artificial.h"
#include "ruby/3/attr/flag_enum.h"
diff --git a/include/ruby/3/gc.h b/include/ruby/3/gc.h
index e6c66e73ead..c4ce87b3197 100644
--- a/include/ruby/3/gc.h
+++ b/include/ruby/3/gc.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_GC_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_GC_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Registering values to the GC.
*/
-#ifndef RUBY3_GC_H
-#define RUBY3_GC_H
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
diff --git a/include/ruby/3/glob.h b/include/ruby/3/glob.h
index 96d01a1dd68..e09db760f88 100644
--- a/include/ruby/3/glob.h
+++ b/include/ruby/3/glob.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_GLOB_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_GLOB_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Declares ::rb_glob().
*/
-#ifndef RUBY3_GLOB_H
-#define RUBY3_GLOB_H
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
diff --git a/include/ruby/3/globals.h b/include/ruby/3/globals.h
index d72e62d9052..504058f1bcf 100644
--- a/include/ruby/3/globals.h
+++ b/include/ruby/3/globals.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_GLOBALS_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_GLOBALS_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Ruby-level global variables / constants, visible from C.
*/
-#ifndef RUBY3_GLOBALS_H
-#define RUBY3_GLOBALS_H
#include "ruby/3/attr/pure.h"
#include "ruby/3/dllexport.h"
#include "ruby/3/fl_type.h"
diff --git a/include/ruby/3/has/attribute.h b/include/ruby/3/has/attribute.h
index 36a1a1229c3..c8ad7da9cf1 100644
--- a/include/ruby/3/has/attribute.h
+++ b/include/ruby/3/has/attribute.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_HAS_ATTRIBUTE_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_HAS_ATTRIBUTE_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -21,10 +23,7 @@
#include "ruby/3/config.h"
/** Wraps (or simulates) `__has_attribute`. */
-#if defined(RUBY3_HAS_ATTRIBUTE)
-# /* Take that. */
-
-#elif defined(__has_attribute)
+#if defined(__has_attribute)
# define RUBY3_HAS_ATTRIBUTE(_) __has_attribute(_)
#elif RUBY3_COMPILER_IS(GCC)
@@ -150,3 +149,5 @@
# define RUBY3_HAS_ATTRIBUTE_weak 1
# endif
#endif
+
+#endif /* RUBY3_HAS_ATTRIBUTE_H */
diff --git a/include/ruby/3/has/builtin.h b/include/ruby/3/has/builtin.h
index 54dc2a56728..f1524061ae2 100644
--- a/include/ruby/3/has/builtin.h
+++ b/include/ruby/3/has/builtin.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_HAS_BUILTIN_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_HAS_BUILTIN_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -21,10 +23,7 @@
#include "ruby/3/config.h"
/** Wraps (or simulates) `__has_builtin`. */
-#if defined(RUBY3_HAS_BUILTIN)
-# /* Take that. */
-
-#elif defined(__has_builtin) && ! RUBY3_COMPILER_IS(Intel)
+#if defined(__has_builtin) && ! RUBY3_COMPILER_IS(Intel)
# /* :TODO: Intel C Compiler has __has_builtin (since 19.1 maybe?), and is
# * reportedly broken. We have to skip them. However the situation can
# * change. They might improve someday. We need to revisit here later. */
@@ -89,3 +88,5 @@
# define RUBY3_HAS_BUILTIN___builtin_unreachable 1
# endif
#endif
+
+#endif /* RUBY3_HAS_BUILTIN_H */
diff --git a/include/ruby/3/has/c_attribute.h b/include/ruby/3/has/c_attribute.h
index 89186217d36..e883eb71e6e 100644
--- a/include/ruby/3/has/c_attribute.h
+++ b/include/ruby/3/has/c_attribute.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_HAS_C_ATTRIBUTE_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_HAS_C_ATTRIBUTE_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -20,10 +22,7 @@
*/
/** Wraps (or simulates) `__has_c_attribute`. */
-#if defined(RUBY3_HAS_C_ATTRIBUTE)
-# /* Take that. */
-
-#elif defined(__cplusplus)
+#if defined(__cplusplus)
# /* Makes no sense. */
# define RUBY3_HAS_C_ATTRIBUTE(_) 0
@@ -35,3 +34,5 @@
# * lacks C2x attributes as well. Might change in future? */
# define RUBY3_HAS_C_ATTRIBUTE(_) 0
#endif
+
+#endif /* RUBY3_HAS_C_ATTRIBUTE_H */
diff --git a/include/ruby/3/has/cpp_attribute.h b/include/ruby/3/has/cpp_attribute.h
index 70bec4a2677..42209c0955b 100644
--- a/include/ruby/3/has/cpp_attribute.h
+++ b/include/ruby/3/has/cpp_attribute.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_HAS_CPP_ATTRIBUTE_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_HAS_CPP_ATTRIBUTE_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -21,10 +23,7 @@
#include "ruby/3/compiler_is.h"
/** @cond INTERNAL_MACRO */
-#if defined(RUBY3_HAS_CPP_ATTRIBUTE0)
-# /* Take that. */
-
-#elif defined(__has_cpp_attribute)
+#if defined(__has_cpp_attribute)
# define RUBY3_HAS_CPP_ATTRIBUTE0(_) __has_cpp_attribute(_)
#elif RUBY3_COMPILER_IS(MSVC)
@@ -66,15 +65,13 @@
/** @endcond */
/** Wraps (or simulates) `__has_cpp_attribute`. */
-#ifdef RUBY3_HAS_CPP_ATTRIBUTE
-# /* Take that. */
-
-#elif ! defined(__cplusplus)
+#if ! defined(__cplusplus)
# /* Makes no sense. */
# define RUBY3_HAS_CPP_ATTRIBUTE(_) 0
-
#else
# /* GCC needs workarounds. See https://gcc.godbolt.org/z/jdz3pa */
# define RUBY3_HAS_CPP_ATTRIBUTE(_) \
((RUBY3_HAS_CPP_ATTRIBUTE0(_) <= __cplusplus) ? RUBY3_HAS_CPP_ATTRIBUTE0(_) : 0)
#endif
+
+#endif /* RUBY3_HAS_CPP_ATTRIBUTE_H */
diff --git a/include/ruby/3/has/declspec_attribute.h b/include/ruby/3/has/declspec_attribute.h
index a7d97b400ae..4774eb88f2f 100644
--- a/include/ruby/3/has/declspec_attribute.h
+++ b/include/ruby/3/has/declspec_attribute.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_HAS_DECLSPEC_ATTRIBUTE_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_HAS_DECLSPEC_ATTRIBUTE_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -20,12 +22,8 @@
*/
/** Wraps (or simulates) `__has_declspec_attribute`. */
-#if defined(RUBY3_HAS_DECLSPEC_ATTRIBUTE)
-# /* Take that. */
-
-#elif defined(__has_declspec_attribute)
+#if defined(__has_declspec_attribute)
# define RUBY3_HAS_DECLSPEC_ATTRIBUTE(_) __has_declspec_attribute(_)
-
#else
# define RUBY3_HAS_DECLSPEC_ATTRIBUTE(_) RUBY3_TOKEN_PASTE(RUBY3_HAS_DECLSPEC_ATTRIBUTE_, _)
# define RUBY3_HAS_DECLSPEC_ATTRIBUTE_align RUBY3_COMPILER_SINCE(MSVC, 8, 0, 0)
@@ -44,3 +42,5 @@
# undef RUBY3_HAS_DECLSPEC_ATTRIBUTE_nothrow
# endif
#endif
+
+#endif /* RUBY3_HAS_DECLSPEC_ATTRIBUTE_H */
diff --git a/include/ruby/3/has/extension.h b/include/ruby/3/has/extension.h
index ca3392a0902..ed6f6d4d52f 100644
--- a/include/ruby/3/has/extension.h
+++ b/include/ruby/3/has/extension.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_HAS_EXTENSION_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_HAS_EXTENSION_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -21,13 +23,11 @@
#include "ruby/3/has/feature.h"
/** Wraps (or simulates) `__has_extension`. */
-#if defined(RUBY3_HAS_EXTENSION)
-# /* Take that. */
-
-#elif defined(__has_extension)
+#if defined(__has_extension)
# define RUBY3_HAS_EXTENSION(_) __has_extension(_)
-
#else
# /* Pre-3.0 clang had __has_feature but not __has_extension. */
# define RUBY3_HAS_EXTENSION(_) RUBY3_HAS_FEATURE(_)
#endif
+
+#endif /* RUBY3_HAS_EXTENSION_H */
diff --git a/include/ruby/3/has/feature.h b/include/ruby/3/has/feature.h
index 977b8150bbc..f64c756817a 100644
--- a/include/ruby/3/has/feature.h
+++ b/include/ruby/3/has/feature.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_HAS_FEATURE_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_HAS_FEATURE_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -20,12 +22,10 @@
*/
/** Wraps (or simulates) `__has_feature`. */
-#if defined(RUBY3_HAS_FEATURE)
-# /* Take that. */
-
-#elif defined(__has_feature)
+#if defined(__has_feature)
# define RUBY3_HAS_FEATURE(_) __has_feature(_)
-
#else
# define RUBY3_HAS_FEATURE(_) 0
#endif
+
+#endif /* RUBY3_HAS_FEATURE_H */
diff --git a/include/ruby/3/has/warning.h b/include/ruby/3/has/warning.h
index a66d76dfa72..3ec8e8f79ec 100644
--- a/include/ruby/3/has/warning.h
+++ b/include/ruby/3/has/warning.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_HAS_WARNING_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_HAS_WARNING_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -20,12 +22,10 @@
*/
/** Wraps (or simulates) `__has_warning`. */
-#if defined(RUBY3_HAS_WARNING)
-# /* Take that. */
-
-#elif defined(__has_warning)
+#if defined(__has_warning)
# define RUBY3_HAS_WARNING(_) __has_warning(_)
-
#else
# define RUBY3_HAS_WARNING(_) 0
#endif
+
+#endif /* RUBY3_HAS_WARNING_H */
diff --git a/include/ruby/3/intern/array.h b/include/ruby/3/intern/array.h
index 02e44c99adf..bf7e1d9fab9 100644
--- a/include/ruby/3/intern/array.h
+++ b/include/ruby/3/intern/array.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_INTERN_ARRAY_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_INTERN_ARRAY_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Public APIs related to ::rb_cArray.
*/
-#ifndef RUBY3_INTERN_ARRAY_H
-#define RUBY3_INTERN_ARRAY_H
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
diff --git a/include/ruby/3/intern/bignum.h b/include/ruby/3/intern/bignum.h
index 398d09f625e..f4707f5b6da 100644
--- a/include/ruby/3/intern/bignum.h
+++ b/include/ruby/3/intern/bignum.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_INTERN_BIGNUM_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_INTERN_BIGNUM_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Public APIs related to so-called rb_cBignum.
*/
-#ifndef RUBY3_INTERN_BIGNUM_H
-#define RUBY3_INTERN_BIGNUM_H
#include "ruby/3/config.h"
#ifdef STDC_HEADERS
diff --git a/include/ruby/3/intern/class.h b/include/ruby/3/intern/class.h
index a4778bdf27b..36b873f4dfd 100644
--- a/include/ruby/3/intern/class.h
+++ b/include/ruby/3/intern/class.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_INTERN_CLASS_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_INTERN_CLASS_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Public APIs related to ::rb_cClass/::rb_cModule.
*/
-#ifndef RUBY3_INTERN_CLASS_H
-#define RUBY3_INTERN_CLASS_H
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
#include "ruby/backward/2/stdarg.h"
diff --git a/include/ruby/3/intern/compar.h b/include/ruby/3/intern/compar.h
index 68e8661b56a..22240680c5c 100644
--- a/include/ruby/3/intern/compar.h
+++ b/include/ruby/3/intern/compar.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_INTERN_COMPAR_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_INTERN_COMPAR_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Public APIs related to ::rb_mComparable.
*/
-#ifndef RUBY3_INTERN_COMPAR_H
-#define RUBY3_INTERN_COMPAR_H
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
diff --git a/include/ruby/3/intern/complex.h b/include/ruby/3/intern/complex.h
index d9a0f156313..ba9fe6c2889 100644
--- a/include/ruby/3/intern/complex.h
+++ b/include/ruby/3/intern/complex.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_INTERN_COMPLEX_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_INTERN_COMPLEX_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Public APIs related to ::rb_cComplex.
*/
-#ifndef RUBY3_INTERN_COMPLEX_H
-#define RUBY3_INTERN_COMPLEX_H
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
#include "ruby/3/arithmetic/long.h" /* INT2FIX is here. */
diff --git a/include/ruby/3/intern/cont.h b/include/ruby/3/intern/cont.h
index 95374f909c0..a3c340bb0a7 100644
--- a/include/ruby/3/intern/cont.h
+++ b/include/ruby/3/intern/cont.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_INTERN_CONT_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_INTERN_CONT_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Public APIs related to rb_cFiber.
*/
-#ifndef RUBY3_INTERN_CONT_H
-#define RUBY3_INTERN_CONT_H
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
#include "ruby/3/iterator.h"
diff --git a/include/ruby/3/intern/dir.h b/include/ruby/3/intern/dir.h
index 1a7bfbe7de9..09bef100ac3 100644
--- a/include/ruby/3/intern/dir.h
+++ b/include/ruby/3/intern/dir.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_INTERN_DIR_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_INTERN_DIR_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Public APIs related to ::rb_cDir.
*/
-#ifndef RUBY3_INTERN_DIR_H
-#define RUBY3_INTERN_DIR_H
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
diff --git a/include/ruby/3/intern/enum.h b/include/ruby/3/intern/enum.h
index 075cd2066a8..9dafad694ae 100644
--- a/include/ruby/3/intern/enum.h
+++ b/include/ruby/3/intern/enum.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_INTERN_ENUM_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_INTERN_ENUM_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Public APIs related to ::rb_mEnumerable.
*/
-#ifndef RUBY3_INTERN_ENUM_H
-#define RUBY3_INTERN_ENUM_H
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
diff --git a/include/ruby/3/intern/enumerator.h b/include/ruby/3/intern/enumerator.h
index 31efa07bd15..acd01fca185 100644
--- a/include/ruby/3/intern/enumerator.h
+++ b/include/ruby/3/intern/enumerator.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_INTERN_ENUMERATOR_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_INTERN_ENUMERATOR_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Public APIs related to ::rb_cEnumerator.
*/
-#ifndef RUBY3_INTERN_ENUMERATOR_H
-#define RUBY3_INTERN_ENUMERATOR_H
#include "ruby/3/dllexport.h"
#include "ruby/3/intern/eval.h" /* rb_frame_this_func */
#include "ruby/3/iterator.h" /* rb_block_given_p */
diff --git a/include/ruby/3/intern/error.h b/include/ruby/3/intern/error.h
index a5b56db760f..a8b854c36b2 100644
--- a/include/ruby/3/intern/error.h
+++ b/include/ruby/3/intern/error.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_INTERN_ERROR_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_INTERN_ERROR_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Public APIs related to ::rb_eException.
*/
-#ifndef RUBY3_INTERN_ERROR_H
-#define RUBY3_INTERN_ERROR_H
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
#include "ruby/3/fl_type.h"
diff --git a/include/ruby/3/intern/eval.h b/include/ruby/3/intern/eval.h
index 158820d96a6..3114d00bc09 100644
--- a/include/ruby/3/intern/eval.h
+++ b/include/ruby/3/intern/eval.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_INTERN_EVAL_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_INTERN_EVAL_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Pre-1.9 era evaluator APIs (now considered miscellaneous).
*/
-#ifndef RUBY3_INTERN_EVAL_H
-#define RUBY3_INTERN_EVAL_H
#include "ruby/3/attr/noreturn.h"
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
diff --git a/include/ruby/3/intern/file.h b/include/ruby/3/intern/file.h
index a2d4a9996e0..c87e59ea019 100644
--- a/include/ruby/3/intern/file.h
+++ b/include/ruby/3/intern/file.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_INTERN_FILE_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_INTERN_FILE_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Public APIs related to ::rb_cFile.
*/
-#ifndef RUBY3_INTERN_FILE_H
-#define RUBY3_INTERN_FILE_H
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
diff --git a/include/ruby/3/intern/gc.h b/include/ruby/3/intern/gc.h
index dd96229aceb..81ff74839a9 100644
--- a/include/ruby/3/intern/gc.h
+++ b/include/ruby/3/intern/gc.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_INTERN_GC_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_INTERN_GC_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Public APIs related to ::rb_mGC.
*/
-#ifndef RUBY3_INTERN_GC_H
-#define RUBY3_INTERN_GC_H
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
#include "ruby/backward/2/attributes.h"
diff --git a/include/ruby/3/intern/hash.h b/include/ruby/3/intern/hash.h
index d39e420a22f..f8d0628b9b2 100644
--- a/include/ruby/3/intern/hash.h
+++ b/include/ruby/3/intern/hash.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_INTERN_HASH_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_INTERN_HASH_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Public APIs related to ::rb_cHash.
*/
-#ifndef RUBY3_INTERN_HASH_H
-#define RUBY3_INTERN_HASH_H
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
#include "ruby/st.h"
diff --git a/include/ruby/3/intern/io.h b/include/ruby/3/intern/io.h
index 783f2515c2b..f53f14c02af 100644
--- a/include/ruby/3/intern/io.h
+++ b/include/ruby/3/intern/io.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_INTERN_IO_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_INTERN_IO_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Public APIs related to ::rb_cIO.
*/
-#ifndef RUBY3_INTERN_IO_H
-#define RUBY3_INTERN_IO_H
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
diff --git a/include/ruby/3/intern/load.h b/include/ruby/3/intern/load.h
index 0f26c9f136d..1a1dfb001ef 100644
--- a/include/ruby/3/intern/load.h
+++ b/include/ruby/3/intern/load.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_INTERN_LOAD_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_INTERN_LOAD_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Public APIs related to ::rb_f_require().
*/
-#ifndef RUBY3_INTERN_LOAD_H
-#define RUBY3_INTERN_LOAD_H
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
diff --git a/include/ruby/3/intern/marshal.h b/include/ruby/3/intern/marshal.h
index 5c46d04fab9..2028b4520ab 100644
--- a/include/ruby/3/intern/marshal.h
+++ b/include/ruby/3/intern/marshal.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_INTERN_MARSHAL_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_INTERN_MARSHAL_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Public APIs related to rb_mMarshal.
*/
-#ifndef RUBY3_INTERN_MARSHAL_H
-#define RUBY3_INTERN_MARSHAL_H
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
diff --git a/include/ruby/3/intern/numeric.h b/include/ruby/3/intern/numeric.h
index 989ec7ee6a6..ad8d9849446 100644
--- a/include/ruby/3/intern/numeric.h
+++ b/include/ruby/3/intern/numeric.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_INTERN_NUMERIC_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_INTERN_NUMERIC_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Public APIs related to ::rb_cNumeric.
*/
-#ifndef RUBY3_INTERN_NUMERIC_H
-#define RUBY3_INTERN_NUMERIC_H
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
#include "ruby/backward/2/attributes.h"
diff --git a/include/ruby/3/intern/object.h b/include/ruby/3/intern/object.h
index 543985a4890..acfe63fa069 100644
--- a/include/ruby/3/intern/object.h
+++ b/include/ruby/3/intern/object.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_INTERN_OBJECT_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_INTERN_OBJECT_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Public APIs related to ::rb_cObject.
*/
-#ifndef RUBY3_INTERN_OBJECT_H
-#define RUBY3_INTERN_OBJECT_H
#include "ruby/3/attr/pure.h"
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
diff --git a/include/ruby/3/intern/parse.h b/include/ruby/3/intern/parse.h
index d89ef400c01..9831bdc511d 100644
--- a/include/ruby/3/intern/parse.h
+++ b/include/ruby/3/intern/parse.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_INTERN_PARSE_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_INTERN_PARSE_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Public APIs related to ::rb_cSymbol.
*/
-#ifndef RUBY3_INTERN_PARSE_H
-#define RUBY3_INTERN_PARSE_H
#include "ruby/3/attr/const.h"
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
diff --git a/include/ruby/3/intern/proc.h b/include/ruby/3/intern/proc.h
index ce8304bb59f..1b66a3b26ba 100644
--- a/include/ruby/3/intern/proc.h
+++ b/include/ruby/3/intern/proc.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_INTERN_PROC_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_INTERN_PROC_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Public APIs related to ::rb_cProc.
*/
-#ifndef RUBY3_INTERN_PROC_H
-#define RUBY3_INTERN_PROC_H
#include "ruby/3/dllexport.h"
#include "ruby/3/iterator.h"
#include "ruby/3/value.h"
diff --git a/include/ruby/3/intern/process.h b/include/ruby/3/intern/process.h
index efa830aa6c9..1f9c6a45c94 100644
--- a/include/ruby/3/intern/process.h
+++ b/include/ruby/3/intern/process.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_INTERN_PROCESS_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_INTERN_PROCESS_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Public APIs related to ::rb_mProcess.
*/
-#ifndef RUBY3_INTERN_PROCESS_H
-#define RUBY3_INTERN_PROCESS_H
#include "ruby/3/attr/noreturn.h"
#include "ruby/3/config.h" /* rb_pid_t is defined here. */
#include "ruby/3/dllexport.h"
diff --git a/include/ruby/3/intern/random.h b/include/ruby/3/intern/random.h
index 8493cf1d7d8..52bfeb0673d 100644
--- a/include/ruby/3/intern/random.h
+++ b/include/ruby/3/intern/random.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_INTERN_RANDOM_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_INTERN_RANDOM_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -22,8 +24,6 @@
* generator", ACM Trans. on Modeling and Computer Simulation, 8
* (1): pp 3-30, 1998. https://doi.org/10.1145/272991.272995
*/
-#ifndef RUBY3_INTERN_RANDOM_H
-#define RUBY3_INTERN_RANDOM_H
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
diff --git a/include/ruby/3/intern/range.h b/include/ruby/3/intern/range.h
index 0fb6a20a3dd..0ccb33abfbc 100644
--- a/include/ruby/3/intern/range.h
+++ b/include/ruby/3/intern/range.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_INTERN_RANGE_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_INTERN_RANGE_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Public APIs related to ::rb_cRange.
*/
-#ifndef RUBY3_INTERN_RANGE_H
-#define RUBY3_INTERN_RANGE_H
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
diff --git a/include/ruby/3/intern/rational.h b/include/ruby/3/intern/rational.h
index 3eccd7f1d52..fde0e37e194 100644
--- a/include/ruby/3/intern/rational.h
+++ b/include/ruby/3/intern/rational.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_INTERN_RATIONAL_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_INTERN_RATIONAL_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Public APIs related to ::rb_cRational.
*/
-#ifndef RUBY3_INTERN_RATIONAL_H
-#define RUBY3_INTERN_RATIONAL_H
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
#include "ruby/3/arithmetic/long.h" /* INT2FIX is here. */
diff --git a/include/ruby/3/intern/re.h b/include/ruby/3/intern/re.h
index 090fbe4511c..cc1e2539eae 100644
--- a/include/ruby/3/intern/re.h
+++ b/include/ruby/3/intern/re.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_INTERN_RE_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_INTERN_RE_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Public APIs related to ::rb_cRegexp.
*/
-#ifndef RUBY3_INTERN_RE_H
-#define RUBY3_INTERN_RE_H
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
diff --git a/include/ruby/3/intern/ruby.h b/include/ruby/3/intern/ruby.h
index f41a4d2ee79..730a032975a 100644
--- a/include/ruby/3/intern/ruby.h
+++ b/include/ruby/3/intern/ruby.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_INTERN_RUBY_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_INTERN_RUBY_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Process-global APIs.
*/
-#ifndef RUBY3_INTERN_RUBY_H
-#define RUBY3_INTERN_RUBY_H
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
diff --git a/include/ruby/3/intern/select.h b/include/ruby/3/intern/select.h
index a4be259cc29..c9c47d1a68e 100644
--- a/include/ruby/3/intern/select.h
+++ b/include/ruby/3/intern/select.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_INTERN_SELECT_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_INTERN_SELECT_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -20,8 +22,6 @@
* @note Functions and structs defined in this header file are not
* necessarily ruby-specific. They don't need ::VALUE etc.
*/
-#ifndef RUBY3_INTERN_SELECT_H
-#define RUBY3_INTERN_SELECT_H
#include "ruby/3/config.h"
#ifdef HAVE_SYS_TYPES_H
diff --git a/include/ruby/3/intern/select/largesize.h b/include/ruby/3/intern/select/largesize.h
index 2bf88ffed4e..b54ac116ddf 100644
--- a/include/ruby/3/intern/select/largesize.h
+++ b/include/ruby/3/intern/select/largesize.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_INTERN_SELECT_LARGESIZE_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_INTERN_SELECT_LARGESIZE_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -53,8 +55,6 @@
*
* So `rb_fd_set` doesn't reject file descriptors bigger than `FD_SETSIZE`.
*/
-#ifndef RUBY3_INTERN_SELECT_LARGESIZE_H
-#define RUBY3_INTERN_SELECT_LARGESIZE_H
#include "ruby/3/attr/nonnull.h"
#include "ruby/3/attr/pure.h"
#include "ruby/3/dllexport.h"
diff --git a/include/ruby/3/intern/select/posix.h b/include/ruby/3/intern/select/posix.h
index 83d93e99d98..156962c0bb6 100644
--- a/include/ruby/3/intern/select/posix.h
+++ b/include/ruby/3/intern/select/posix.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_INTERN_SELECT_POSIX_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_INTERN_SELECT_POSIX_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Public APIs to provide ::rb_fd_select().
*/
-#ifndef RUBY3_INTERN_SELECT_POSIX_H
-#define RUBY3_INTERN_SELECT_POSIX_H
#include "ruby/3/config.h"
#ifdef HAVE_SYS_SELECT_H
diff --git a/include/ruby/3/intern/select/win32.h b/include/ruby/3/intern/select/win32.h
index 8977624dc8c..fb42b5e77d1 100644
--- a/include/ruby/3/intern/select/win32.h
+++ b/include/ruby/3/intern/select/win32.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_INTERN_SELECT_WIN32_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_INTERN_SELECT_WIN32_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Public APIs to provide ::rb_fd_select().
*/
-#ifndef RUBY3_INTERN_SELECT_WIN32_H
-#define RUBY3_INTERN_SELECT_WIN32_H
#include "ruby/3/dosish.h" /* for rb_w32_select */
#include "ruby/3/attr/nonnull.h"
#include "ruby/3/attr/pure.h"
diff --git a/include/ruby/3/intern/signal.h b/include/ruby/3/intern/signal.h
index f4fa08732e1..09a2f1df1bc 100644
--- a/include/ruby/3/intern/signal.h
+++ b/include/ruby/3/intern/signal.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_INTERN_SIGNAL_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_INTERN_SIGNAL_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Signal handling APIs.
*/
-#ifndef RUBY3_INTERN_SIGNAL_H
-#define RUBY3_INTERN_SIGNAL_H
#include "ruby/3/config.h" /* POSIX_SIGNAL / RETSIGTYPE */
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
diff --git a/include/ruby/3/intern/sprintf.h b/include/ruby/3/intern/sprintf.h
index d65517af83d..908d88c6911 100644
--- a/include/ruby/3/intern/sprintf.h
+++ b/include/ruby/3/intern/sprintf.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_INTERN_SPRINTF_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_INTERN_SPRINTF_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Our own private printf(3).
*/
-#ifndef RUBY3_INTERN_SPRINTF_H
-#define RUBY3_INTERN_SPRINTF_H
#include "ruby/3/attr/format.h"
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
diff --git a/include/ruby/3/intern/string.h b/include/ruby/3/intern/string.h
index 5ac355af38f..37e8d4d992a 100644
--- a/include/ruby/3/intern/string.h
+++ b/include/ruby/3/intern/string.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_INTERN_STRING_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_INTERN_STRING_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Public APIs related to ::rb_cString.
*/
-#ifndef RUBY3_INTERN_STRING_H
-#define RUBY3_INTERN_STRING_H
#include "ruby/3/config.h"
#ifdef STDC_HEADERS
diff --git a/include/ruby/3/intern/struct.h b/include/ruby/3/intern/struct.h
index 25e80a28b89..cf99d15747b 100644
--- a/include/ruby/3/intern/struct.h
+++ b/include/ruby/3/intern/struct.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_INTERN_STRUCT_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_INTERN_STRUCT_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Public APIs related to ::rb_cStruct.
*/
-#ifndef RUBY3_INTERN_STRUCT_H
-#define RUBY3_INTERN_STRUCT_H
#include "ruby/3/dllexport.h"
#include "ruby/3/intern/vm.h" /* rb_alloc_func_t */
#include "ruby/3/value.h"
diff --git a/include/ruby/3/intern/thread.h b/include/ruby/3/intern/thread.h
index 51f20eeab2b..afd63507f4d 100644
--- a/include/ruby/3/intern/thread.h
+++ b/include/ruby/3/intern/thread.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_INTERN_THREAD_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_INTERN_THREAD_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,10 +20,7 @@
* extension libraries. They could be written in C++98.
* @brief Public APIs related to ::rb_cThread.
*/
-#ifndef RUBY3_INTERN_THREAD_H
-#define RUBY3_INTERN_THREAD_H
#include "ruby/3/config.h"
-
#include "ruby/3/cast.h"
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
diff --git a/include/ruby/3/intern/time.h b/include/ruby/3/intern/time.h
index d66d740679f..a895bc0848c 100644
--- a/include/ruby/3/intern/time.h
+++ b/include/ruby/3/intern/time.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_INTERN_TIME_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_INTERN_TIME_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -16,10 +18,8 @@
* Do not expect for instance `__VA_ARGS__` is always available.
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
- * @brief Public APIs related to ::rb_cStruct.
+ * @brief Public APIs related to ::rb_cTime.
*/
-#ifndef RUBY3_INTERN_TIME_H
-#define RUBY3_INTERN_TIME_H
#include "ruby/3/config.h"
#ifdef HAVE_TIME_H
diff --git a/include/ruby/3/intern/variable.h b/include/ruby/3/intern/variable.h
index 36408bf788b..7183219fc00 100644
--- a/include/ruby/3/intern/variable.h
+++ b/include/ruby/3/intern/variable.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_INTERN_VARIABLE_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_INTERN_VARIABLE_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Public APIs related to names inside of a Ruby program.
*/
-#ifndef RUBY3_INTERN_VARIABLE_H
-#define RUBY3_INTERN_VARIABLE_H
#include "ruby/3/attr/noreturn.h"
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
diff --git a/include/ruby/3/intern/vm.h b/include/ruby/3/intern/vm.h
index 53b2b9f8bc1..985971c28a3 100644
--- a/include/ruby/3/intern/vm.h
+++ b/include/ruby/3/intern/vm.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_INTERN_VM_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_INTERN_VM_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Public APIs related to ::rb_cRubyVM.
*/
-#ifndef RUBY3_INTERN_VM_H
-#define RUBY3_INTERN_VM_H
#include "ruby/3/attr/noreturn.h"
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
diff --git a/include/ruby/3/interpreter.h b/include/ruby/3/interpreter.h
index 25d4ec8581a..d9a4aee2c02 100644
--- a/include/ruby/3/interpreter.h
+++ b/include/ruby/3/interpreter.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_INTERPRETER_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_INTERPRETER_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Interpreter embedding APIs.
*/
-#ifndef RUBY3_INTERPRETER_H
-#define RUBY3_INTERPRETER_H
#include "ruby/3/attr/noreturn.h"
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
@@ -54,7 +54,6 @@ void ruby_show_version(void);
void ruby_show_copyright(void);
#endif
-
/*! A convenience macro to call ruby_init_stack(). Must be placed just after
* variable declarations */
#define RUBY_INIT_STACK \
diff --git a/include/ruby/3/iterator.h b/include/ruby/3/iterator.h
index dcd580d4923..9c39efc3006 100644
--- a/include/ruby/3/iterator.h
+++ b/include/ruby/3/iterator.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_ITERATOR_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_ITERATOR_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Block related APIs.
*/
-#ifndef RUBY3_ITERATOR_H
-#define RUBY3_ITERATOR_H
#include "ruby/3/attr/noreturn.h"
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
diff --git a/include/ruby/3/memory.h b/include/ruby/3/memory.h
index 9001fd2ab37..2edab9a1fba 100644
--- a/include/ruby/3/memory.h
+++ b/include/ruby/3/memory.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_MEMORY_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_MEMORY_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Memory management stuff.
*/
-#ifndef RUBY3_MEMORY_H
-#define RUBY3_MEMORY_H
#include "ruby/3/config.h"
#ifdef STDC_HEADERS
diff --git a/include/ruby/3/method.h b/include/ruby/3/method.h
index 379ea95c25f..dc6e32078bf 100644
--- a/include/ruby/3/method.h
+++ b/include/ruby/3/method.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_METHOD_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_METHOD_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Creation and modification of Ruby methods.
*/
-#ifndef RUBY3_METHOD_H
-#define RUBY3_METHOD_H
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
#include "ruby/backward/2/stdarg.h"
diff --git a/include/ruby/3/module.h b/include/ruby/3/module.h
index d82071a7260..cbd45f8efe8 100644
--- a/include/ruby/3/module.h
+++ b/include/ruby/3/module.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_MODULE_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_MODULE_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Creation and modification of Ruby modules.
*/
-#ifndef RUBY3_MODULE_H
-#define RUBY3_MODULE_H
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
diff --git a/include/ruby/3/newobj.h b/include/ruby/3/newobj.h
index 89f7e9c30d7..2ad48a66f6a 100644
--- a/include/ruby/3/newobj.h
+++ b/include/ruby/3/newobj.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_NEWOBJ_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_NEWOBJ_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Defines #NEWOBJ.
*/
-#ifndef RUBY3_NEWOBJ_H
-#define RUBY3_NEWOBJ_H
#include "ruby/3/cast.h"
#include "ruby/3/core/rbasic.h"
#include "ruby/3/dllexport.h"
diff --git a/include/ruby/3/rgengc.h b/include/ruby/3/rgengc.h
index 217798fbec7..4f321375f3b 100644
--- a/include/ruby/3/rgengc.h
+++ b/include/ruby/3/rgengc.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_RGENGC_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_RGENGC_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -22,8 +24,6 @@
* International Symposium on Memory Management (ISMM 2019), pp
* 115-121, 2019. https://doi.org/10.1145/3315573.3329986
*/
-#ifndef RUBY3_RGENGC_H
-#define RUBY3_RGENGC_H
#include "ruby/3/attr/artificial.h"
#include "ruby/3/attr/pure.h"
#include "ruby/3/dllexport.h"
diff --git a/include/ruby/3/scan_args.h b/include/ruby/3/scan_args.h
index 9bc32fb1b1f..bc4faddd56a 100644
--- a/include/ruby/3/scan_args.h
+++ b/include/ruby/3/scan_args.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_SCAN_ARGS_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_SCAN_ARGS_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -21,8 +23,6 @@
* This is a beast. It statically analyses the argument spec string, and
* expands the assignment of variables into dedicated codes.
*/
-#ifndef RUBY3_SCAN_ARGS_H
-#define RUBY3_SCAN_ARGS_H
#include "ruby/3/attr/diagnose_if.h"
#include "ruby/3/attr/error.h"
#include "ruby/3/attr/forceinline.h"
diff --git a/include/ruby/3/special_consts.h b/include/ruby/3/special_consts.h
index c66dd95d6a6..683cebf1ed7 100644
--- a/include/ruby/3/special_consts.h
+++ b/include/ruby/3/special_consts.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_SPECIAL_CONSTS_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_SPECIAL_CONSTS_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -22,8 +24,6 @@
* SIGPPL Workshop on Programming and Programming Languages
* (PPL2008), pp. 9-16, 2008.
*/
-#ifndef RUBY3_SPECIAL_CONSTS_H
-#define RUBY3_SPECIAL_CONSTS_H
#include "ruby/3/attr/artificial.h"
#include "ruby/3/attr/const.h"
#include "ruby/3/attr/constexpr.h"
@@ -164,7 +164,6 @@ RB_FLONUM_P(VALUE obj)
#endif
}
-
RUBY3_ATTR_CONST()
RUBY3_ATTR_CONSTEXPR(CXX11)
RUBY3_ATTR_ARTIFICIAL()
diff --git a/include/ruby/3/static_assert.h b/include/ruby/3/static_assert.h
index 78ce4def4b8..b9c842f3b6c 100644
--- a/include/ruby/3/static_assert.h
+++ b/include/ruby/3/static_assert.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_STATIC_ASSERT_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_STATIC_ASSERT_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -22,10 +24,7 @@
#include "ruby/3/has/extension.h"
/** @cond INTERNAL_MACRO */
-#if defined(RUBY3_STATIC_ASSERT0)
-# /* Take that. */
-
-#elif defined(__cplusplus) && defined(__cpp_static_assert)
+#if defined(__cplusplus) && defined(__cpp_static_assert)
# /* https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations */
# define RUBY3_STATIC_ASSERT0 static_assert
@@ -62,10 +61,7 @@
* @param expr Expression to assert.
* @note `name` shall not be a string literal.
*/
-#if defined(RUBY3_STATIC_ASSERT)
-# /* Take that. */
-
-#elif defined(__DOXYGEN__)
+#if defined(__DOXYGEN__)
# define RUBY3_STATIC_ASSERT static_assert
#elif defined(RUBY3_STATIC_ASSERT0)
@@ -76,3 +72,5 @@
# define RUBY3_STATIC_ASSERT(name, expr) \
typedef int static_assert_ ## name ## _check[1 - 2 * !(expr)]
#endif
+
+#endif /* RUBY3_STATIC_ASSERT_H */
diff --git a/include/ruby/3/stdalign.h b/include/ruby/3/stdalign.h
index 294a6410c47..ccc68b66dfb 100644
--- a/include/ruby/3/stdalign.h
+++ b/include/ruby/3/stdalign.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_STDALIGN_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_STDALIGN_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -48,10 +50,7 @@
* - You cannot `struct _Alignas`.
* - A `typedef` cannot have alignments.
*/
-#if defined(RUBY3_ALIGNAS)
-# /* OK, take that. */
-
-#elif defined(__cplusplus) && RUBY3_HAS_FEATURE(cxx_alignas)
+#if defined(__cplusplus) && RUBY3_HAS_FEATURE(cxx_alignas)
# define RUBY3_ALIGNAS alignas
#elif defined(__cplusplus) && (__cplusplus >= 201103L)
@@ -77,10 +76,7 @@
* Wraps (or simulates) `alignof`. Unlike #RUBY3_ALIGNAS, we can safely say
* both C/C++ definitions are effective.
*/
-#ifdef RUBY3_ALIGNOF
-# /* OK, take that. */
-
-#elif defined(__cplusplus) && RUBY3_HAS_EXTENSION(cxx_alignof)
+#if defined(__cplusplus) && RUBY3_HAS_EXTENSION(cxx_alignof)
# define RUBY3_ALIGNOF __extension__ alignof
#elif defined(__cplusplus) && (__cplusplus >= 201103L)
@@ -122,3 +118,5 @@
#else
# error :FIXME: add your compiler here to obtain an alignment.
#endif
+
+#endif /* RUBY3_STDALIGN_H */
diff --git a/include/ruby/3/stdbool.h b/include/ruby/3/stdbool.h
index 2c33c06839d..9216f54e2d5 100644
--- a/include/ruby/3/stdbool.h
+++ b/include/ruby/3/stdbool.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_STDBOOL_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_STDBOOL_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -45,3 +47,5 @@ typedef unsigned char _Bool;
# define false ((_Bool)+0)
# define __bool_true_false_are_defined
#endif
+
+#endif /* RUBY3_STDBOOL_H */
diff --git a/include/ruby/3/symbol.h b/include/ruby/3/symbol.h
index dc77cb2bc6c..2d890901c45 100644
--- a/include/ruby/3/symbol.h
+++ b/include/ruby/3/symbol.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_SYMBOL_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_SYMBOL_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Defines #rb_intern
*/
-#ifndef RUBY3_SYMBOL_H
-#define RUBY3_SYMBOL_H
#include "ruby/3/config.h"
#ifdef HAVE_STDDEF_H
diff --git a/include/ruby/3/token_paste.h b/include/ruby/3/token_paste.h
index e15897dcc01..4e6dbb4834c 100644
--- a/include/ruby/3/token_paste.h
+++ b/include/ruby/3/token_paste.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_TOKEN_PASTE_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_TOKEN_PASTE_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -26,10 +28,7 @@
* documented. Please improve this file when you are really sure about your
* compiler's behaviour. */
-#if defined(RUBY3_TOKEN_PASTE)
-# /* Take that. */
-
-#elif RUBY3_COMPILER_SINCE(GCC, 4, 2, 0)
+#if RUBY3_COMPILER_SINCE(GCC, 4, 2, 0)
# /* GCC is one of such compiler who cannot write `_Pragma` inside of a `#if`.
# * Cannot but globally kill everything. This is of course a very bad thing.
# * If you know how to reroute this please tell us. */
@@ -69,3 +68,5 @@
# /* No way. */
# define RUBY3_TOKEN_PASTE(x, y) TOKEN_PASTE(x, y)
#endif
+
+#endif /* RUBY3_TOKEN_PASTE_H */
diff --git a/include/ruby/3/value.h b/include/ruby/3/value.h
index b57c3df346b..99189a4f0e3 100644
--- a/include/ruby/3/value.h
+++ b/include/ruby/3/value.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_VALUE_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_VALUE_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Defines ::VALUE and ::ID.
*/
-#ifndef RUBY3_VALUE_H
-#define RUBY3_VALUE_H
#include "ruby/3/static_assert.h"
#include "ruby/backward/2/long_long.h"
#include "ruby/backward/2/limits.h"
diff --git a/include/ruby/3/value_type.h b/include/ruby/3/value_type.h
index 192d97b9fd5..8598dfd7e8f 100644
--- a/include/ruby/3/value_type.h
+++ b/include/ruby/3/value_type.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_VALUE_TYPE_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_VALUE_TYPE_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Defines enum ::ruby_value_type.
*/
-#ifndef RUBY3_VALUE_TYPE_H
-#define RUBY3_VALUE_TYPE_H
#include "ruby/3/assume.h"
#include "ruby/3/attr/artificial.h"
#include "ruby/3/attr/cold.h"
diff --git a/include/ruby/3/variable.h b/include/ruby/3/variable.h
index b1b9f922ff9..942c9865f4c 100644
--- a/include/ruby/3/variable.h
+++ b/include/ruby/3/variable.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_VARIABLE_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_VARIABLE_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief C-function backended Ruby-global variables.
*/
-#ifndef RUBY3_VARIABLE_H
-#define RUBY3_VARIABLE_H
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
#include "ruby/3/attr/noreturn.h"
@@ -59,4 +59,4 @@ VALUE rb_iv_set(VALUE, const char*, VALUE);
RUBY3_SYMBOL_EXPORT_END()
-#endif /* RUBY3_RHASH_H */
+#endif /* RUBY3_VARIABLE_H */
diff --git a/include/ruby/3/warning_push.h b/include/ruby/3/warning_push.h
index 6edaaa37ee9..c3384f2d75d 100644
--- a/include/ruby/3/warning_push.h
+++ b/include/ruby/3/warning_push.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_WARNING_PUSH_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_WARNING_PUSH_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -43,10 +45,7 @@
*/
#include "ruby/3/compiler_is.h"
-#ifdef RUBY3_WARNING_PUSH
-# /* Take that. */
-
-#elif RUBY3_COMPILER_SINCE(MSVC, 12, 0, 0)
+#if RUBY3_COMPILER_SINCE(MSVC, 12, 0, 0)
# /* Not sure exactly when but it seems VC++ 6.0 is a version with it.*/
# define RUBY3_WARNING_PUSH() __pragma(warning(push))
# define RUBY3_WARNING_POP() __pragma(warning(pop))
@@ -87,3 +86,5 @@
# define RUBY3_WARNING_IGNORED(flag) /* void */
#endif /* _MSC_VER */
/** @endcond */
+
+#endif /* RUBY3_WARNING_PUSH_H */
diff --git a/include/ruby/3/xmalloc.h b/include/ruby/3/xmalloc.h
index e488e25afc9..ecf9addc9e3 100644
--- a/include/ruby/3/xmalloc.h
+++ b/include/ruby/3/xmalloc.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY3_XMALLOC_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY3_XMALLOC_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Declares ::ruby_xmalloc().
*/
-#ifndef RUBY3_XMALLOC_H
-#define RUBY3_XMALLOC_H
#include "ruby/3/config.h"
#ifdef STDC_HEADERS
diff --git a/include/ruby/assert.h b/include/ruby/assert.h
index 900ece8f40e..54a7618720a 100644
--- a/include/ruby/assert.h
+++ b/include/ruby/assert.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY_ASSERT_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY_ASSERT_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @date Wed May 18 00:21:44 JST 1994
@@ -18,8 +20,6 @@
* We assume C99 for ruby itself but we don't assume languages of
* extension libraries. They could be written in C++98.
*/
-#ifndef RUBY_ASSERT_H
-#define RUBY_ASSERT_H
#include "ruby/3/assume.h"
#include "ruby/3/attr/cold.h"
#include "ruby/3/attr/noreturn.h"
diff --git a/include/ruby/backward.h b/include/ruby/backward.h
index 04ce2b8c520..8380152db5f 100644
--- a/include/ruby/backward.h
+++ b/include/ruby/backward.h
@@ -1,5 +1,13 @@
-#ifndef RUBY_RUBY_BACKWARD_H
+#ifndef RUBY_RUBY_BACKWARD_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY_RUBY_BACKWARD_H 1
+/**
+ * @file
+ * @author Ruby developers <ruby-core@ruby-lang.org>
+ * @copyright This file is a part of the programming language Ruby.
+ * Permission is hereby granted, to either redistribute and/or
+ * modify this file, provided that the conditions mentioned in the
+ * file COPYING are met. Consult the file for details.
+ */
#include "ruby/3/core/rbasic.h"
#include "ruby/3/value.h"
#include "ruby/3/interpreter.h"
diff --git a/include/ruby/backward/2/assume.h b/include/ruby/backward/2/assume.h
index 2be231093b9..095a43876d9 100644
--- a/include/ruby/backward/2/assume.h
+++ b/include/ruby/backward/2/assume.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY_BACKWARD2_ASSUME_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY_BACKWARD2_ASSUME_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -37,3 +39,5 @@
# define RB_LIKELY(x) (x)
# define RB_UNLIKELY(x) (x)
#endif
+
+#endif /* RUBY_BACKWARD2_ASSUME_H */
diff --git a/include/ruby/backward/2/attributes.h b/include/ruby/backward/2/attributes.h
index 0735385292e..043646eb4b5 100644
--- a/include/ruby/backward/2/attributes.h
+++ b/include/ruby/backward/2/attributes.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY_BACKWARD2_ATTRIBUTES_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY_BACKWARD2_ATTRIBUTES_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -26,8 +28,6 @@
* - A: Don't know. Don't blame me. Backward compatibility is the key here.
* I'm just preserving what they have been.
*/
-#ifndef RUBY_BACKWARD2_ATTRIBUTES_H
-#define RUBY_BACKWARD2_ATTRIBUTES_H
#include "ruby/3/config.h"
#include "ruby/3/attr/alloc_size.h"
#include "ruby/3/attr/cold.h"
diff --git a/include/ruby/backward/2/bool.h b/include/ruby/backward/2/bool.h
index 8c619b82158..b2cca2a2064 100644
--- a/include/ruby/backward/2/bool.h
+++ b/include/ruby/backward/2/bool.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY_BACKWARD2_BOOL_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY_BACKWARD2_BOOL_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -31,3 +33,5 @@
#elif ! TRUE
# error TRUE must be true
#endif
+
+#endif /* RUBY_BACKWARD2_BOOL_H */
diff --git a/include/ruby/backward/2/extern.h b/include/ruby/backward/2/extern.h
index e7018342ea5..697c5930001 100644
--- a/include/ruby/backward/2/extern.h
+++ b/include/ruby/backward/2/extern.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY_BACKWARD2_EXTERN_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY_BACKWARD2_EXTERN_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -24,10 +26,7 @@
* @brief Synonym of #RUBY_EXTERN.
* @deprecated #EXTERN is deprecated, use #RUBY_EXTERN instead.
*/
-#ifdef EXTERN
-# /* Stop bothering then. */
-
-#elif defined __GNUC__
+#if defined __GNUC__
# define EXTERN \
_Pragma("message \"EXTERN is deprecated, use RUBY_EXTERN instead\""); \
RUBY_EXTERN
@@ -43,3 +42,5 @@
# define EXTERN <-<-"EXTERN is deprecated, use RUBY_EXTERN instead"->->
#endif
+
+#endif /* RUBY_BACKWARD2_EXTERN_H */
diff --git a/include/ruby/backward/2/gcc_version_since.h b/include/ruby/backward/2/gcc_version_since.h
index 4e2abc45f99..553b9821470 100644
--- a/include/ruby/backward/2/gcc_version_since.h
+++ b/include/ruby/backward/2/gcc_version_since.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY_BACKWARD2_GCC_VERSION_SINCE_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY_BACKWARD2_GCC_VERSION_SINCE_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -31,3 +33,5 @@
((RUBY3_COMPILER_VERSION_MINOR == (y)) && \
(RUBY3_COMPILER_VERSION_PATCH == (z))))))
#endif
+
+#endif /* RUBY_BACKWARD2_GCC_VERSION_SINCE_H */
diff --git a/include/ruby/backward/2/inttypes.h b/include/ruby/backward/2/inttypes.h
index 7e9b525a524..c6419bc7b36 100644
--- a/include/ruby/backward/2/inttypes.h
+++ b/include/ruby/backward/2/inttypes.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY_BACKWARD2_INTTYPES_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY_BACKWARD2_INTTYPES_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -126,3 +128,5 @@
# define PRIxSIZE PRI_SIZE_PREFIX"x"
# define PRIXSIZE PRI_SIZE_PREFIX"X"
#endif
+
+#endif /* RUBY_BACKWARD2_INTTYPES_H */
diff --git a/include/ruby/backward/2/limits.h b/include/ruby/backward/2/limits.h
index 28eb1596a95..f003d86057a 100644
--- a/include/ruby/backward/2/limits.h
+++ b/include/ruby/backward/2/limits.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY_BACKWARD2_LIMITS_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY_BACKWARD2_LIMITS_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -94,3 +96,5 @@
# define SSIZE_MAX SHRT_MAX
# define SSIZE_MIN SHRT_MIN
#endif
+
+#endif /* RUBY_BACKWARD2_LIMITS_H */
diff --git a/include/ruby/backward/2/long_long.h b/include/ruby/backward/2/long_long.h
index 29b930625e6..2a9b9e7f405 100644
--- a/include/ruby/backward/2/long_long.h
+++ b/include/ruby/backward/2/long_long.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY_BACKWARD2_LONG_LONG_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY_BACKWARD2_LONG_LONG_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -25,10 +27,7 @@
*/
#include "ruby/3/config.h"
-#if defined(LONG_LONG)
-# /* Take that. */
-
-#elif RUBY3_HAS_WARNING("-Wc++11-long-long")
+#if RUBY3_HAS_WARNING("-Wc++11-long-long")
# define HAVE_TRUE_LONG_LONG 1
# define LONG_LONG \
RUBY3_WARNING_PUSH() \
@@ -60,3 +59,5 @@
# error Remember to attach a detailed description of your environment.
# error Thank you!
#endif
+
+#endif /* RUBY3_BACKWARD2_LONG_LONG_H */
diff --git a/include/ruby/backward/2/r_cast.h b/include/ruby/backward/2/r_cast.h
index ed529c89689..15f5339227d 100644
--- a/include/ruby/backward/2/r_cast.h
+++ b/include/ruby/backward/2/r_cast.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY_BACKWARD2_R_CAST_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY_BACKWARD2_R_CAST_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -20,8 +22,6 @@
*
* Nobody is actively using this macro.
*/
-#ifndef RUBY_BACKWARD2_R_CAST_H
-#define RUBY_BACKWARD2_R_CAST_H
#define R_CAST(st) (struct st*)
#define RMOVED(obj) (R_CAST(RMoved)(obj))
#endif /* RUBY_BACKWARD2_R_CAST_H */
diff --git a/include/ruby/backward/2/rmodule.h b/include/ruby/backward/2/rmodule.h
index bb0fc047a6b..6b79636ac76 100644
--- a/include/ruby/backward/2/rmodule.h
+++ b/include/ruby/backward/2/rmodule.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY_BACKWARD2_RMODULE_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY_BACKWARD2_RMODULE_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -22,9 +24,8 @@
* who is implementing the internals) could have used those macros for a while.
* Kept public as-is here to keep some theoretical backwards compatibility.
*/
-#ifndef RMODULE_IV_TBL
#define RMODULE_IV_TBL(m) RCLASS_IV_TBL(m)
#define RMODULE_CONST_TBL(m) RCLASS_CONST_TBL(m)
#define RMODULE_M_TBL(m) RCLASS_M_TBL(m)
#define RMODULE_SUPER(m) RCLASS_SUPER(m)
-#endif
+#endif /* RUBY_BACKWARD2_RMODULE_H */
diff --git a/include/ruby/backward/2/stdalign.h b/include/ruby/backward/2/stdalign.h
index 2d970edc9d3..bdea030a41e 100644
--- a/include/ruby/backward/2/stdalign.h
+++ b/include/ruby/backward/2/stdalign.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY_BACKWARD2_STDALIGN_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY_BACKWARD2_STDALIGN_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -24,3 +26,5 @@
#undef RUBY_ALIGNOF
#define RUBY_ALIGNAS RUBY3_ALIGNAS
#define RUBY_ALIGNOF RUBY3_ALIGNOF
+
+#endif /* RUBY_BACKWARD2_STDALIGN_H */
diff --git a/include/ruby/backward/2/stdarg.h b/include/ruby/backward/2/stdarg.h
index 7b37bd45712..2270e66b77b 100644
--- a/include/ruby/backward/2/stdarg.h
+++ b/include/ruby/backward/2/stdarg.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY_BACKWARD2_STDARG_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY_BACKWARD2_STDARG_H
+/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@@ -41,3 +43,5 @@
#else
#define ANYARGS
#endif
+
+#endif /* RUBY_BACKWARD2_STDARG_H */
diff --git a/include/ruby/backward/classext.h b/include/ruby/backward/classext.h
index 9d5747316a7..61d05611bc0 100644
--- a/include/ruby/backward/classext.h
+++ b/include/ruby/backward/classext.h
@@ -1,12 +1,19 @@
+#ifndef RUBY_BACKWARD_CLASSEXT_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY_BACKWARD_CLASSEXT_H
+/**
+ * @file
+ * @author Ruby developers <ruby-core@ruby-lang.org>
+ * @copyright This file is a part of the programming language Ruby.
+ * Permission is hereby granted, to either redistribute and/or
+ * modify this file, provided that the conditions mentioned in the
+ * file COPYING are met. Consult the file for details.
+ */
#if defined __GNUC__
#warning use of RClass internals is deprecated
#elif defined _MSC_VER
#pragma message("warning: use of RClass internals is deprecated")
#endif
-#ifndef RUBY_BACKWARD_CLASSEXT_H
-#define RUBY_BACKWARD_CLASSEXT_H 1
-
typedef struct rb_deprecated_classext_struct {
VALUE super;
} rb_deprecated_classext_t;
@@ -15,4 +22,4 @@ typedef struct rb_deprecated_classext_struct {
#define RCLASS_EXT(c) ((rb_deprecated_classext_t *)RCLASS(c)->ptr)
#define RCLASS_SUPER(c) (RCLASS(c)->super)
-#endif /* RUBY_BACKWARD_CLASSEXT_H */
+#endif /* RUBY_BACKWARD_CLASSEXT_H */
diff --git a/include/ruby/backward/cxxanyargs.hpp b/include/ruby/backward/cxxanyargs.hpp
index 8fda5fe9065..c30ab46f433 100644
--- a/include/ruby/backward/cxxanyargs.hpp
+++ b/include/ruby/backward/cxxanyargs.hpp
@@ -1,4 +1,5 @@
-/// \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY_BACKWARD_CXXANYARGS_HPP //-*-C++-*-vi:ft=cpp
+#define RUBY_BACKWARD_CXXANYARGS_HPP
/// @file
/// @author \@shyouhei
/// @copyright This file is a part of the programming language Ruby.
@@ -9,8 +10,6 @@
/// meant to be a backwards compatibility shim. Please stick to
/// C++ 98 and never use newer features, like `constexpr`.
/// @brief Provides old prototypes for C++ programs.
-#ifndef RUBY_BACKWARD_CXXANYARGS_HPP
-#define RUBY_BACKWARD_CXXANYARGS_HPP
#include "ruby/3/config.h"
#include "ruby/3/intern/class.h"
#include "ruby/3/intern/cont.h"
diff --git a/include/ruby/backward/rubyio.h b/include/ruby/backward/rubyio.h
index a6e3a7c78bb..433f4259888 100644
--- a/include/ruby/backward/rubyio.h
+++ b/include/ruby/backward/rubyio.h
@@ -1,6 +1,18 @@
+#ifndef RUBY_BACKWARD_RUBYIO_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY_BACKWARD_RUBYIO_H
+/**
+ * @file
+ * @author Ruby developers <ruby-core@ruby-lang.org>
+ * @copyright This file is a part of the programming language Ruby.
+ * Permission is hereby granted, to either redistribute and/or
+ * modify this file, provided that the conditions mentioned in the
+ * file COPYING are met. Consult the file for details.
+ */
#if defined __GNUC__
#warning use "ruby/io.h" instead of "rubyio.h"
#elif defined _MSC_VER
#pragma message("warning: use \"ruby/io.h\" instead of \"rubyio.h\"")
#endif
#include "ruby/io.h"
+
+#endif /* RUBY_BACKWARD_RUBYIO_H */
diff --git a/include/ruby/backward/rubysig.h b/include/ruby/backward/rubysig.h
index 7a1ca35f200..b1645cdeb08 100644
--- a/include/ruby/backward/rubysig.h
+++ b/include/ruby/backward/rubysig.h
@@ -1,23 +1,20 @@
-/**********************************************************************
-
- rubysig.h -
-
- $Author$
- $Date$
- created at: Wed Aug 16 01:15:38 JST 1995
-
- Copyright (C) 1993-2008 Yukihiro Matsumoto
-
-**********************************************************************/
-
+#ifndef RUBYSIG_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBYSIG_H
+/**
+ * @file
+ * @author $Author$
+ * @date Wed Aug 16 01:15:38 JST 1995
+ * @copyright This file is a part of the programming language Ruby.
+ * Permission is hereby granted, to either redistribute and/or
+ * modify this file, provided that the conditions mentioned in the
+ * file COPYING are met. Consult the file for details.
+ */
#if defined __GNUC__
#warning rubysig.h is obsolete
#elif defined _MSC_VER
#pragma message("warning: rubysig.h is obsolete")
#endif
-#ifndef RUBYSIG_H
-#define RUBYSIG_H
#include "ruby/ruby.h"
#define RUBY_CRITICAL(statements) do {statements;} while (0)
@@ -26,4 +23,4 @@
#define ALLOW_INTS do {CHECK_INTS;} while (0)
#define CHECK_INTS rb_thread_check_ints()
-#endif
+#endif /* RUBYSIG_H */
diff --git a/include/ruby/backward/st.h b/include/ruby/backward/st.h
index 3e36d44cf82..ad627e5e992 100644
--- a/include/ruby/backward/st.h
+++ b/include/ruby/backward/st.h
@@ -1,6 +1,18 @@
+#ifndef RUBY_BACKWARD_ST_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY_BACKWARD_ST_H
+/**
+ * @file
+ * @author Ruby developers <ruby-core@ruby-lang.org>
+ * @copyright This file is a part of the programming language Ruby.
+ * Permission is hereby granted, to either redistribute and/or
+ * modify this file, provided that the conditions mentioned in the
+ * file COPYING are met. Consult the file for details.
+ */
#if defined __GNUC__
#warning use "ruby/st.h" instead of bare "st.h"
#elif defined _MSC_VER
#pragma message("warning: use \"ruby/st.h\" instead of bare \"st.h\"")
#endif
#include "ruby/st.h"
+
+#endif /* RUBY_BACKWARD_ST_H */
diff --git a/include/ruby/backward/util.h b/include/ruby/backward/util.h
index 11d32a2da88..1974fedbb57 100644
--- a/include/ruby/backward/util.h
+++ b/include/ruby/backward/util.h
@@ -1,6 +1,18 @@
+#ifndef RUBY_BACKWARD_UTIL_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY_BACKWARD_UTIL_H
+/**
+ * @file
+ * @author Ruby developers <ruby-core@ruby-lang.org>
+ * @copyright This file is a part of the programming language Ruby.
+ * Permission is hereby granted, to either redistribute and/or
+ * modify this file, provided that the conditions mentioned in the
+ * file COPYING are met. Consult the file for details.
+ */
#if defined __GNUC__
#warning use "ruby/util.h" instead of bare "util.h"
#elif defined _MSC_VER
#pragma message("warning: use \"ruby/util.h\" instead of bare \"util.h\"")
#endif
#include "ruby/util.h"
+
+#endif /* RUBY_BACKWARD_UTIL_H */
diff --git a/include/ruby/debug.h b/include/ruby/debug.h
index 0b0e82924b5..86e147cd6c3 100644
--- a/include/ruby/debug.h
+++ b/include/ruby/debug.h
@@ -1,19 +1,18 @@
-/**********************************************************************
-
- ruby/debug.h -
-
- $Author: ko1 $
- created at: Tue Nov 20 20:35:08 2012
-
- Copyright (C) 2012 Yukihiro Matsumoto
-
-**********************************************************************/
-
-#ifndef RB_DEBUG_H
+#ifndef RB_DEBUG_H /*-*-C++-*-vi:se ft=cpp:*/
#define RB_DEBUG_H 1
-
+/**
+ * @file
+ * @author $Author: ko1 $
+ * @date Tue Nov 20 20:35:08 2012
+ * @copyright Copyright (C) 2012 Yukihiro Matsumoto
+ * @copyright This file is a part of the programming language Ruby.
+ * Permission is hereby granted, to either redistribute and/or
+ * modify this file, provided that the conditions mentioned in the
+ * file COPYING are met. Consult the file for details.
+ */
#include "ruby/3/dllexport.h"
#include "ruby/3/event.h"
+#include "ruby/3/value.h"
RUBY3_SYMBOL_EXPORT_BEGIN()
diff --git a/include/ruby/defines.h b/include/ruby/defines.h
index 59eb3111546..0d5a9b2c22e 100644
--- a/include/ruby/defines.h
+++ b/include/ruby/defines.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY_DEFINES_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY_DEFINES_H 1
+/**
* @file
* @author $Author$
* @date Wed May 18 00:21:44 JST 1994
@@ -7,8 +9,6 @@
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
*/
-#ifndef RUBY_DEFINES_H
-#define RUBY_DEFINES_H 1
#include "ruby/3/config.h"
diff --git a/include/ruby/encoding.h b/include/ruby/encoding.h
index 334acb35dc3..79bf7fc60c3 100644
--- a/include/ruby/encoding.h
+++ b/include/ruby/encoding.h
@@ -1,17 +1,15 @@
-/**********************************************************************
-
- encoding.h -
-
- $Author: matz $
- created at: Thu May 24 11:49:41 JST 2007
-
- Copyright (C) 2007 Yukihiro Matsumoto
-
-**********************************************************************/
-
-#ifndef RUBY_ENCODING_H
+#ifndef RUBY_ENCODING_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY_ENCODING_H 1
-
+/**
+ * @file
+ * @author $Author: matz $
+ * @date Thu May 24 11:49:41 JST 2007
+ * @copyright Copyright (C) 2007 Yukihiro Matsumoto
+ * @copyright This file is a part of the programming language Ruby.
+ * Permission is hereby granted, to either redistribute and/or
+ * modify this file, provided that the conditions mentioned in the
+ * file COPYING are met. Consult the file for details.
+ */
#include "ruby/3/config.h"
#include <stdarg.h>
#include "ruby/ruby.h"
diff --git a/include/ruby/intern.h b/include/ruby/intern.h
index 7b583d48be4..60b7b450edd 100644
--- a/include/ruby/intern.h
+++ b/include/ruby/intern.h
@@ -1,19 +1,17 @@
-/**********************************************************************
-
- intern.h -
-
- $Author$
- created at: Thu Jun 10 14:22:17 JST 1993
-
- Copyright (C) 1993-2007 Yukihiro Matsumoto
- Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
- Copyright (C) 2000 Information-technology Promotion Agency, Japan
-
-**********************************************************************/
-
-#ifndef RUBY_INTERN_H
+#ifndef RUBY_INTERN_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY_INTERN_H 1
-
+/**
+ * @file
+ * @author $Author$
+ * @date Thu Jun 10 14:22:17 JST 1993
+ * @copyright Copyright (C) 1993-2007 Yukihiro Matsumoto
+ * @copyright Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
+ * @copyright Copyright (C) 2000 Information-technology Promotion Agency, Japan
+ * @copyright This file is a part of the programming language Ruby.
+ * Permission is hereby granted, to either redistribute and/or
+ * modify this file, provided that the conditions mentioned in the
+ * file COPYING are met. Consult the file for details.
+ */
#include "ruby/3/config.h"
#include "ruby/defines.h"
diff --git a/include/ruby/io.h b/include/ruby/io.h
index 5a80c762901..abf0d70c164 100644
--- a/include/ruby/io.h
+++ b/include/ruby/io.h
@@ -1,17 +1,15 @@
-/**********************************************************************
-
- rubyio.h -
-
- $Author$
- created at: Fri Nov 12 16:47:09 JST 1993
-
- Copyright (C) 1993-2007 Yukihiro Matsumoto
-
-**********************************************************************/
-
-#ifndef RUBY_IO_H
+#ifndef RUBY_IO_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY_IO_H 1
-
+/**
+ * @file
+ * @author $Author$
+ * @date Fri Nov 12 16:47:09 JST 1993
+ * @copyright Copyright (C) 1993-2007 Yukihiro Matsumoto
+ * @copyright This file is a part of the programming language Ruby.
+ * Permission is hereby granted, to either redistribute and/or
+ * modify this file, provided that the conditions mentioned in the
+ * file COPYING are met. Consult the file for details.
+ */
#include "ruby/3/config.h"
#include <stdio.h>
diff --git a/include/ruby/missing.h b/include/ruby/missing.h
index 4a5db6007a4..a2d82f07466 100644
--- a/include/ruby/missing.h
+++ b/include/ruby/missing.h
@@ -1,4 +1,6 @@
-/** \noop-*-C++-*-vi:ft=cpp
+#ifndef RUBY_MISSING_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY_MISSING_H 1
+/**
* @file
* @author $Author$
* @date Sat May 11 23:46:03 JST 2002
@@ -8,9 +10,6 @@
* file COPYING are met. Consult the file for details.
* @brief Prototype for *.c in ./missing, and for missing timeval struct.
*/
-#ifndef RUBY_MISSING_H
-#define RUBY_MISSING_H 1
-
#include "ruby/3/config.h"
#ifdef STDC_HEADERS
diff --git a/include/ruby/re.h b/include/ruby/re.h
index 67dbe7778ba..dc14799ae72 100644
--- a/include/ruby/re.h
+++ b/include/ruby/re.h
@@ -1,17 +1,15 @@
-/**********************************************************************
-
- re.h -
-
- $Author$
- created at: Thu Sep 30 14:18:32 JST 1993
-
- Copyright (C) 1993-2007 Yukihiro Matsumoto
-
-**********************************************************************/
-
-#ifndef RUBY_RE_H
+#ifndef RUBY_RE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY_RE_H 1
-
+/**
+ * @file
+ * @author $Author$
+ * @date Thu Sep 30 14:18:32 JST 1993
+ * @copyright Copyright (C) 1993-2007 Yukihiro Matsumoto
+ * @copyright This file is a part of the programming language Ruby.
+ * Permission is hereby granted, to either redistribute and/or
+ * modify this file, provided that the conditions mentioned in the
+ * file COPYING are met. Consult the file for details.
+ */
#include "ruby/3/config.h"
#include <sys/types.h>
#include <stdio.h>
diff --git a/include/ruby/regex.h b/include/ruby/regex.h
index 024bed4a4e0..22dae3231da 100644
--- a/include/ruby/regex.h
+++ b/include/ruby/regex.h
@@ -1,16 +1,14 @@
-/**********************************************************************
-
- regex.h -
-
- $Author$
-
- Copyright (C) 1993-2007 Yukihiro Matsumoto
-
-**********************************************************************/
-
-#ifndef ONIGURUMA_REGEX_H
+#ifndef ONIGURUMA_REGEX_H /*-*-C++-*-vi:se ft=cpp:*/
#define ONIGURUMA_REGEX_H 1
-
+/**
+ * @file
+ * @author $Author$
+ * @copyright Copyright (C) 1993-2007 Yukihiro Matsumoto
+ * @copyright This file is a part of the programming language Ruby.
+ * Permission is hereby granted, to either redistribute and/or
+ * modify this file, provided that the conditions mentioned in the
+ * file COPYING are met. Consult the file for details.
+ */
#if defined(__cplusplus)
extern "C" {
#if 0
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index 2371425c355..573dc19889a 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -1,19 +1,17 @@
-/**********************************************************************
-
- ruby/ruby.h -
-
- $Author$
- created at: Thu Jun 10 14:26:32 JST 1993
-
- Copyright (C) 1993-2008 Yukihiro Matsumoto
- Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
- Copyright (C) 2000 Information-technology Promotion Agency, Japan
-
-**********************************************************************/
-
-#ifndef RUBY_RUBY_H
+#ifndef RUBY_RUBY_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY_RUBY_H 1
-
+/**
+ * @file
+ * @author $Author$
+ * @date Thu Jun 10 14:26:32 JST 1993
+ * @copyright Copyright (C) 1993-2008 Yukihiro Matsumoto
+ * @copyright Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
+ * @copyright Copyright (C) 2000 Information-technology Promotion Agency, Japan
+ * @copyright This file is a part of the programming language Ruby.
+ * Permission is hereby granted, to either redistribute and/or
+ * modify this file, provided that the conditions mentioned in the
+ * file COPYING are met. Consult the file for details.
+ */
#include "ruby/3/config.h"
#ifdef HAVE_INTRINSICS_H
diff --git a/include/ruby/subst.h b/include/ruby/subst.h
index 1f0e6db5a45..cf48a3909c3 100644
--- a/include/ruby/subst.h
+++ b/include/ruby/subst.h
@@ -1,5 +1,13 @@
-#ifndef RUBY_SUBST_H
+#ifndef RUBY_SUBST_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY_SUBST_H 1
+/**
+ * @file
+ * @author Ruby developers <ruby-core@ruby-lang.org>
+ * @copyright This file is a part of the programming language Ruby.
+ * Permission is hereby granted, to either redistribute and/or
+ * modify this file, provided that the conditions mentioned in the
+ * file COPYING are met. Consult the file for details.
+ */
#undef snprintf
#undef vsnprintf
diff --git a/include/ruby/thread.h b/include/ruby/thread.h
index 95e2c07ee57..8ff3ae77aa7 100644
--- a/include/ruby/thread.h
+++ b/include/ruby/thread.h
@@ -1,17 +1,15 @@
-/**********************************************************************
-
- thread.h -
-
- $Author: matz $
- created at: Tue Jul 10 17:35:43 JST 2012
-
- Copyright (C) 2007 Yukihiro Matsumoto
-
-**********************************************************************/
-
-#ifndef RUBY_THREAD_H
+#ifndef RUBY_THREAD_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY_THREAD_H 1
-
+/**
+ * @file
+ * @author $Author: matz $
+ * @date Tue Jul 10 17:35:43 JST 2012
+ * @copyright Copyright (C) 2007 Yukihiro Matsumoto
+ * @copyright This file is a part of the programming language Ruby.
+ * Permission is hereby granted, to either redistribute and/or
+ * modify this file, provided that the conditions mentioned in the
+ * file COPYING are met. Consult the file for details.
+ */
#include "ruby/intern.h"
#include "ruby/3/dllexport.h"
diff --git a/include/ruby/thread_native.h b/include/ruby/thread_native.h
index 92405a6e886..0285c8ff40f 100644
--- a/include/ruby/thread_native.h
+++ b/include/ruby/thread_native.h
@@ -1,16 +1,15 @@
-/**********************************************************************
-
- thread_native.h -
-
- $Author: ko1 $
- created at: Wed May 14 19:37:31 2014
-
- Copyright (C) 2014 Yukihiro Matsumoto
-
-**********************************************************************/
-
-#ifndef RUBY_THREAD_NATIVE_H
+#ifndef RUBY_THREAD_NATIVE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY_THREAD_NATIVE_H 1
+/**
+ * @file
+ * @author $Author: ko1 $
+ * @date Wed May 14 19:37:31 2014
+ * @copyright Copyright (C) 2014 Yukihiro Matsumoto
+ * @copyright This file is a part of the programming language Ruby.
+ * Permission is hereby granted, to either redistribute and/or
+ * modify this file, provided that the conditions mentioned in the
+ * file COPYING are met. Consult the file for details.
+ */
/*
* This file contains wrapper APIs for native thread primitives
diff --git a/include/ruby/util.h b/include/ruby/util.h
index d5c735c97ec..ff089bb426b 100644
--- a/include/ruby/util.h
+++ b/include/ruby/util.h
@@ -1,17 +1,15 @@
-/**********************************************************************
-
- util.h -
-
- $Author$
- created at: Thu Mar 9 11:55:53 JST 1995
-
- Copyright (C) 1993-2007 Yukihiro Matsumoto
-
-**********************************************************************/
-
-#ifndef RUBY_UTIL_H
+#ifndef RUBY_UTIL_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY_UTIL_H 1
-
+/**
+ * @file
+ * @author $Author$
+ * @date Thu Mar 9 11:55:53 JST 1995
+ * @copyright Copyright (C) 1993-2007 Yukihiro Matsumoto
+ * @copyright This file is a part of the programming language Ruby.
+ * Permission is hereby granted, to either redistribute and/or
+ * modify this file, provided that the conditions mentioned in the
+ * file COPYING are met. Consult the file for details.
+ */
#include "ruby/3/config.h"
#include "ruby/3/dllexport.h"
#include "ruby/defines.h"
diff --git a/include/ruby/version.h b/include/ruby/version.h
index c560021b75c..588e32021ed 100644
--- a/include/ruby/version.h
+++ b/include/ruby/version.h
@@ -1,17 +1,17 @@
-/**********************************************************************
-
- ruby/version.h -
-
- $Author$
- created at: Wed May 13 12:56:56 JST 2009
-
- Copyright (C) 1993-2009 Yukihiro Matsumoto
- Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
- Copyright (C) 2000 Information-technology Promotion Agency, Japan
-
-**********************************************************************/
-
-/*
+#ifndef RUBY_VERSION_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RUBY_VERSION_H 1
+/**
+ * @file
+ * @author $Author$
+ * @date Wed May 13 12:56:56 JST 2009
+ * @copyright Copyright (C) 1993-2009 Yukihiro Matsumoto
+ * @copyright Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
+ * @copyright Copyright (C) 2000 Information-technology Promotion Agency, Japan
+ * @copyright This file is a part of the programming language Ruby.
+ * Permission is hereby granted, to either redistribute and/or
+ * modify this file, provided that the conditions mentioned in the
+ * file COPYING are met. Consult the file for details.
+ *
* This file contains only
* - never-changeable information, and
* - interfaces accessible from extension libraries.
@@ -20,9 +20,6 @@
* check the features with mkmf.rb instead.
*/
-#ifndef RUBY_VERSION_H
-#define RUBY_VERSION_H 1
-
/* The origin. */
#define RUBY_AUTHOR "Yukihiro Matsumoto"
#define RUBY_BIRTH_YEAR 1993
diff --git a/include/ruby/vm.h b/include/ruby/vm.h
index 10f62249851..79d0b6c8460 100644
--- a/include/ruby/vm.h
+++ b/include/ruby/vm.h
@@ -1,17 +1,15 @@
-/**********************************************************************
-
- ruby/vm.h -
-
- $Author$
- created at: Sat May 31 15:17:36 2008
-
- Copyright (C) 2008 Yukihiro Matsumoto
-
-**********************************************************************/
-
-#ifndef RUBY_VM_H
+#ifndef RUBY_VM_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY_VM_H 1
-
+/**
+ * @file
+ * @author $Author$
+ * @date Sat May 31 15:17:36 2008
+ * @copyright Copyright (C) 2008 Yukihiro Matsumoto
+ * @copyright This file is a part of the programming language Ruby.
+ * Permission is hereby granted, to either redistribute and/or
+ * modify this file, provided that the conditions mentioned in the
+ * file COPYING are met. Consult the file for details.
+ */
#include "ruby/3/dllexport.h"
RUBY3_SYMBOL_EXPORT_BEGIN()