Fixed many incompatible pointer warnings; add tcc specific debugging flags to makefile

This commit is contained in:
2022-12-14 19:01:42 +00:00
parent 60bf5ca7bc
commit 0b64d0872b
16 changed files with 57 additions and 59 deletions

View File

@@ -5,6 +5,7 @@
#include <string.h>
#include <stdarg.h>
#include <stdlib.h>
#include <unistd.h>
#define logLevel 0
@@ -12,7 +13,7 @@
char *logstr[] = { "INFO", "WARN", "ERROR", "CRITICAL" };
char *catstr[] = {"ENGINE"};
FILE *fout = NULL;
void mYughLog(int category, int priority, int line, const char *file, const char *message, ...)
{
@@ -30,19 +31,15 @@ void mYughLog(int category, int priority, int line, const char *file, const char
char buffer[ERROR_BUFFER] = { '\0' };
snprintf(buffer, ERROR_BUFFER, "%s | %s | %s [ %s:%d ] %s\n", logstr[priority], catstr[0], dt, file, line, msgbuffer);
printf("%s", buffer);
fflush(stdout);
if (fout) {
fprintf(fout, "%s", buffer);
fflush(fout);
}
fprintf(stderr, "%s", buffer);
fprintf(stdout, "%s", buffer);
fflush(stdout);
}
}
void log_setfile(char *file) {
YughInfo("Opening output log %s.", file);
fout = fopen(file, "w");
freopen(file, "w", stderr);
}
void log_cat(FILE *f) {