diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-12-24 16:16:20 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-12-24 16:22:50 +0900 |
commit | b343d547923cf29456910b20fcd1c0a58ed68176 (patch) | |
tree | 137bafe17792846eaa98176ea8f463ee8257697f /include | |
parent | a76082f499ef819a18a0426973ea531019df4e0a (diff) |
Use RBIMPL_COMPILER_{SINCE,BEFORE} for MSVC
Pointed out by @shyouhei.
NOTE: Already we have dropped the support for older MSVCs,
probably prior to 1300 or 1400. Remove the conditional code,
especially in win32/Makefile.sub.
Diffstat (limited to 'include')
-rw-r--r-- | include/ruby/atomic.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/ruby/atomic.h b/include/ruby/atomic.h index 39006bc107..a898c30ddf 100644 --- a/include/ruby/atomic.h +++ b/include/ruby/atomic.h @@ -36,7 +36,7 @@ typedef unsigned int rb_atomic_t; /* Anything OK */ # define RUBY_ATOMIC_GENERIC_MACRO 1 #elif defined _WIN32 -#if MSC_VERSION_SINCE(1300) +#if RBIMPL_COMPILER_SINCE(MSVC, 13, 0, 0) #pragma intrinsic(_InterlockedOr) #endif typedef LONG rb_atomic_t; @@ -48,7 +48,7 @@ typedef LONG rb_atomic_t; # define RUBY_ATOMIC_FETCH_SUB(var, val) InterlockedExchangeAdd(&(var), -(LONG)(val)) #if defined __GNUC__ # define RUBY_ATOMIC_OR(var, val) __asm__("lock\n\t" "orl\t%1, %0" : "=m"(var) : "Ir"(val)) -#elif MSC_VERSION_BEFORE(1300) +#elif RBIMPL_COMPILER_BEFORE(MSVC, 13, 0, 0) # define RUBY_ATOMIC_OR(var, val) rb_w32_atomic_or(&(var), (val)) static inline void rb_w32_atomic_or(volatile rb_atomic_t *var, rb_atomic_t val) @@ -66,7 +66,7 @@ rb_w32_atomic_or(volatile rb_atomic_t *var, rb_atomic_t val) #endif # define RUBY_ATOMIC_EXCHANGE(var, val) InterlockedExchange(&(var), (val)) # define RUBY_ATOMIC_CAS(var, oldval, newval) InterlockedCompareExchange(&(var), (newval), (oldval)) -# if MSC_VERSION_BEFORE(1300) +# if RBIMPL_COMPILER_BEFORE(MSVC, 13, 0, 0) static inline rb_atomic_t rb_w32_atomic_cas(volatile rb_atomic_t *var, rb_atomic_t oldval, rb_atomic_t newval) { |