summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-23 15:44:34 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-23 15:44:34 +0000
commit4efba669ece01e2b800dba55ee9fe235f9a0bb45 (patch)
treef78bcccf3eb5667bfef801336bca40e1ed75dc0f /include
parentb28608f780191497e91e53f50bec439e144e0f19 (diff)
ruby.h: define RBIGNUM_EMBED_LEN_MAX by macros
* include/ruby/ruby.h (RBIGNUM_EMBED_LEN_MAX): define by macros defined in defines.h, instead of complex and repeated expression. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include')
-rw-r--r--include/ruby/ruby.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index 35a647110a..66ef47c464 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -1069,9 +1069,11 @@ struct RStruct {
#define RBIGNUM_EMBED_LEN_NUMBITS 3
#ifndef RBIGNUM_EMBED_LEN_MAX
-# define RBIGNUM_EMBED_LEN_MAX \
- (((int)((sizeof(VALUE)*3)/sizeof(BDIGIT))) < (1 << RBIGNUM_EMBED_LEN_NUMBITS)-1 ? \
- ((int)((sizeof(VALUE)*3)/sizeof(BDIGIT))) : (1 << RBIGNUM_EMBED_LEN_NUMBITS)-1)
+# if (SIZEOF_VALUE*3/SIZEOF_BDIGITS) < (1 << RBIGNUM_EMBED_LEN_NUMBITS)-1
+# define RBIGNUM_EMBED_LEN_MAX (SIZEOF_VALUE*3/SIZEOF_BDIGITS)
+# else
+# define RBIGNUM_EMBED_LEN_MAX ((1 << RBIGNUM_EMBED_LEN_NUMBITS)-1)
+# endif
#endif
struct RBignum {
struct RBasic basic;