From f3c3a840fe7ea14680952d70cfeb057eb7dbbb2c Mon Sep 17 00:00:00 2001 From: Misty De Meo Date: Thu, 1 Aug 2013 20:19:00 -0700 Subject: Add Hardware::CPU.arch_(32|64)_bit This replaces hardcoding of i386/x86_64 all over the code. --- Library/Homebrew/os/mac/hardware.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Library/Homebrew/os') 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 -- cgit v1.2.3