so3_error.h
Go to the documentation of this file.00001
00002
00003
00004
00012 #ifndef SO3_ERROR
00013 #define SO3_ERROR
00014
00015 #include <stdio.h>
00016
00017
00018
00019 #define SO3_ERROR_GENERIC(comment) \
00020 { \
00021 printf("ERROR: %s.\n", comment); \
00022 printf("ERROR: %s <%s> %s %s %s %d.\n", \
00023 "Occurred in function", \
00024 __PRETTY_FUNCTION__, \
00025 "of file", __FILE__, \
00026 "on line", __LINE__); \
00027 exit(1); \
00028 }
00029
00030 #define SO3_ERROR_MEM_ALLOC_CHECK(pointer) \
00031 if(pointer == NULL) { \
00032 SO3_ERROR_GENERIC("Memory allocation failed") \
00033 }
00034
00035 #endif