Commit 8d471f90 by Jamie Madill Committed by Commit Bot

Make distinct header guards for anglebase.

BUG=angleproject:2065 Change-Id: I7783d4866a2e16e0cee79aecccb6d5ee1b74165d Reviewed-on: https://chromium-review.googlesource.com/533724Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 97ee6548
......@@ -15,7 +15,7 @@ base::MRUCache is a few collections of most-recently-used caching structures.
To update the checkout, simply overwrite the folder with Chromium's latest, apply
the appropriate namespace, and make sure the paths are correct (anglebase/ instead of
base/).
base/), and update the header guards and macros.
Modifications:
......@@ -23,3 +23,4 @@ Modifications:
- anglebase/logging.h defines (D)CHECK to be ASSERT to be compatible with ANGLE.
- the headers use namespace angle::base instead of base:: to avoid ODR
violations when ANGLE code is mixed with Chromium code.
- header guards and macros are changed from BASE to ANGLEBASE to prevent conflicts.
......@@ -13,8 +13,8 @@
// legibility rather than optimality. If future profiling identifies this as
// a bottleneck, there is room for smaller values of 1 in the O(1). :]
#ifndef BASE_CONTAINERS_MRU_CACHE_H_
#define BASE_CONTAINERS_MRU_CACHE_H_
#ifndef ANGLEBASE_CONTAINERS_MRU_CACHE_H_
#define ANGLEBASE_CONTAINERS_MRU_CACHE_H_
#include <stddef.h>
......@@ -272,4 +272,4 @@ class HashingMRUCache : public MRUCacheBase<KeyType, PayloadType, HashType, MRUC
} // namespace angle
#endif // BASE_CONTAINERS_MRU_CACHE_H_
#endif // ANGLEBASE_CONTAINERS_MRU_CACHE_H_
......@@ -5,8 +5,8 @@
//
// logging.h: Compatiblity hacks for importing Chromium's base/numerics.
#ifndef BASE_LOGGING_H_
#define BASE_LOGGING_H_
#ifndef ANGLEBASE_LOGGING_H_
#define ANGLEBASE_LOGGING_H_
#include "common/debug.h"
......@@ -23,4 +23,4 @@
#define NOTREACHED() UNREACHABLE()
#endif
#endif // BASE_LOGGING_H_
#endif // ANGLEBASE_LOGGING_H_
......@@ -5,8 +5,8 @@
//
// macros.h: Compatiblity hacks for importing Chromium's MRUCache.
#ifndef BASE_MACROS_H_
#define BASE_MACROS_H_
#ifndef ANGLEBASE_MACROS_H_
#define ANGLEBASE_MACROS_H_
// A macro to disallow the copy constructor and operator= functions.
// This should be used in the private: declarations for a class.
......@@ -14,4 +14,4 @@
TypeName(const TypeName &) = delete; \
void operator=(const TypeName &) = delete
#endif // BASE_MACROS_H_
#endif // ANGLEBASE_MACROS_H_
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef BASE_NUMERICS_SAFE_CONVERSIONS_H_
#define BASE_NUMERICS_SAFE_CONVERSIONS_H_
#ifndef ANGLEBASE_NUMERICS_SAFE_CONVERSIONS_H_
#define ANGLEBASE_NUMERICS_SAFE_CONVERSIONS_H_
#include <stddef.h>
......@@ -176,4 +176,4 @@ typedef StrictNumeric<size_t> SizeT;
} // namespace angle
#endif // BASE_NUMERICS_SAFE_CONVERSIONS_H_
#endif // ANGLEBASE_NUMERICS_SAFE_CONVERSIONS_H_
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef BASE_NUMERICS_SAFE_CONVERSIONS_IMPL_H_
#define BASE_NUMERICS_SAFE_CONVERSIONS_IMPL_H_
#ifndef ANGLEBASE_NUMERICS_SAFE_CONVERSIONS_IMPL_H_
#define ANGLEBASE_NUMERICS_SAFE_CONVERSIONS_IMPL_H_
#include <limits.h>
#include <stdint.h>
......@@ -271,4 +271,4 @@ constexpr RangeConstraint DstRangeRelationToSrcRange(Src value)
} // namespace angle
#endif // BASE_NUMERICS_SAFE_CONVERSIONS_IMPL_H_
#endif // ANGLEBASE_NUMERICS_SAFE_CONVERSIONS_IMPL_H_
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef BASE_NUMERICS_SAFE_MATH_H_
#define BASE_NUMERICS_SAFE_MATH_H_
#ifndef ANGLEBASE_NUMERICS_SAFE_MATH_H_
#define ANGLEBASE_NUMERICS_SAFE_MATH_H_
#include <stddef.h>
......@@ -247,7 +247,7 @@ class CheckedNumeric
// * We skip range checks for floating points.
// * We skip range checks for destination integers with sufficient range.
// TODO(jschuh): extract these out into templates.
#define BASE_NUMERIC_ARITHMETIC_OPERATORS(NAME, OP, COMPOUND_OP) \
#define ANGLEBASE_NUMERIC_ARITHMETIC_OPERATORS(NAME, OP, COMPOUND_OP) \
/* Binary arithmetic operator for CheckedNumerics of the same type. */ \
template <typename T> \
CheckedNumeric<typename ArithmeticPromotion<T>::type> operator OP( \
......@@ -310,13 +310,13 @@ class CheckedNumeric
return CheckedNumeric<Promotion>::cast(lhs) OP CheckedNumeric<Promotion>::cast(rhs); \
}
BASE_NUMERIC_ARITHMETIC_OPERATORS(Add, +, +=)
BASE_NUMERIC_ARITHMETIC_OPERATORS(Sub, -, -=)
BASE_NUMERIC_ARITHMETIC_OPERATORS(Mul, *, *=)
BASE_NUMERIC_ARITHMETIC_OPERATORS(Div, /, /=)
BASE_NUMERIC_ARITHMETIC_OPERATORS(Mod, %, %=)
ANGLEBASE_NUMERIC_ARITHMETIC_OPERATORS(Add, +, +=)
ANGLEBASE_NUMERIC_ARITHMETIC_OPERATORS(Sub, -, -=)
ANGLEBASE_NUMERIC_ARITHMETIC_OPERATORS(Mul, *, *=)
ANGLEBASE_NUMERIC_ARITHMETIC_OPERATORS(Div, /, /=)
ANGLEBASE_NUMERIC_ARITHMETIC_OPERATORS(Mod, %, %=)
#undef BASE_NUMERIC_ARITHMETIC_OPERATORS
#undef ANGLEBASE_NUMERIC_ARITHMETIC_OPERATORS
} // namespace internal
......@@ -326,4 +326,4 @@ using internal::CheckedNumeric;
} // namespace angle
#endif // BASE_NUMERICS_SAFE_MATH_H_
#endif // ANGLEBASE_NUMERICS_SAFE_MATH_H_
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef BASE_NUMERICS_SAFE_MATH_IMPL_H_
#define BASE_NUMERICS_SAFE_MATH_IMPL_H_
#ifndef ANGLEBASE_NUMERICS_SAFE_MATH_IMPL_H_
#define ANGLEBASE_NUMERICS_SAFE_MATH_IMPL_H_
#include <stddef.h>
#include <stdint.h>
......@@ -364,7 +364,7 @@ CheckedUnsignedAbs(T value)
// These are the floating point stubs that the compiler needs to see. Only the
// negation operation is ever called.
#define BASE_FLOAT_ARITHMETIC_STUBS(NAME) \
#define ANGLEBASE_FLOAT_ARITHMETIC_STUBS(NAME) \
template <typename T> \
typename std::enable_if<std::numeric_limits<T>::is_iec559, T>::type Checked##NAME( \
T, T, RangeConstraint *) \
......@@ -373,13 +373,13 @@ CheckedUnsignedAbs(T value)
return static_cast<T>(0); \
}
BASE_FLOAT_ARITHMETIC_STUBS(Add)
BASE_FLOAT_ARITHMETIC_STUBS(Sub)
BASE_FLOAT_ARITHMETIC_STUBS(Mul)
BASE_FLOAT_ARITHMETIC_STUBS(Div)
BASE_FLOAT_ARITHMETIC_STUBS(Mod)
ANGLEBASE_FLOAT_ARITHMETIC_STUBS(Add)
ANGLEBASE_FLOAT_ARITHMETIC_STUBS(Sub)
ANGLEBASE_FLOAT_ARITHMETIC_STUBS(Mul)
ANGLEBASE_FLOAT_ARITHMETIC_STUBS(Div)
ANGLEBASE_FLOAT_ARITHMETIC_STUBS(Mod)
#undef BASE_FLOAT_ARITHMETIC_STUBS
#undef ANGLEBASE_FLOAT_ARITHMETIC_STUBS
template <typename T>
typename std::enable_if<std::numeric_limits<T>::is_iec559, T>::type CheckedNeg(T value,
......@@ -572,4 +572,4 @@ struct IsIntegerArithmeticSafe
} // namespace angle
#endif // BASE_NUMERICS_SAFE_MATH_IMPL_H_
#endif // ANGLEBASE_NUMERICS_SAFE_MATH_IMPL_H_
......@@ -109,4 +109,4 @@
double constructed_; \
} scoped_histogram_timer_##key
#endif // BASE_METRICS_HISTOGRAM_MACROS_H_
#endif // LIBANGLE_HISTOGRAM_MACROS_H_
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment