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 | ef1f2b4a798690b43154502654a74cb5f0456aea (patch) | |
| tree | 5df33dff9eefe7511893720f2242801d4f373b08 /Library/Homebrew/os/mac | |
| parent | 8bb26ee2d9567cb91180d31e747753e4dd803f53 (diff) | |
| download | brew-ef1f2b4a798690b43154502654a74cb5f0456aea.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/mac')
| -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 |
