mirror of
https://github.com/thepigeongenerator/cpusetcores.git
synced 2025-12-17 05:55:46 +01:00
divide main.c into multiple modules
This commit is contained in:
18
src/error.c
Normal file
18
src/error.c
Normal file
@@ -0,0 +1,18 @@
|
||||
#include "error.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdnoreturn.h>
|
||||
|
||||
noreturn void fatal(char const* fmt, ...) {
|
||||
char buf[128];
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
vsnprintf(buf, 128, fmt, args);
|
||||
va_end(args);
|
||||
|
||||
fprintf(stderr, "\033[91mE: %s\033[0m\n", buf);
|
||||
exit(1);
|
||||
}
|
||||
Reference in New Issue
Block a user