Lephisto/src/log.h
Allanis a17b7792f3 [Add] Support for FreeBSD. Had to play around with the physics slightly
as FreeBSD didn't like the optimizations in Runge-Kuta forcing it to
eventually become NaN.
2014-04-10 01:07:20 +01:00

24 lines
658 B
C

#pragma once
#include <stdio.h>
#include <signal.h>
#define LOG(str, args...)(fprintf(stdout, str"\n", ## args))
#ifdef DEBUG_PARANOID /* Will cause WARN's to blow up. */
#define WARN(str, args...)(fprintf(stderr, "Warning: [%s] "str"\n", __func__, ## args), \
abort())
#else
#define WARN(str, args...)(fprintf(stderr, "Warning: [%s] "str"\n", __func__, ## args))
#endif
#define ERR(str, args...) (fprintf(stderr, "ERROR %s:%d: [%s] "str"\n", \
__FILE__, __LINE__, __func__, ## args), abort())
#ifdef DEBUG
# undef DEBUG
# define DEBUG(str, args...) LOG(str, ## args)
# define DEBUGGING
#else
# define DEBUG(str, args...) do {;} while(0)
#endif