mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/socket/mkconstants.rb (INTEGER2VALUE): Use LONG2FIX if possible.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40802 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e0a459762d
commit
94dfc14ed8
2 changed files with 10 additions and 2 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
Sat May 18 09:00:32 2013 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* ext/socket/mkconstants.rb (INTEGER2VALUE): Use LONG2FIX if possible.
|
||||||
|
|
||||||
Sat May 18 00:38:47 2013 Tanaka Akira <akr@fsij.org>
|
Sat May 18 00:38:47 2013 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* ext/socket/mkconstants.rb: Convert integer constants bigger than int
|
* ext/socket/mkconstants.rb: Convert integer constants bigger than int
|
||||||
|
|
|
@ -280,9 +280,13 @@ result = ERB.new(<<'EOS', nil, '%').result(binding)
|
||||||
<%= INTERN_DEFS.map {|vardef, gen_hash, decl, func| vardef }.join("\n") %>
|
<%= INTERN_DEFS.map {|vardef, gen_hash, decl, func| vardef }.join("\n") %>
|
||||||
|
|
||||||
#ifdef HAVE_LONG_LONG
|
#ifdef HAVE_LONG_LONG
|
||||||
#define INTEGER2VALUE(n) ((n) <= 0 ? LL2NUM(n) : ULL2NUM(n))
|
#define INTEGER2VALUE(n) (0 < (n) ? \
|
||||||
|
((n) <= FIXNUM_MAX ? LONG2FIX(n) : ULL2NUM(n)) : \
|
||||||
|
(FIXNUM_MIN <= (n) ? LONG2FIX(n) : LL2NUM(n)))
|
||||||
#else
|
#else
|
||||||
#define INTEGER2VALUE(n) ((n) <= 0 ? LONG2NUM(n) : ULONG2NUM(n))
|
#define INTEGER2VALUE(n) (0 < (n) ? \
|
||||||
|
((n) <= FIXNUM_MAX ? LONG2FIX(n) : ULONG2NUM(n)) : \
|
||||||
|
(FIXNUM_MIN <= (n) ? LONG2FIX(n) : LONG2NUM(n)))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Add table
Reference in a new issue