vasprintf() doesnt exist under Win32 :(
This commit is contained in:
parent
20f8cd471d
commit
f4f2dfd4ad
@ -1188,17 +1188,10 @@ void Warning_message(char * message)
|
|||||||
/// This has the added advantage of supporting the printf interface.
|
/// This has the added advantage of supporting the printf interface.
|
||||||
void Warning_with_format(const char *template, ...) {
|
void Warning_with_format(const char *template, ...) {
|
||||||
va_list arg_ptr;
|
va_list arg_ptr;
|
||||||
char *message;
|
static char message[400]; // This is enough for 10 lines of text in 320x200
|
||||||
|
|
||||||
va_start(arg_ptr, template);
|
va_start(arg_ptr, template);
|
||||||
if (vasprintf(&message, template, arg_ptr) == -1) {
|
vsnprintf(message, sizeof(message), template, arg_ptr);
|
||||||
//Warning_message(template);
|
|
||||||
Verbose_message("Warning", template);
|
|
||||||
} else {
|
|
||||||
//Warning_message(message);
|
|
||||||
Verbose_message("Warning", message);
|
|
||||||
free(message);
|
|
||||||
}
|
|
||||||
va_end(arg_ptr);
|
va_end(arg_ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user