michael@0: // michael@0: // Copyright (c) 2012 The ANGLE Project Authors. All rights reserved. michael@0: // Use of this source code is governed by a BSD-style license that can be michael@0: // found in the LICENSE file. michael@0: // michael@0: michael@0: #ifndef COMPILER_PREPROCESSOR_SOURCE_LOCATION_H_ michael@0: #define COMPILER_PREPROCESSOR_SOURCE_LOCATION_H_ michael@0: michael@0: namespace pp michael@0: { michael@0: michael@0: struct SourceLocation michael@0: { michael@0: SourceLocation() : file(0), line(0) { } michael@0: SourceLocation(int f, int l) : file(f), line(l) { } michael@0: michael@0: bool equals(const SourceLocation& other) const michael@0: { michael@0: return (file == other.file) && (line == other.line); michael@0: } michael@0: michael@0: int file; michael@0: int line; michael@0: }; michael@0: michael@0: inline bool operator==(const SourceLocation& lhs, const SourceLocation& rhs) michael@0: { michael@0: return lhs.equals(rhs); michael@0: } michael@0: michael@0: inline bool operator!=(const SourceLocation& lhs, const SourceLocation& rhs) michael@0: { michael@0: return !lhs.equals(rhs); michael@0: } michael@0: michael@0: } // namespace pp michael@0: #endif // COMPILER_PREPROCESSOR_SOURCE_LOCATION_H_