Permalink
Browse files

todo : now using getconf to determine INT_MIN (thanks oklahoma_mixer)

  • Loading branch information...
1 parent 9424c3d commit ba2d7b8fbe646d13954b49c3e0d7b214d074c77a @jmettraux committed Jan 6, 2010
Showing with 8 additions and 3 deletions.
  1. +1 −0 CHANGELOG.txt
  2. +7 −3 lib/rufus/tokyo.rb
View
@@ -4,6 +4,7 @@
== rufus-tokyo - 1.0.5 released 2010/01/06
+- todo : now using getconf to determine INT_MIN (thanks oklahoma_mixer)
- bug : issue with ree and lib.free(pointer), switching to tcfree
View
@@ -34,10 +34,14 @@ module Tokyo
#
class TokyoError < RuntimeError; end
+ # This getconf technique was taken from oklahoma_mixer :
+ # http://github.com/JEG2/oklahoma_mixer
#
- # Grumpf, this is not elegant...
- #
- INT_MIN = -2147483648
+ INT_MIN = if im = `getconf INT_MIN 2>&1`[/-\d+/]
+ im.to_i
+ else
+ -2147483648
+ end
# Returns 'bytesize' of the string (Ruby 1.9.1 for everyone).
#

0 comments on commit ba2d7b8

Please sign in to comment.