mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* include/ruby/defines.h (SIZEOF_ACTUAL_BDIGIT): Defined.
* include/ruby/ruby.h (RBIGNUM_EMBED_LEN_MAX): Use SIZEOF_ACTUAL_BDIGIT instead of SIZEOF_BDIGITS. SIZEOF_BDIGITS can be different to sizeof(BDIGIT). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43829 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8835b1fb8a
commit
0224b515a8
3 changed files with 14 additions and 2 deletions
|
|
@ -1,3 +1,11 @@
|
||||||
|
Sun Nov 24 18:13:23 2013 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* include/ruby/defines.h (SIZEOF_ACTUAL_BDIGIT): Defined.
|
||||||
|
|
||||||
|
* include/ruby/ruby.h (RBIGNUM_EMBED_LEN_MAX): Use
|
||||||
|
SIZEOF_ACTUAL_BDIGIT instead of SIZEOF_BDIGITS.
|
||||||
|
SIZEOF_BDIGITS can be different to sizeof(BDIGIT).
|
||||||
|
|
||||||
Sun Nov 24 13:49:08 2013 Tanaka Akira <akr@fsij.org>
|
Sun Nov 24 13:49:08 2013 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* include/ruby/defines.h: Don't use int128_t for Bignum.
|
* include/ruby/defines.h: Don't use int128_t for Bignum.
|
||||||
|
|
|
||||||
|
|
@ -168,12 +168,16 @@ void xfree(void*);
|
||||||
# else
|
# else
|
||||||
# define BDIGIT unsigned short
|
# define BDIGIT unsigned short
|
||||||
# define SIZEOF_BDIGITS (SIZEOF_LONG/2)
|
# define SIZEOF_BDIGITS (SIZEOF_LONG/2)
|
||||||
|
# define SIZEOF_ACTUAL_BDIGIT SIZEOF_LONG
|
||||||
# define BDIGIT_DBL unsigned long
|
# define BDIGIT_DBL unsigned long
|
||||||
# define BDIGIT_DBL_SIGNED long
|
# define BDIGIT_DBL_SIGNED long
|
||||||
# define PRI_BDIGIT_PREFIX "h"
|
# define PRI_BDIGIT_PREFIX "h"
|
||||||
# define PRI_BDIGIT_DBL_PREFIX "l"
|
# define PRI_BDIGIT_DBL_PREFIX "l"
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef SIZEOF_ACTUAL_BDIGIT
|
||||||
|
# define SIZEOF_ACTUAL_BDIGIT SIZEOF_BDIGITS
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef PRI_BDIGIT_PREFIX
|
#ifdef PRI_BDIGIT_PREFIX
|
||||||
# define PRIdBDIGIT PRI_BDIGIT_PREFIX"d"
|
# define PRIdBDIGIT PRI_BDIGIT_PREFIX"d"
|
||||||
|
|
|
||||||
|
|
@ -1069,8 +1069,8 @@ struct RStruct {
|
||||||
|
|
||||||
#define RBIGNUM_EMBED_LEN_NUMBITS 3
|
#define RBIGNUM_EMBED_LEN_NUMBITS 3
|
||||||
#ifndef RBIGNUM_EMBED_LEN_MAX
|
#ifndef RBIGNUM_EMBED_LEN_MAX
|
||||||
# if (SIZEOF_VALUE*3/SIZEOF_BDIGITS) < (1 << RBIGNUM_EMBED_LEN_NUMBITS)-1
|
# if (SIZEOF_VALUE*3/SIZEOF_ACTUAL_BDIGIT) < (1 << RBIGNUM_EMBED_LEN_NUMBITS)-1
|
||||||
# define RBIGNUM_EMBED_LEN_MAX (SIZEOF_VALUE*3/SIZEOF_BDIGITS)
|
# define RBIGNUM_EMBED_LEN_MAX (SIZEOF_VALUE*3/SIZEOF_ACTUAL_BDIGIT)
|
||||||
# else
|
# else
|
||||||
# define RBIGNUM_EMBED_LEN_MAX ((1 << RBIGNUM_EMBED_LEN_NUMBITS)-1)
|
# define RBIGNUM_EMBED_LEN_MAX ((1 << RBIGNUM_EMBED_LEN_NUMBITS)-1)
|
||||||
# endif
|
# endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue