This repository has been archived on 2022-03-22. You can view files and clone it, but cannot push or open issues or pull requests.
elf-padder/src/log.h

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"); \
} \
}