[SOLVED] CS #ifndef DEBUG_H

$25

File Name: CS_#ifndef_DEBUG_H.zip
File Size: 169.56 KB

5/5 - (1 vote)

#ifndef DEBUG_H
#define DEBUG_H

#include

#define NL

#ifdef COLOR
#define KNRM 33[0m
#define KRED 33[1;31m
#define KGRN 33[1;32m
#define KYEL 33[1;33m
#define KBLU 33[1;34m
#define KMAG 33[1;35m
#define KCYN 33[1;36m
#define KWHT 33[1;37m
#define KBWN 33[0;33m
#else
#define KNRM
#define KRED
#define KGRN
#define KYEL
#define KBLU
#define KMAG
#define KCYN
#define KWHT
#define KBWN
#endif

#ifdef VERBOSE
#define DEBUG
#define INFO
#define WARN
#define ERROR
#define SUCCESS
#endif

#ifdef DEBUG
#define debug(S, )
do {
fprintf(stderr, KMAG DEBUG: %s:%s:%d KNRM S NL, __FILE__,
__extension__ __FUNCTION__, __LINE__, ##__VA_ARGS__);
} while (0)
#else
#define debug(S, )
#endif

#ifdef INFO
#define info(S, )
do {
fprintf(stderr, KBLU INFO: %s:%s:%d KNRM S NL, __FILE__,
__extension__ __FUNCTION__, __LINE__, ##__VA_ARGS__);
} while (0)
#else
#define info(S, )
#endif

#ifdef WARN
#define warn(S, )
do {
fprintf(stderr, KYEL WARN: %s:%s:%d KNRM S NL, __FILE__,
__extension__ __FUNCTION__, __LINE__, ##__VA_ARGS__);
} while (0)
#else
#define warn(S, )
#endif

#ifdef SUCCESS
#define success(S, )
do {
fprintf(stderr, KGRN SUCCESS: %s:%s:%d KNRM S NL, __FILE__,
__extension__ __FUNCTION__, __LINE__, ##__VA_ARGS__);
} while (0)
#else
#define success(S, )
#endif

#ifdef ERROR
#define error(S, )
do {
fprintf(stderr, KRED ERROR: %s:%s:%d KNRM S NL, __FILE__,
__extension__ __FUNCTION__, __LINE__, ##__VA_ARGS__);
} while (0)
#else
#define error(S, )
#endif

#endif /* DEBUG_H */

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] CS #ifndef DEBUG_H
$25