add pic_warnf
This commit is contained in:
parent
8d63fffe87
commit
c3240b9133
|
|
@ -179,13 +179,17 @@ void pic_export(pic_state *, pic_sym);
|
||||||
|
|
||||||
noreturn void pic_abort(pic_state *, const char *);
|
noreturn void pic_abort(pic_state *, const char *);
|
||||||
noreturn void pic_errorf(pic_state *, const char *, ...);
|
noreturn void pic_errorf(pic_state *, const char *, ...);
|
||||||
void pic_warn(pic_state *, const char *);
|
void pic_warnf(pic_state *, const char *, ...);
|
||||||
|
|
||||||
/* obsoleted */
|
/* obsoleted */
|
||||||
noreturn static inline void pic_error(pic_state *pic, const char *msg)
|
noreturn static inline void pic_error(pic_state *pic, const char *msg)
|
||||||
{
|
{
|
||||||
pic_errorf(pic, msg);
|
pic_errorf(pic, msg);
|
||||||
}
|
}
|
||||||
|
static inline void pic_warn(pic_state *pic, const char *msg)
|
||||||
|
{
|
||||||
|
pic_warnf(pic, msg);
|
||||||
|
}
|
||||||
|
|
||||||
const char *pic_errmsg(pic_state *);
|
const char *pic_errmsg(pic_state *);
|
||||||
|
|
||||||
|
|
|
||||||
11
src/error.c
11
src/error.c
|
|
@ -22,11 +22,16 @@ pic_abort(pic_state *pic, const char *msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
pic_warn(pic_state *pic, const char *msg)
|
pic_warnf(pic_state *pic, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
UNUSED(pic);
|
va_list ap;
|
||||||
|
pic_value err_line;
|
||||||
|
|
||||||
fprintf(stderr, "warn: %s\n", msg);
|
va_start(ap, fmt);
|
||||||
|
err_line = pic_vformat(pic, fmt, ap);
|
||||||
|
va_end(ap);
|
||||||
|
|
||||||
|
fprintf(stderr, "warn: %s\n", pic_str_cstr(pic_str_ptr(pic_car(pic, err_line))));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue