[前][次][番号順一覧][スレッド一覧]

ruby-changes:59931

From: =E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3 <ko1@a...>
Date: Thu, 6 Feb 2020 11:47:15 +0900 (JST)
Subject: [ruby-changes:59931] 34fd7241e4 (master): fine-grained #ifdef guard for Sparc systems

https://git.ruby-lang.org/ruby.git/commit/?id=34fd7241e4

From 34fd7241e445764837ec9fc700af65a0f73e8ce5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?=
 <shyouhei@r...>
Date: Fri, 31 Jan 2020 15:07:40 +0900
Subject: fine-grained #ifdef guard for Sparc systems

There are cases when sizeof(int) == sizeof(long) == sizeof(size_t).  On
such cases however int and long are incompatible types in theory.  We
should not assume typedef long size_t, because on Solaris size_t is
actually a typedef of int.

This reduces compiler warnings on such situations.

diff --git a/ruby_atomic.h b/ruby_atomic.h
index 4a6723a..d4d56da 100644
--- a/ruby_atomic.h
+++ b/ruby_atomic.h
@@ -105,7 +105,7 @@ typedef unsigned int rb_atomic_t; https://github.com/ruby/ruby/blob/trunk/ruby_atomic.h#L105
 # define ATOMIC_EXCHANGE(var, val) atomic_swap_uint(&(var), (val))
 # define ATOMIC_CAS(var, oldval, newval) atomic_cas_uint(&(var), (oldval), (newval))
 
-# if SIZEOF_SIZE_T == SIZEOF_LONG
+# if defined(_LP64) || defined(_I32LPx)
 #  define ATOMIC_SIZE_ADD(var, val) atomic_add_long(&(var), (val))
 #  define ATOMIC_SIZE_SUB(var, val) atomic_add_long(&(var), -(val))
 #  define ATOMIC_SIZE_INC(var) atomic_inc_ulong(&(var))
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]