Skip to content

Commit

Permalink
Revert changes to DIGIT size, have to change RBIGNUM_LEN
Browse files Browse the repository at this point in the history
  • Loading branch information
dbussink committed Nov 13, 2012
1 parent f0750d1 commit 9d5fed1
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions vm/capi/19/include/ruby/ruby.h
Expand Up @@ -950,12 +950,27 @@ VALUE rb_uint2big(unsigned long number);
#define RBIGNUM_POSITIVE_P(b) RBIGNUM_SIGN(b)
#define RBIGNUM_NEGATIVE_P(b) (!RBIGNUM_SIGN(b))

// fake out, used with RBIGNUM_LEN anyway, which provides
// the full answer
#define SIZEOF_BDIGITS 1
#define BDIGIT_DBL unsigned short
#define BDIGIT_DBL_SIGNED short
#define BDIGIT unsigned char
#if SIZEOF_INT*2 <= SIZEOF_LONG_LONG
# define BDIGIT unsigned int
# define SIZEOF_BDIGITS SIZEOF_INT
# define BDIGIT_DBL unsigned LONG_LONG
# define BDIGIT_DBL_SIGNED LONG_LONG
#elif SIZEOF_INT*2 <= SIZEOF_LONG
# define BDIGIT unsigned int
# define SIZEOF_BDIGITS SIZEOF_INT
# define BDIGIT_DBL unsigned long
# define BDIGIT_DBL_SIGNED long
#elif SIZEOF_SHORT*2 <= SIZEOF_LONG
# define BDIGIT unsigned short
# define SIZEOF_BDIGITS SIZEOF_SHORT
# define BDIGIT_DBL unsigned long
# define BDIGIT_DBL_SIGNED long
#else
# define BDIGIT unsigned short
# define SIZEOF_BDIGITS (SIZEOF_LONG/2)
# define BDIGIT_DBL unsigned long
# define BDIGIT_DBL_SIGNED long
#endif

/** Calls this method in a superclass. */
VALUE rb_call_super(int argc, const VALUE *argv);
Expand Down

0 comments on commit 9d5fed1

Please sign in to comment.