Commit cc16c913 by Corentin Wallez

gpu_test_expectations: Fix a -Wheader-hygiene

Reland with a fix for the compilation on Windows. Rereland with a fix for the Chromium compilation on Windowds. Our angle_config.h was using "using namespace" in a header as a way to import symbols to shim Chromium's base. This patch changes this to import each function separately using "using". This patch will allow our gpu_test_expectations to compile inside Chromium on Linux. BUG=angleproject:1127 Change-Id: Iefb9e253e278fa766a11e50fc6a69eceb2e81dd9 Reviewed-on: https://chromium-review.googlesource.com/295192Tested-by: 's avatarCorentin Wallez <cwallez@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent bc0b1d47
......@@ -5,7 +5,7 @@ will allow us to merge Chromium changes easily in our ```gpu_test_expectations``
In order to make a change to this directory, do the following:
* copy the directory somewhere like in ```gpu_test_expectations_reverted```
* in ```gpu_test_expectations_reverted``` run ```patch -p 1 -R angle-mods.patch```
* in ```gpu_test_expectations_reverted``` run ```patch -p 1 -R < angle-mods.patch```
* do your changes in ```gpu_test_expectations```
* delete angle-mods.path in both directories
* run ```diff -rupN gpu_test_expectations_reverted gpu_test_expectations > angle-mods.patch```
......
......@@ -21,17 +21,27 @@
#define DCHECK_NE(A,B) ASSERT((A) != (B))
#define DCHECK(X) ASSERT(X)
#define LOG(X) std::cerr
#define StringPrintf FormatString
#define GPU_EXPORT
#define base
typedef int32_t int32;
typedef uint32_t uint32;
typedef int64_t int64;
typedef uint64_t uint64;
using namespace angle;
// Shim Chromium's base by importing functions in the bsae namespace.
namespace base
{
using angle::HexStringToUInt;
using angle::ReadFileToString;
using angle::SplitString;
using angle::SplitStringAlongWhitespace;
// StringPrintf is called differently in ANGLE but using cannot change
// the name of the imported function. Use a define to change the name.
using ::FormatString;
#define StringPrintf FormatString
}
// TODO(jmadill): other platforms
#if defined(_WIN32) || defined(_WIN64)
......
......@@ -16,6 +16,11 @@ extern "C" {
using namespace gpu;
#if defined(OS_WIN)
namespace base {
namespace {
// Disable the deprecated function warning for GetVersionEx
#pragma warning(disable: 4996)
......@@ -37,6 +42,10 @@ void SysInfo::OperatingSystemVersionNumbers(
*bugfix_version = version_info.dwBuildNumber;
}
} // anonymous namespace
} // namespace base
void DeviceIDToVendorAndDevice(const std::string& id,
uint32* vendor_id,
uint32* device_id) {
......
......@@ -6,6 +6,10 @@
#include "common/angleutils.h"
namespace base {
namespace {
bool StartsWithASCII(const std::string& str,
const std::string& search,
bool case_sensitive) {
......@@ -32,6 +36,10 @@ bool LowerCaseEqualsASCII(const std::string& a, const char* b) {
return DoLowerCaseEqualsASCII(a.begin(), a.end(), b);
}
} // anonymous namespace
} // namespace base
namespace gpu {
namespace {
......
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