Change error/warning functions to print to the info log.
This commit is contained in:
parent
ca97bd395f
commit
b2ba6fac09
2 changed files with 31 additions and 29 deletions
|
|
@ -22,6 +22,11 @@
|
|||
*/
|
||||
#include <cstdio>
|
||||
#include <cstdarg>
|
||||
|
||||
extern "C" {
|
||||
#include <talloc.h>
|
||||
}
|
||||
|
||||
#include "ir_reader.h"
|
||||
#include "glsl_parser_extras.h"
|
||||
#include "glsl_types.h"
|
||||
|
|
@ -86,17 +91,18 @@ ir_read_error(_mesa_glsl_parse_state *state, s_expression *expr,
|
|||
|
||||
state->error = true;
|
||||
|
||||
printf("error: ");
|
||||
state->info_log = talloc_strdup_append(state->info_log, "error: ");
|
||||
|
||||
va_start(ap, fmt);
|
||||
vprintf(fmt, ap);
|
||||
state->info_log = talloc_vasprintf_append(state->info_log, fmt, ap);
|
||||
va_end(ap);
|
||||
printf("\n");
|
||||
state->info_log = talloc_strdup_append(state->info_log, "\n");
|
||||
|
||||
if (expr != NULL) {
|
||||
printf("...in this context:\n ");
|
||||
state->info_log = talloc_strdup_append(state->info_log,
|
||||
"...in this context:\n ");
|
||||
expr->print();
|
||||
printf("\n\n");
|
||||
state->info_log = talloc_strdup_append(state->info_log, "\n\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue