log functions and working opengl context on windows
This commit is contained in:
17
src/log.c
Normal file
17
src/log.c
Normal file
@@ -0,0 +1,17 @@
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
void log_error(char* file, size_t line, char* str) {
|
||||
fprintf(stderr, "[ERROR] %s:%zu: %s\n", file, line, str);
|
||||
}
|
||||
|
||||
void log_errorf(char* file, size_t line, char* fmt, ...) {
|
||||
fprintf(stderr, "[ERROR] %s:%zu: ", file, line);
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
vfprintf(stderr, fmt, args);
|
||||
va_end(args);
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user