17 lines
443 B
C
17 lines
443 B
C
#pragma once
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
// Logging
|
|
#define INFO(format, ...) { fprintf(stderr, "[INFO]: " format "\n", __VA_ARGS__); }
|
|
#define ERR(format, ...) { fprintf(stderr, "[ERR]: (%s:%i): " format "\n", __FILE__, __LINE__, __VA_ARGS__); exit(EXIT_FAILURE); }
|
|
|
|
// Check Memory Allocation
|
|
#define ALLOC_CHECK(obj) \
|
|
{ \
|
|
if (obj == NULL) { \
|
|
ERR("%s", "Memory Allocation Failed"); \
|
|
} \
|
|
}
|