pupy/client/sources-linux/debug.h

38 lines
642 B
C
Raw Normal View History

#ifndef __DEBUG_H
#define __DEBUG_H
2016-08-23 16:48:10 +00:00
#include <stdio.h>
#include <stdarg.h>
#ifdef DEBUG
2016-08-23 16:48:10 +00:00
static inline int dprint(const char *fmt, ...) {
va_list args;
va_start (args, fmt);
int n = vfprintf(stderr, fmt, args);
va_end (args);
return n;
}
2016-08-23 16:48:10 +00:00
static inline int dfprint(FILE *stream, const char *fmt, ...) {
va_list args;
va_start (args, fmt);
int n = vfprintf(stream, fmt, args);
va_end (args);
return n;
}
#else
2016-08-23 16:48:10 +00:00
#define dprint(...) do {} while (0)
#define dfprint(...) do {} while (0)
#define printf(...) do {} while (0)
#define fprintf(...) do {} while (0)
2016-08-23 16:48:10 +00:00
#endif
2016-08-23 16:48:10 +00:00
static inline
void dexit(int status) {}
#endif /* __DEBUG_H */