1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/angle/src/compiler/preprocessor/SourceLocation.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,38 @@ 1.4 +// 1.5 +// Copyright (c) 2012 The ANGLE Project Authors. All rights reserved. 1.6 +// Use of this source code is governed by a BSD-style license that can be 1.7 +// found in the LICENSE file. 1.8 +// 1.9 + 1.10 +#ifndef COMPILER_PREPROCESSOR_SOURCE_LOCATION_H_ 1.11 +#define COMPILER_PREPROCESSOR_SOURCE_LOCATION_H_ 1.12 + 1.13 +namespace pp 1.14 +{ 1.15 + 1.16 +struct SourceLocation 1.17 +{ 1.18 + SourceLocation() : file(0), line(0) { } 1.19 + SourceLocation(int f, int l) : file(f), line(l) { } 1.20 + 1.21 + bool equals(const SourceLocation& other) const 1.22 + { 1.23 + return (file == other.file) && (line == other.line); 1.24 + } 1.25 + 1.26 + int file; 1.27 + int line; 1.28 +}; 1.29 + 1.30 +inline bool operator==(const SourceLocation& lhs, const SourceLocation& rhs) 1.31 +{ 1.32 + return lhs.equals(rhs); 1.33 +} 1.34 + 1.35 +inline bool operator!=(const SourceLocation& lhs, const SourceLocation& rhs) 1.36 +{ 1.37 + return !lhs.equals(rhs); 1.38 +} 1.39 + 1.40 +} // namespace pp 1.41 +#endif // COMPILER_PREPROCESSOR_SOURCE_LOCATION_H_