From 285cb99ba493a113098b78c9989cba5a870f2435 Mon Sep 17 00:00:00 2001 From: matz Date: Thu, 22 Mar 2001 08:59:26 +0000 Subject: [PATCH] * ruby.h: better inline function support. * configure.in (NO_C_INLINE): check if inline is available for the C compiler. * marshal.c (r_object): len calculation patch was wrong for machines SIZEOF_BDIGITS == SIZEOF_SHORT. * gc.c: alloca prototype reorganized for C_ALLOCA machine. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 14 ++++++++++++++ configure.in | 5 ++++- gc.c | 6 ------ marshal.c | 4 ++++ ruby.h | 26 +++++++++++--------------- util.c | 2 +- version.h | 4 ++-- 7 files changed, 36 insertions(+), 25 deletions(-) diff --git a/ChangeLog b/ChangeLog index 47741c41aa..460d37c49b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +Thu Mar 22 17:43:44 2001 Yukihiro Matsumoto + + * ruby.h: better inline function support. + + * configure.in (NO_C_INLINE): check if inline is available for the + C compiler. + +Mon Mar 19 11:03:10 2001 Koji Arai + + * marshal.c (r_object): len calculation patch was wrong for + machines SIZEOF_BDIGITS == SIZEOF_SHORT. + + * gc.c: alloca prototype reorganized for C_ALLOCA machine. + Wed Mar 21 23:07:45 2001 WATANABE Hirofumi * win32/win32.c (win32_stat): WinNT/2k "//host/share" support. diff --git a/configure.in b/configure.in index 5e01de1500..5d299d88f6 100644 --- a/configure.in +++ b/configure.in @@ -374,10 +374,13 @@ main() ], rb_cv_func_strtod=yes, rb_cv_func_strtod=no, rb_cv_func_strtod=no)]) test $rb_cv_func_strtod = no && LIBOBJS="$LIBOBJS strtod.o" -AC_C_INLINE AC_C_BIGENDIAN AC_C_CONST AC_C_CHAR_UNSIGNED +AC_C_INLINE +if test "$ac_cv_c_inline" = no; then + AC_DEFINE(NO_C_INLINE) +fi AC_CACHE_CHECK(whether right shift preserve sign bit, rb_cv_rshift_sign, [AC_TRY_RUN([ diff --git a/gc.c b/gc.c index 56dddc5d5a..e4b301f5c9 100644 --- a/gc.c +++ b/gc.c @@ -50,12 +50,6 @@ void *alloca(); #pragma alloca #endif -#ifdef C_ALLOCA -#ifndef alloca -void *alloca(); -#endif -#endif - static void run_final(); #ifndef GC_MALLOC_LIMIT diff --git a/marshal.c b/marshal.c index 284d4e0fe8..ec6cc35fd1 100644 --- a/marshal.c +++ b/marshal.c @@ -824,7 +824,11 @@ r_object(arg) OBJSETUP(big, rb_cBignum, T_BIGNUM); big->sign = (r_byte(arg) == '+'); len = r_long(arg); +#if SIZEOF_BDIGITS == SIZEOF_SHORT + big->len = len; +#else big->len = (len + 1) * sizeof(short) / sizeof(BDIGIT); +#endif big->digits = digits = ALLOC_N(BDIGIT, big->len); while (len > 0) { #if SIZEOF_BDIGITS > SIZEOF_SHORT diff --git a/ruby.h b/ruby.h index a9f9c11503..d7da398c9d 100644 --- a/ruby.h +++ b/ruby.h @@ -545,11 +545,10 @@ extern inline VALUE rb_class_of _((VALUE)); extern inline int rb_type _((VALUE)); extern inline int rb_special_const_p _((VALUE)); -#ifndef RUBY_NO_INLINE -extern inline -#endif -VALUE -rb_class_of(VALUE obj) +#if !defined(NO_C_INLINE) || defined(INLINE_DEFINE) +extern inline VALUE +rb_class_of(obj) + VALUE obj; { if (FIXNUM_P(obj)) return rb_cFixnum; if (obj == Qnil) return rb_cNilClass; @@ -560,11 +559,9 @@ rb_class_of(VALUE obj) return RBASIC(obj)->klass; } -#ifndef RUBY_NO_INLINE -extern inline -#endif -int -rb_type(VALUE obj) +extern inline int +rb_type(obj) + VALUE obj; { if (FIXNUM_P(obj)) return T_FIXNUM; if (obj == Qnil) return T_NIL; @@ -575,15 +572,14 @@ rb_type(VALUE obj) return BUILTIN_TYPE(obj); } -#ifndef RUBY_NO_INLINE -extern inline -#endif -int -rb_special_const_p(VALUE obj) +extern inline int +rb_special_const_p(obj) + VALUE obj; { if (SPECIAL_CONST_P(obj)) return Qtrue; return Qfalse; } +#endif #include "intern.h" diff --git a/util.c b/util.c index 75889dcb15..56059d4dc6 100644 --- a/util.c +++ b/util.c @@ -16,7 +16,7 @@ #include "missing/file.h" #endif -#define RUBY_NO_INLINE +#define INLINE_DEFINE #include "ruby.h" #include "util.h" diff --git a/version.h b/version.h index 5791b1bc85..738347148b 100644 --- a/version.h +++ b/version.h @@ -1,4 +1,4 @@ #define RUBY_VERSION "1.7.0" -#define RUBY_RELEASE_DATE "2001-03-21" +#define RUBY_RELEASE_DATE "2001-03-22" #define RUBY_VERSION_CODE 170 -#define RUBY_RELEASE_CODE 20010321 +#define RUBY_RELEASE_CODE 20010322