SVN commit 1304577 by lunakl: fix colorify M +1 -1 arg.cpp M +1 -1 client.h M +3 -3 local.cpp M +2 -2 remote.cpp M +2 -2 util.cpp M +3 -1 util.h --- trunk/icecream/client/arg.cpp #1304576:1304577 @@ -410,7 +410,7 @@ always_local = true; // redirecting Clang's output will turn off its automatic coloring, so force it, unless disabled - if (compiler_is_clang(job.language()) && colorify_possible() && !fno_color_diagnostics) + if (compiler_is_clang(job) && colorify_possible() && !fno_color_diagnostics) args.append("-fcolor-diagnostics", Arg_Rest); job.setFlags( args ); --- trunk/icecream/client/client.h #1304576:1304577 @@ -49,7 +49,7 @@ extern int build_local (CompileJob& job, MsgChannel *daemon, struct rusage *usage =0); extern std::string find_compiler( CompileJob::Language lang ); extern std::string find_compiler( const CompileJob& job ); -extern bool compiler_is_clang( CompileJob::Language lang ); +extern bool compiler_is_clang( const CompileJob& job ); /* In remote.cpp - permill is the probability it will be compiled three times */ extern int build_remote (CompileJob &job, MsgChannel *scheduler, const Environments &envs, int permill); --- trunk/icecream/client/local.cpp #1304576:1304577 @@ -143,9 +143,9 @@ return path_lookup(compiler); } -bool compiler_is_clang( CompileJob::Language lang ) +bool compiler_is_clang( const CompileJob& job ) { - return get_compiler_name( lang ).find("clang") != string::npos; + return job.compilerName().find("clang") != string::npos; } static volatile int lock_fd = 0; @@ -225,7 +225,7 @@ } bool color_output = job.language() != CompileJob::Lang_Custom - && colorify_wanted(job.language()); + && colorify_wanted(job); int pf[2]; if (color_output && pipe(pf)) --- trunk/icecream/client/remote.cpp #1304576:1304577 @@ -423,7 +423,7 @@ { write(STDOUT_FILENO, crmsg->out.c_str(), crmsg->out.size() ); - if(colorify_wanted(job.language())) + if(colorify_wanted(job)) colorify_output(crmsg->err); else write(STDERR_FILENO, crmsg->err.c_str(), crmsg->err.size() ); @@ -584,7 +584,7 @@ // older compilers do not support the options we need to make it reproducable #if defined(__GNUC__) && ( ( (__GNUC__ == 3) && (__GNUC_MINOR__ >= 3) ) || (__GNUC__ >=4) ) - if (!compiler_is_clang(job.language())) { + if (!compiler_is_clang(job)) { if ( rand() % 1000 < permill) torepeat = 3; } --- trunk/icecream/client/util.cpp #1304576:1304577 @@ -210,10 +210,10 @@ return isatty(2) && term_env && strcasecmp(term_env, "DUMB"); } -bool colorify_wanted(CompileJob::Language lang) +bool colorify_wanted(const CompileJob& job) { // Clang has coloring, and an explicit option to force it even if output is not a tty. - if (compiler_is_clang(lang)) + if (compiler_is_clang(job)) return false; if (getenv("EMACS")) --- trunk/icecream/client/util.h #1304576:1304577 @@ -22,13 +22,15 @@ #include +class CompileJob; + /* util.c */ extern int set_cloexec_flag (int desc, int value); extern int dcc_ignore_sigpipe (int val); extern std::string find_basename(const std::string &sfile); extern void colorify_output(const std::string &s_ccout); -extern bool colorify_wanted(CompileJob::Language lang); +extern bool colorify_wanted(const CompileJob &job); extern bool colorify_possible(); extern bool dcc_unlock(int lock_fd);