summaryrefslogtreecommitdiff
path: root/include/ruby/internal/attr/forceinline.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/ruby/internal/attr/forceinline.h')
-rw-r--r--include/ruby/internal/attr/forceinline.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/include/ruby/internal/attr/forceinline.h b/include/ruby/internal/attr/forceinline.h
new file mode 100644
index 0000000000..b7daafede7
--- /dev/null
+++ b/include/ruby/internal/attr/forceinline.h
@@ -0,0 +1,40 @@
+#ifndef RBIMPL_ATTR_FORCEINLINE_H /*-*-C++-*-vi:se ft=cpp:*/
+#define RBIMPL_ATTR_FORCEINLINE_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.
+ * @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
+ * implementation details. Don't take them as canon. They could
+ * rapidly appear then vanish. The name (path) of this header file
+ * is also an implementation detail. Do not expect it to persist
+ * at the place it is now. Developers are free to move it anywhere
+ * anytime at will.
+ * @note To ruby-core: remember that this header can be possibly
+ * recursively included from extension libraries written in C++.
+ * 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 Defines #RBIMPL_ATTR_FORCEINLINE.
+ */
+#include "ruby/internal/compiler_since.h"
+#include "ruby/internal/has/attribute.h"
+
+/**
+ * Wraps (or simulates) `__forceinline`. MSVC complains on declarations like
+ * `static inline __forceinline void foo()`. It seems MSVC's `inline` and
+ * `__forceinline` are mutually exclusive. We have to mimic that behaviour for
+ * non-MSVC compilers.
+ */
+#if RBIMPL_COMPILER_SINCE(MSVC, 12, 0, 0)
+# define RBIMPL_ATTR_FORCEINLINE() __forceinline
+#elif RBIMPL_HAS_ATTRIBUTE(always_inline)
+# define RBIMPL_ATTR_FORCEINLINE() __attribute__((__always_inline__)) inline
+#else
+# define RBIMPL_ATTR_FORCEINLINE() inline
+#endif
+
+#endif /* RBIMPL_ATTR_FORCEINLINE_H */
3' class='logmsg'> * minitest 5.10.3 * test-unit 3.2.5 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e 2017-08-19gems/bundled_gems: Update to power_assert 1.1.0ktsj git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59623 b2dd03c8-39d4-4d8f-98ff-823fe69b080e 2017-06-09Update bundled gems to latest versions.hsbt * did_you_mean 1.1.2 * minitest 5.10.2 * xmlrpc 0.3.0 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e 2017-05-23Use test-unit 3.2.4kou git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e 2017-05-04gems/bundled_gems: Update to power_assert 1.0.2ktsj git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e 2017-02-15Update gems/bundled_gemsnobu git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57636 b2dd03c8-39d4-4d8f-98ff-823fe69b080e 2016-12-22Update xmlrpc-0.2.1 for Ruby 2.4.0 release.hsbt git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e 2016-12-20* gems/bundled_gems: Upgrade the did_you_mean gem to 1.1.0yuki git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e 2016-12-06Update latest bundled gems.hsbt * Rake 12.0.0 * minitest 5.10.1 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e 2016-12-01Update bundled_gemshsbt * minitest-5.10.0 * test-unit-3.2.3 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e 2016-11-27gems/bundled_gems: Update to power_assert 0.4.1ktsj git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e 2016-09-26minitest-5.9.1nobu * gems/bundled_gems: update to minitest-5.9.1. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e 2016-09-20* gems/bundled_gems: Update rake-11.3.0hsbt git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e 2016-09-19bundled_gems: minitest certificate expirednobu * gems/bundled_gems: certificate of minitest-5.9.0 has expired. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e 2016-09-09* gems/bundled_gems: sort lines.kazu git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e 2016-09-08Unbundle tknaruse git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e 2016-09-07* gems/bundled_gems: update to power_assert 0.3.1.ktsj git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e 2016-08-18* gems/bundled_gems: bump to test-unit-3.2.1hsbt git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55954 b2dd03c8-39d4-4d8f-98ff-823fe69b080e 2016-08-17bump up tknobu * gems/bundled_gems (tk): bump up to 0.1.1. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e 2016-08-14gems: tk 0.1.0nobu * gems/bundled_gems: add gemified tk 0.1.0. this needs `extract-gems` to build. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e 2016-07-15* gems/bundled_gems: update latest gems.hsbt git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e 2016-05-28* gems/bundled_gems: Update latest releases, power_assert-0.3.0,hsbt test-unit 3.1.9, minitest 5.9.0, did_you_mean 1.0.1 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e 2016-05-16* gems/bundled_gems: Update xmlrpc-0.1.1. xmlrpc-0.1.0 didn't allowhsbt to install on 2.4.0dev. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e 2016-05-16* lib/xmlrpc.rb, lib/xmlrpc/*, test/xmlrpc: XMLRPC is bundled gemhsbt on Ruby 2.4. [Feature #12160][ruby-core:74239] * gems/bundled_gems: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e 2016-04-29* gems/bundled_gems: Update latest gems, test-unit-3.1.8 and rake-11.1.2.hsbt git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e 2016-01-30update bundled gemsnobu git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e 2015-12-22* gems/bundled_gems: Upgrade the did_you_mean gem to 1.0.0yuki * NEWS: Add news about the did_you_mean gem git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e 2015-12-08gems/bundled_gems: Upgrade the did_you_mean gem to 1.0.0.rc1yuki git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e 2015-11-23* gems/bundled_gems: bump version to minitest-5.8.3hsbt git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e 2015-11-09* gems/bundled_gems: update to power_assert 0.2.6.ktsj git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52506 b2dd03c8-39d4-4d8f-98ff-823fe69b080e 2015-11-09* gems/bundled_gems: Upgrade the did_you_mean gem to 1.0.0.beta3yuki git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52503 b2dd03c8-39d4-4d8f-98ff-823fe69b080e 2015-10-30* gems/bundled_gems: update to power_assert 0.2.5.ktsj git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52393 b2dd03c8-39d4-4d8f-98ff-823fe69b080e 2015-10-30* gems/bundled_gems: update latest gems.hsbt test-unit-3.1.5 and minitest-5.8.2 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e 2015-09-25* gems/bundled_gems: upgrade to minitest-5.8.1hsbt git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51933 b2dd03c8-39d4-4d8f-98ff-823fe69b080e