2014-05-20 12:33:19 -04:00
|
|
|
/*
|
|
|
|
* r3_define.h
|
|
|
|
* Copyright (C) 2014 c9s <c9s@c9smba.local>
|
|
|
|
*
|
|
|
|
* Distributed under terms of the MIT license.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef DEFINE_H
|
|
|
|
#define DEFINE_H
|
2014-05-26 12:47:21 -04:00
|
|
|
#include <stdbool.h>
|
2014-05-20 12:33:19 -04:00
|
|
|
|
|
|
|
#ifndef bool
|
|
|
|
typedef unsigned char bool;
|
|
|
|
#endif
|
|
|
|
#ifndef FALSE
|
|
|
|
# define FALSE 0
|
|
|
|
#endif
|
|
|
|
#ifndef TRUE
|
|
|
|
# define TRUE 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// #define DEBUG 1
|
|
|
|
#ifdef DEBUG
|
|
|
|
|
|
|
|
#define info(fmt, ...) \
|
|
|
|
do { fprintf(stderr, fmt, __VA_ARGS__); } while (0)
|
|
|
|
|
|
|
|
#define debug(fmt, ...) \
|
|
|
|
do { fprintf(stderr, "%s:%d:%s(): " fmt, __FILE__, \
|
|
|
|
__LINE__, __func__, __VA_ARGS__); } while (0)
|
|
|
|
|
|
|
|
#else
|
|
|
|
#define info(...);
|
|
|
|
#define debug(...);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* !DEFINE_H */
|