Ninja: fix line length
This commit is contained in:
parent
1a38a5d65f
commit
343ff7a72e
|
@ -192,7 +192,8 @@ void Win32Fatal(const char* function) {
|
||||||
|
|
||||||
} // anonymous namespace
|
} // anonymous namespace
|
||||||
|
|
||||||
Subprocess::Subprocess() : child_(NULL) , overlapped_(), is_reading_(false), exit_code_(1) {
|
Subprocess::Subprocess() : child_(NULL) , overlapped_(), is_reading_(false),
|
||||||
|
exit_code_(1) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Subprocess::~Subprocess() {
|
Subprocess::~Subprocess() {
|
||||||
|
@ -273,14 +274,17 @@ bool Subprocess::Start(SubprocessSet* set, const string& command) {
|
||||||
NULL, NULL,
|
NULL, NULL,
|
||||||
&startup_info, &process_info)) {
|
&startup_info, &process_info)) {
|
||||||
DWORD error = GetLastError();
|
DWORD error = GetLastError();
|
||||||
if (error == ERROR_FILE_NOT_FOUND) { // file (program) not found error is treated as a normal build action failure
|
if (error == ERROR_FILE_NOT_FOUND) {
|
||||||
|
// file (program) not found error is treated
|
||||||
|
// as a normal build action failure
|
||||||
if (child_pipe)
|
if (child_pipe)
|
||||||
CloseHandle(child_pipe);
|
CloseHandle(child_pipe);
|
||||||
CloseHandle(pipe_);
|
CloseHandle(pipe_);
|
||||||
CloseHandle(nul);
|
CloseHandle(nul);
|
||||||
pipe_ = NULL;
|
pipe_ = NULL;
|
||||||
// child_ is already NULL;
|
// child_ is already NULL;
|
||||||
buf_ = "CreateProcess failed: The system cannot find the file specified.\n";
|
buf_ =
|
||||||
|
"CreateProcess failed: The system cannot find the file specified.\n";
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
Win32Fatal("CreateProcess"); // pass all other errors to Win32Fatal
|
Win32Fatal("CreateProcess"); // pass all other errors to Win32Fatal
|
||||||
|
@ -436,7 +440,8 @@ void SubprocessSet::Clear() {
|
||||||
for (vector<Subprocess*>::iterator i = running_.begin();
|
for (vector<Subprocess*>::iterator i = running_.begin();
|
||||||
i != running_.end(); ++i) {
|
i != running_.end(); ++i) {
|
||||||
if ((*i)->child_)
|
if ((*i)->child_)
|
||||||
if (!GenerateConsoleCtrlEvent(CTRL_BREAK_EVENT, GetProcessId((*i)->child_)))
|
if (!GenerateConsoleCtrlEvent(CTRL_BREAK_EVENT,
|
||||||
|
GetProcessId((*i)->child_)))
|
||||||
Win32Fatal("GenerateConsoleCtrlEvent");
|
Win32Fatal("GenerateConsoleCtrlEvent");
|
||||||
}
|
}
|
||||||
for (vector<Subprocess*>::iterator i = running_.begin();
|
for (vector<Subprocess*>::iterator i = running_.begin();
|
||||||
|
@ -530,7 +535,12 @@ static string getArg(string& cmdline) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void parseCommandLine(LPTSTR wincmdline,
|
static void parseCommandLine(LPTSTR wincmdline,
|
||||||
string& srcfile, string& dfile, string& objfile, string& prefix, string& clpath, string& rest) {
|
string& srcfile,
|
||||||
|
string& dfile,
|
||||||
|
string& objfile,
|
||||||
|
string& prefix,
|
||||||
|
string& clpath,
|
||||||
|
string& rest) {
|
||||||
string cmdline(wincmdline);
|
string cmdline(wincmdline);
|
||||||
/* self */ getArg(cmdline);
|
/* self */ getArg(cmdline);
|
||||||
srcfile = getArg(cmdline);
|
srcfile = getArg(cmdline);
|
||||||
|
@ -595,7 +605,8 @@ int main() {
|
||||||
// the same command line verbatim.
|
// the same command line verbatim.
|
||||||
|
|
||||||
string srcfile, dfile, objfile, prefix, clpath, rest;
|
string srcfile, dfile, objfile, prefix, clpath, rest;
|
||||||
parseCommandLine(GetCommandLine(), srcfile, dfile, objfile, prefix, clpath, rest);
|
parseCommandLine(GetCommandLine(), srcfile, dfile, objfile,
|
||||||
|
prefix, clpath, rest);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
fprintf(stderr, "\n\ncmcldebug:\n");
|
fprintf(stderr, "\n\ncmcldebug:\n");
|
||||||
|
@ -630,7 +641,8 @@ int main() {
|
||||||
std::string sysHeadersLower = "program files (x86)\\microsoft ";
|
std::string sysHeadersLower = "program files (x86)\\microsoft ";
|
||||||
while (getline(ss, line)) {
|
while (getline(ss, line)) {
|
||||||
if (startsWith(line, prefix)) {
|
if (startsWith(line, prefix)) {
|
||||||
if (!contains(line, sysHeadersCamel) && !contains(line, sysHeadersLower)) {
|
if (!contains(line, sysHeadersCamel)
|
||||||
|
&& !contains(line, sysHeadersLower)) {
|
||||||
string inc = trimLeadingSpace(line.substr(prefix.size()).c_str());
|
string inc = trimLeadingSpace(line.substr(prefix.size()).c_str());
|
||||||
if (inc[inc.size() - 1] == '\r') // blech, stupid \r\n
|
if (inc[inc.size() - 1] == '\r') // blech, stupid \r\n
|
||||||
inc = inc.substr(0, inc.size() - 1);
|
inc = inc.substr(0, inc.size() - 1);
|
||||||
|
|
Loading…
Reference in New Issue