diff options
| author | Jack Nagel | 2014-08-03 11:15:39 -0500 | 
|---|---|---|
| committer | Jack Nagel | 2014-08-03 11:15:39 -0500 | 
| commit | b6e9600b9fbcb1f86bc43d78fb461a1247e9aacd (patch) | |
| tree | cf0781347d32f57f2c274b66a66544810d59222c /Library/Homebrew/compilers.rb | |
| parent | 4580d86809095a236839d1de55e47e5dc98b7987 (diff) | |
| download | brew-b6e9600b9fbcb1f86bc43d78fb461a1247e9aacd.tar.bz2 | |
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.
Diffstat (limited to 'Library/Homebrew/compilers.rb')
| -rw-r--r-- | Library/Homebrew/compilers.rb | 24 | 
1 files changed, 2 insertions, 22 deletions
| 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"    } | 
