Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1639)

Unified Diff: tools/clang/plugins/ChromeClassTester.cpp

Issue 1069853004: Windows compile fixes for Chrome clang plugin. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 '/'");
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698