half-edge/err.h

35 lines
549 B
C
Raw Normal View History

2014-05-06 21:09:59 +00:00
#ifndef _DROW_ENGINE_ERR_H
#define _DROW_ENGINE_ERR_H
#include <stdio.h>
/**
* @file err.h
* Holds error handling macros.
* @brief error handling
*/
/**
* Abort the program with a given error message.
*/
#define ABORT(...) \
{ \
fprintf(stderr, __VA_ARGS__); \
abort(); \
}
/**
* Used for checking if a pointer is non-NULL
* after allocation.
*/
#define CHECK_PTR_VAL(ptr) \
{ \
if (ptr == NULL) { \
fprintf(stderr,"NULL Pointer in %s [%d]",__FILE__,__LINE__); \
abort(); \
} \
}
#endif /* _DROW_ENGINE_ERR_H */