Created
February 3, 2009 22:25
-
-
Save BanzaiMan/57802 to your computer and use it in GitHub Desktop.
Check if we're on 32-bit or 64-bit architecture
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
integer_size = 32 | |
if defined?(JRUBY_VERSION) | |
require 'java' | |
integer_size = java.lang.Integer.getInteger("sun.arch.data.model") | |
else | |
# http://groups.google.com/group/ruby-talk-google/browse_thread/thread/fe3bde8257d7e773?pli=1 | |
if (-1.size) == 8 | |
integer_size = 64 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment