summaryrefslogtreecommitdiff
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2019-12-02 14:58:43 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2019-12-26 20:45:12 +0900
commit0958e19ffb047781fe1506760c7cbd8d7fe74e57 (patch)
treeca20d9181667d746c6df55c63f595980e9a77fbc /vm_insnhelper.c
parent863dbb21d8912c73e84fed47f2d3a1ac5d8275d4 (diff)
add several __has_something macro
With these macros implemented we can write codes just like we can assume the compiler being clang. MSC_VERSION_SINCE is defined to implement those macros, but turned out to be handy for other places. The -fdeclspec compiler flag is necessary for clang to properly handle __has_declspec().
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/2711
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 2ac006a605..0cd4bdefe9 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -1424,11 +1424,9 @@ vm_expandarray(VALUE *sp, VALUE ary, rb_num_t num, int flag)
static VALUE vm_call_general(rb_execution_context_t *ec, rb_control_frame_t *reg_cfp, struct rb_calling_info *calling, struct rb_call_data *cd);
-#ifdef __has_attribute
#if __has_attribute(artificial)
__attribute__((__artificial__))
#endif
-#endif
static inline vm_call_handler
calccall(const struct rb_call_data *cd, const rb_callable_method_entry_t *me)
{
@@ -1817,7 +1815,7 @@ check_match(rb_execution_context_t *ec, VALUE pattern, VALUE target, enum vm_che
}
-#if defined(_MSC_VER) && _MSC_VER < 1300
+#if MSC_VERSION_BEFORE(1300)
#define CHECK_CMP_NAN(a, b) if (isnan(a) || isnan(b)) return Qfalse;
#else
#define CHECK_CMP_NAN(a, b) /* do nothing */