From 997b69cb6ac9eb97ea644276f1af886a49c1de03 Mon Sep 17 00:00:00 2001 From: matz Date: Thu, 14 Mar 2002 06:23:46 +0000 Subject: * re.c (rb_reg_match): should clear $~ if operand is nil. * re.c (rb_reg_match2): ditto. * configure: merge Jonathan Baker's large file support patch [ruby-talk:35316], with read_all patch in [ruby-talk:35470]. * eval.c (rb_f_abort): optional message argument that be printed on termination. [new] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2200 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ruby.h | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'ruby.h') diff --git a/ruby.h b/ruby.h index c406d6b07a..a399511f59 100644 --- a/ruby.h +++ b/ruby.h @@ -85,6 +85,24 @@ typedef unsigned long ID; # endif #endif +#if HAVE_LONG_LONG +# ifndef LLONG_MAX +# ifdef LONG_LONG_MAX +# define LLONG_MAX LONG_LONG_MAX +# else + /* assuming 64bit(2's complement) long long */ +# define LLONG_MAX 9223372036854775807LL +# endif +# endif +# ifndef LLONG_MIN +# ifdef LONG_LONG_MIN +# define LLONG_MIN LONG_LONG_MIN +# else +# define LLONG_MIN (-LLONG_MAX-1) +# endif +# endif +#endif + #define FIXNUM_MAX (LONG_MAX>>1) #define FIXNUM_MIN RSHIFT((long)LONG_MIN,1) @@ -101,6 +119,19 @@ VALUE rb_uint2inum _((unsigned long)); #define ULONG2NUM(v) UINT2NUM(v) #define rb_uint_new(v) rb_uint2inum(v) +#if HAVE_LONG_LONG +VALUE rb_ll2inum _((long long)); +#define LL2NUM(v) rb_ll2inum(v) +VALUE rb_ull2inum _((unsigned long long)); +#define ULL2NUM(v) rb_ull2inum(v) +#endif + +#if SIZEOF_OFF_T > SIZEOF_LONG && HAVE_LONG_LONG +# define OFFT2NUM(v) LL2NUM(v) +#else +# define OFFT2NUM(v) INT2NUM(v) +#endif + #define FIX2LONG(x) RSHIFT((long)x,1) #define FIX2ULONG(x) (((unsigned long)(x))>>1) #define FIXNUM_P(f) (((long)(f))&FIXNUM_FLAG) @@ -201,6 +232,18 @@ int rb_fix2int _((VALUE)); #define FIX2UINT(x) FIX2ULONG(x) #endif +#if HAVE_LONG_LONG +long long rb_num2ll _((VALUE)); +unsigned long long rb_num2ull _((VALUE)); +# define NUM2LL(x) (FIXNUM_P(x)?FIX2LONG(x):rb_num2ll((VALUE)x)) +#endif + +#if HAVE_LONG_LONG && SIZEOF_OFF_T > SIZEOF_LONG +# define NUM2OFFT(x) ((off_t)NUM2LL(x)) +#else +# define NUM2OFFT(x) NUM2LONG(x) +#endif + double rb_num2dbl _((VALUE)); #define NUM2DBL(x) rb_num2dbl((VALUE)(x)) -- cgit v1.2.3