File: debug.h

package info (click to toggle)
libindirect-perl 0.39-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 440 kB
  • sloc: perl: 3,166; ansic: 1,359; makefile: 8
file content (27 lines) | stat: -rw-r--r-- 475 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#ifndef XSH_DEBUG_H
#define XSH_DEBUG_H 1

#include "util.h" /* XSH_PACKAGE, STMT_* */

#ifndef XSH_DEBUG
# define XSH_DEBUG 0
#endif

#if XSH_DEBUG
# define XSH_D(X) STMT_START X STMT_END
static void xsh_debug_log(const char *fmt, ...) {
 va_list va;
 SV *sv;
 dTHX;
 va_start(va, fmt);
 sv = get_sv(XSH_PACKAGE "::DEBUG", 0);
 if (sv && SvTRUE(sv))
  PerlIO_vprintf(Perl_debug_log, fmt, va);
 va_end(va);
 return;
}
#else
# define XSH_D(X)
#endif

#endif /* XSH_DEBUG_H */