mirror of https://github.com/n1nj4sec/pupy.git
36 lines
569 B
C
36 lines
569 B
C
#ifndef __DEBUG_H
|
|
#define __DEBUG_H
|
|
|
|
#include <stdio.h>
|
|
#include <stdarg.h>
|
|
|
|
#ifdef DEBUG
|
|
|
|
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;
|
|
}
|
|
|
|
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
|
|
|
|
#define dprint(...) do {} while (0)
|
|
#define dfprint(...) do {} while (0)
|
|
|
|
#endif
|
|
|
|
static inline
|
|
void dexit(int status) {}
|
|
|
|
#endif /* __DEBUG_H */
|