mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
rgbfix: add warning function, separate output between stdout and stderr (lmod)
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <stdarg.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "asmotor.h"
|
#include "asmotor.h"
|
||||||
|
|
||||||
@@ -57,10 +58,35 @@ void PrintUsage(void)
|
|||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FatalError(char *s)
|
void vFatalError(char *s, va_list ap)
|
||||||
{
|
{
|
||||||
printf("\n***ERROR: %s\n\n", s);
|
fprintf(stderr, "*ERROR* : ");
|
||||||
PrintUsage();
|
vfprintf(stderr, s, ap);
|
||||||
|
fprintf(stderr, "\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
void FatalError(char *s, ...)
|
||||||
|
{
|
||||||
|
va_list ap;
|
||||||
|
va_start (ap, s);
|
||||||
|
vFatalError(s, ap);
|
||||||
|
va_end(ap);
|
||||||
|
exit(5);
|
||||||
|
}
|
||||||
|
|
||||||
|
void vWarning(char *s, va_list ap)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "*WARNING* : ");
|
||||||
|
vfprintf(stderr, s, ap);
|
||||||
|
fprintf(stderr, "\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
void Warning(char *s, ...)
|
||||||
|
{
|
||||||
|
va_list ap;
|
||||||
|
va_start(ap, s);
|
||||||
|
vWarning(s, ap);
|
||||||
|
va_end(ap);
|
||||||
}
|
}
|
||||||
|
|
||||||
long int FileSize(FILE * f)
|
long int FileSize(FILE * f)
|
||||||
|
|||||||
Reference in New Issue
Block a user