From b6e9600b9fbcb1f86bc43d78fb461a1247e9aacd Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sun, 3 Aug 2014 11:15:39 -0500 Subject: Eliminate consideration of major_version The major version is implicit in the compiler name. Since the name is used when matching failures to compilers, we don't need to consider the major version separately. --- Library/Homebrew/compilers.rb | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) (limited to 'Library/Homebrew/compilers.rb') diff --git a/Library/Homebrew/compilers.rb b/Library/Homebrew/compilers.rb index 4fa7069ac..2fa43757d 100644 --- a/Library/Homebrew/compilers.rb +++ b/Library/Homebrew/compilers.rb @@ -3,13 +3,7 @@ module CompilerConstants GNU_GCC_REGEXP = /^gcc-(4\.[3-9])$/ end -class Compiler < Struct.new(:name, :version, :priority) - # The major version for non-Apple compilers. Used to indicate a compiler - # series; for instance, if the version is 4.8.2, it would return "4.8". - def major_version - version.match(/(\d\.\d)/)[0] if name.is_a? String - end -end +Compiler = Struct.new(:name, :version, :priority) class CompilerFailure attr_reader :name @@ -32,12 +26,11 @@ class CompilerFailure name = "gcc-#{major_version}" # so fails_with :gcc => '4.8' simply marks all 4.8 releases incompatible version = "#{major_version}.999" - GnuCompilerFailure.new(name, major_version, version, &block) else name = spec version = 9999 - new(name, version, &block) end + new(name, version, &block) end def initialize(name, version, &block) @@ -50,19 +43,6 @@ class CompilerFailure name == compiler.name && version >= (compiler.version || 0) end - class GnuCompilerFailure < CompilerFailure - attr_reader :major_version - - def initialize(name, major_version, version, &block) - @major_version = major_version - super(name, version, &block) - end - - def ===(compiler) - super && major_version == compiler.major_version - end - end - MESSAGES = { :cxx11 => "This compiler does not support C++11" } -- cgit v1.2.3