Skip to content

Commit 6cec47a

Browse files
committed
1 parent 48b6bf9 commit 6cec47a

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

debug.h

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#ifndef DEBUG_H
2+
#define DEBUG_H 1
3+
4+
#include <ngx_config.h>
5+
#include <ngx_core.h>
6+
7+
#if defined(NGX_DEBUG)
8+
9+
# if (NGX_HAVE_VARIADIC_MACROS)
10+
# define dd(...) do { \
11+
fprintf(stderr, "tnt *** "); \
12+
fprintf(stderr, __VA_ARGS__); \
13+
fprintf(stderr, " at %s line %d.\n", __FILE__, __LINE__); \
14+
} while(0)
15+
# else
16+
17+
#include <stdarg.h>
18+
#include <stdio.h>
19+
#include <stdarg.h>
20+
21+
static void dd(const char* fmt, ...) {
22+
}
23+
24+
# endif
25+
26+
#else
27+
28+
# if (NGX_HAVE_VARIADIC_MACROS)
29+
# define dd(...)
30+
# else
31+
32+
#include <stdarg.h>
33+
34+
static void dd(const char* fmt, ...) {
35+
}
36+
37+
# endif
38+
39+
#endif // NGX_DEBUG
40+
41+
#endif

0 commit comments

Comments
 (0)