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

ruby-changes:62846

From: Samuel <ko1@a...>
Date: Sun, 6 Sep 2020 12:38:13 +0900 (JST)
Subject: [ruby-changes:62846] c12b2703bc (master): Add `RB_` prefix for size_t to number conversion.

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

From c12b2703bc05f8c7eaaace49253f63a5e0f28273 Mon Sep 17 00:00:00 2001
From: Samuel Williams <samuel.williams@o...>
Date: Wed, 26 Aug 2020 09:06:09 +1200
Subject: Add `RB_` prefix for size_t to number conversion.


diff --git a/include/ruby/internal/arithmetic/size_t.h b/include/ruby/internal/arithmetic/size_t.h
index 8341c80..0458f1f 100644
--- a/include/ruby/internal/arithmetic/size_t.h
+++ b/include/ruby/internal/arithmetic/size_t.h
@@ -27,25 +27,30 @@ https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/arithmetic/size_t.h#L27
 #include "ruby/backward/2/long_long.h"
 
 #if SIZEOF_SIZE_T == SIZEOF_LONG_LONG
-# define SIZET2NUM  RB_ULL2NUM
-# define SSIZET2NUM RB_LL2NUM
+# define RB_SIZE2NUM RB_ULL2NUM
+# define RB_SSIZE2NUM RB_LL2NUM
 #elif SIZEOF_SIZE_T == SIZEOF_LONG
-# define SIZET2NUM  RB_ULONG2NUM
-# define SSIZET2NUM RB_LONG2NUM
+# define RB_SIZE2NUM RB_ULONG2NUM
+# define RB_SSIZE2NUM RB_LONG2NUM
 #else
-# define SIZET2NUM  RB_UINT2NUM
-# define SSIZET2NUM RB_INT2NUM
+# define RB_SIZE2NUM RB_UINT2NUM
+# define RB_SSIZE2NUM RB_INT2NUM
 #endif
 
 #if SIZEOF_SIZE_T == SIZEOF_LONG_LONG
-# define NUM2SIZET  RB_NUM2ULL
-# define NUM2SSIZET RB_NUM2LL
+# define RB_NUM2SIZE RB_NUM2ULL
+# define RB_NUM2SSIZE RB_NUM2LL
 #elif SIZEOF_SIZE_T == SIZEOF_LONG
-# define NUM2SIZET  RB_NUM2ULONG
-# define NUM2SSIZET RB_NUM2LONG
+# define RB_NUM2SIZE RB_NUM2ULONG
+# define RB_NUM2SSIZE RB_NUM2LONG
 #else
-# define NUM2SIZET  RB_NUM2UINT
-# define NUM2SSIZET RB_NUM2INT
+# define RB_NUM2SIZE RB_NUM2UINT
+# define RB_NUM2SSIZE RB_NUM2INT
 #endif
 
+#define NUM2SIZET RB_NUM2SIZE
+#define SIZET2NUM RB_SIZE2NUM
+#define NUM2SSIZET RB_NUM2SSIZE
+#define SSIZET2NUM RB_SSIZE2NUM
+
 #endif /* RBIMPL_ARITHMETIC_SIZE_T_H */
-- 
cgit v0.10.2


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

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