File: ntp_debug.h

package info (click to toggle)
ntpsec 1.2.3%2Bdfsg1-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 10,960 kB
  • sloc: ansic: 62,004; python: 32,017; sh: 1,553; yacc: 1,293; makefile: 190; javascript: 138
file content (29 lines) | stat: -rw-r--r-- 692 bytes parent folder | download | duplicates (3)
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
28
29
/*
 * Copyright Frank Kardel
 * Copyright the NTPsec project contributors
 * SPDX-License-Identifier: BSD-2-Clause
 */
#ifndef GUARD_NTP_DEBUG_H
#define GUARD_NTP_DEBUG_H

/*
 * macro for debugging output - cut down on #ifdef pollution.
 *
 * DPRINT() is the new one debug logger to rule them all.
 *
 * The calling convention is not attractive:
 *     DPRINT(debuglevel, (fmt, ...));
 *     DPRINT(2, ("this will appear on stdout if debug >= %d\n", 2));
 */
#ifdef DEBUG
extern int debug;
#define DPRINT(lvl, arg)					\
	do { 						\
		if (debug >= (lvl))			\
			printf arg;			\
	} while (0)
#else
#define DPRINT(lvl, arg)	do {} while (0)
#endif  /* DEBUG */

#endif	/* GUARD_NTP_DEBUG_H */