зеркало из https://github.com/github/ruby.git
* ext/bigdecimal/bigdecimal.c (rb_rational_num): add fallback function
for rubies lower than 2.2.0. * ext/bigdecimal/bigdecimal.c (rb_rational_den): ditto. * ext/bigdecimal/extconf.rb: check the existences of struct RRational, rb_rational_num, and rb_rational_den. * ext/bigdecimal/bigdecimal.bundle: bump version. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
21f6bb283f
Коммит
78400919ba
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
||||||
|
Thu Jan 29 23:30:00 2015 Kenta Murata <mrkn@mrkn.jp>
|
||||||
|
|
||||||
|
* ext/bigdecimal/bigdecimal.c (rb_rational_num): add fallback function
|
||||||
|
for rubies lower than 2.2.0.
|
||||||
|
|
||||||
|
* ext/bigdecimal/bigdecimal.c (rb_rational_den): ditto.
|
||||||
|
|
||||||
|
* ext/bigdecimal/extconf.rb: check the existences of struct RRational,
|
||||||
|
rb_rational_num, and rb_rational_den.
|
||||||
|
|
||||||
|
* ext/bigdecimal/bigdecimal.bundle: bump version.
|
||||||
|
|
||||||
Thu Jan 29 20:28:25 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
|
Thu Jan 29 20:28:25 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
|
||||||
|
|
||||||
* tool/make-snapshot: removed md5 digest with package infomation
|
* tool/make-snapshot: removed md5 digest with package infomation
|
||||||
|
|
|
@ -109,6 +109,30 @@ static ID id_eq;
|
||||||
# define RB_OBJ_STRING(obj) StringValueCStr(obj)
|
# define RB_OBJ_STRING(obj) StringValueCStr(obj)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_RB_RATIONAL_NUM
|
||||||
|
static inline VALUE
|
||||||
|
rb_rational_num(VALUE rat)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_TYPE_STRUCT_RRATIONAL
|
||||||
|
return RRATIONAL(rat)->num;
|
||||||
|
#else
|
||||||
|
return rb_funcall(rat, rb_intern("numerator"));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_RB_RATIONAL_DEN
|
||||||
|
static inline VALUE
|
||||||
|
rb_rational_den(VALUE rat)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_TYPE_STRUCT_RRATIONAL
|
||||||
|
return RRATIONAL(rat)->den;
|
||||||
|
#else
|
||||||
|
return rb_funcall(rat, rb_intern("denominator"));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ================== Ruby Interface part ==========================
|
* ================== Ruby Interface part ==========================
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# -*- ruby -*-
|
# -*- ruby -*-
|
||||||
_VERSION = "1.2.6"
|
_VERSION = "1.2.7"
|
||||||
date = %w$Date:: $[1]
|
date = %w$Date:: $[1]
|
||||||
|
|
||||||
Gem::Specification.new do |s|
|
Gem::Specification.new do |s|
|
||||||
|
|
|
@ -3,4 +3,8 @@ require 'mkmf'
|
||||||
have_func("labs", "stdlib.h")
|
have_func("labs", "stdlib.h")
|
||||||
have_func("llabs", "stdlib.h")
|
have_func("llabs", "stdlib.h")
|
||||||
|
|
||||||
|
have_type("struct RRational", "ruby.h")
|
||||||
|
have_func("rb_rational_num", "ruby.h")
|
||||||
|
have_func("rb_rational_den", "ruby.h")
|
||||||
|
|
||||||
create_makefile('bigdecimal')
|
create_makefile('bigdecimal')
|
||||||
|
|
Загрузка…
Ссылка в новой задаче