Commit e9f7a955 authored by dcheng's avatar dcheng Committed by Commit bot

Windows compile fixes for Chrome clang plugin.

Symlinks aren't very common on Windows anyway.

BUG=467287

Review URL: https://codereview.chromium.org/1069853004

Cr-Commit-Position: refs/heads/master@{#324364}
parent a96f46b8
...@@ -7,12 +7,14 @@ ...@@ -7,12 +7,14 @@
#include "ChromeClassTester.h" #include "ChromeClassTester.h"
#include <sys/param.h>
#include "clang/AST/AST.h" #include "clang/AST/AST.h"
#include "clang/Basic/FileManager.h" #include "clang/Basic/FileManager.h"
#include "clang/Basic/SourceManager.h" #include "clang/Basic/SourceManager.h"
#ifdef LLVM_ON_UNIX
#include <sys/param.h>
#endif
using namespace clang; using namespace clang;
namespace { namespace {
...@@ -258,6 +260,7 @@ bool ChromeClassTester::InBannedDirectory(SourceLocation loc) { ...@@ -258,6 +260,7 @@ bool ChromeClassTester::InBannedDirectory(SourceLocation loc) {
return true; return true;
} }
#ifdef LLVM_ON_UNIX
// We need to munge the paths so that they are relative to the repository // We need to munge the paths so that they are relative to the repository
// srcroot. We first resolve the symlinktastic relative path and then // srcroot. We first resolve the symlinktastic relative path and then
// remove our known srcroot from it if needed. // remove our known srcroot from it if needed.
...@@ -265,11 +268,11 @@ bool ChromeClassTester::InBannedDirectory(SourceLocation loc) { ...@@ -265,11 +268,11 @@ bool ChromeClassTester::InBannedDirectory(SourceLocation loc) {
if (realpath(filename.c_str(), resolvedPath)) { if (realpath(filename.c_str(), resolvedPath)) {
filename = resolvedPath; filename = resolvedPath;
} }
#endif
for (size_t i = 0; i < banned_directories_.size(); ++i) { for (const std::string& banned_dir : banned_directories_) {
// If any of the banned directories occur as a component in filename, // If any of the banned directories occur as a component in filename,
// this file is rejected. // this file is rejected.
const std::string& banned_dir = banned_directories_[i];
assert(banned_dir.front() == '/' && "Banned dir must start with '/'"); assert(banned_dir.front() == '/' && "Banned dir must start with '/'");
assert(banned_dir.back() == '/' && "Banned dir must end with '/'"); assert(banned_dir.back() == '/' && "Banned dir must end with '/'");
......
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