From 2cafe21106dc81d9ec203120ef94e4e35527eaa4 Mon Sep 17 00:00:00 2001 From: jakub Date: Fri, 26 Apr 2013 06:54:54 +0000 Subject: * diagnostic.h (file_name_as_prefix): Add context argument. * diagnostic.c (file_name_as_prefix): Likewise. Colorize the string as locus. * langhooks.c (lhd_print_error_function): Adjust caller. cp/ * error.c (cp_print_error_function): Adjust file_name_as_prefix caller. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@198331 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/diagnostic.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'gcc/diagnostic.c') diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c index e454cf31af2..f9a236b9113 100644 --- a/gcc/diagnostic.c +++ b/gcc/diagnostic.c @@ -72,9 +72,12 @@ build_message_string (const char *msg, ...) /* Same as diagnostic_build_prefix, but only the source FILE is given. */ char * -file_name_as_prefix (const char *f) +file_name_as_prefix (diagnostic_context *context, const char *f) { - return build_message_string ("%s: ", f); + const char *locus_cs + = colorize_start (pp_show_color (context->printer), "locus"); + const char *locus_ce = colorize_stop (pp_show_color (context->printer)); + return build_message_string ("%s%s:%s ", locus_cs, f, locus_ce); } -- cgit v1.2.1