| Index: tools/clang/plugins/ChromeClassTester.cpp
|
| diff --git a/tools/clang/plugins/ChromeClassTester.cpp b/tools/clang/plugins/ChromeClassTester.cpp
|
| index 48d6a735f272c3db2331e7f21703fedaa265e0a2..f219b3411794dc46c91abe3655396384396297a5 100644
|
| --- a/tools/clang/plugins/ChromeClassTester.cpp
|
| +++ b/tools/clang/plugins/ChromeClassTester.cpp
|
| @@ -7,12 +7,14 @@
|
|
|
| #include "ChromeClassTester.h"
|
|
|
| -#include <sys/param.h>
|
| -
|
| #include "clang/AST/AST.h"
|
| #include "clang/Basic/FileManager.h"
|
| #include "clang/Basic/SourceManager.h"
|
|
|
| +#ifdef LLVM_ON_UNIX
|
| +#include <sys/param.h>
|
| +#endif
|
| +
|
| using namespace clang;
|
|
|
| namespace {
|
| @@ -258,6 +260,7 @@ bool ChromeClassTester::InBannedDirectory(SourceLocation loc) {
|
| return true;
|
| }
|
|
|
| +#ifdef LLVM_ON_UNIX
|
| // We need to munge the paths so that they are relative to the repository
|
| // srcroot. We first resolve the symlinktastic relative path and then
|
| // remove our known srcroot from it if needed.
|
| @@ -265,11 +268,11 @@ bool ChromeClassTester::InBannedDirectory(SourceLocation loc) {
|
| if (realpath(filename.c_str(), 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,
|
| // this file is rejected.
|
| - const std::string& banned_dir = banned_directories_[i];
|
| assert(banned_dir.front() == '/' && "Banned dir must start with '/'");
|
| assert(banned_dir.back() == '/' && "Banned dir must end with '/'");
|
|
|
|
|