diff options
| author | Misty De Meo | 2013-08-01 20:19:00 -0700 |
|---|---|---|
| committer | Misty De Meo | 2013-08-15 22:46:55 -0700 |
| commit | f3c3a840fe7ea14680952d70cfeb057eb7dbbb2c (patch) | |
| tree | 2c4ccada38e79493543ecbf0c94495038b8e671e /Library/Homebrew/os | |
| parent | 4888c02c30bb43b436249b60abaa1ee516fd03d3 (diff) | |
| download | homebrew-f3c3a840fe7ea14680952d70cfeb057eb7dbbb2c.tar.bz2 | |
Add Hardware::CPU.arch_(32|64)_bit
This replaces hardcoding of i386/x86_64 all over the code.
Diffstat (limited to 'Library/Homebrew/os')
| -rw-r--r-- | Library/Homebrew/os/mac/hardware.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Library/Homebrew/os/mac/hardware.rb b/Library/Homebrew/os/mac/hardware.rb index 5487a8d4d..05cd3da5e 100644 --- a/Library/Homebrew/os/mac/hardware.rb +++ b/Library/Homebrew/os/mac/hardware.rb @@ -75,6 +75,14 @@ module MacCPUs @bits ||= is_64_bit ? 64 : 32 end + def arch_32_bit + type == :intel ? :i386 : :ppc + end + + def arch_64_bit + type == :intel ? :x86_64 : :ppc64 + end + def altivec? @altivec ||= sysctl_bool('hw.optional.altivec') end |
