summaryrefslogtreecommitdiff
path: root/ruby.h
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-03-14 06:23:46 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-03-14 06:23:46 +0000
commit997b69cb6ac9eb97ea644276f1af886a49c1de03 (patch)
tree1dffc60dc5f5afbec79dc8d0f314c3355f92dab2 /ruby.h
parent4f0870f74b530cdb2de4306d55e966a924a9149c (diff)
* 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
Diffstat (limited to 'ruby.h')
-rw-r--r--ruby.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/ruby.h b/ruby.h
index c406d6b..a399511 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))