1
2
3
4 #include <php_config.h>
5
6
7 #ifndef INADDR_NONE
8 # define INADDR_NONE (-1)
9 #endif
10
11
12
13 #ifndef __GNUC__
14 # define __attribute__(x)
15 #endif
16
17
18 #ifndef timerisset
19 # define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
20 #endif
21
22 #ifndef timerclear
23 # define timerclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0)
24 #endif
25
26 #ifndef timersub
27 # define timersub(tvp, uvp, vvp) \
28 do { \
29 (vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \
30 (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \
31 if ((vvp)->tv_usec < 0) { \
32 (vvp)->tv_sec--; \
33 (vvp)->tv_usec += 1000000; \
34 } \
35 } while (0)
36 #endif
37
38 #ifndef timeradd
39 # define timeradd(a, b, result) \
40 do { \
41 (result)->tv_sec = (a)->tv_sec + (b)->tv_sec; \
42 (result)->tv_usec = (a)->tv_usec + (b)->tv_usec; \
43 if ((result)->tv_usec >= 1000000) \
44 { \
45 ++(result)->tv_sec; \
46 (result)->tv_usec -= 1000000; \
47 } \
48 } while (0)
49 #endif
50
51 #ifndef timercmp
52
53 # define timercmp(a, b, CMP) \
54 (((a)->tv_sec == (b)->tv_sec) ? \
55 ((a)->tv_usec CMP (b)->tv_usec) : \
56 ((a)->tv_sec CMP (b)->tv_sec))
57 #endif
58
59
60 #ifndef MIN
61 # define MIN(a,b) (((a)<(b))?(a):(b))
62 #endif
63
64 #ifndef MAX
65 # define MAX(a,b) (((a)>(b))?(a):(b))
66 #endif
67
68 #if defined(HAVE_PTRACE) || defined(PROC_MEM_FILE) || defined(HAVE_MACH_VM_READ)
69 # define HAVE_FPM_TRACE 1
70 #else
71 # define HAVE_FPM_TRACE 0
72 #endif
73
74 #if defined(HAVE_LQ_TCP_INFO) || defined(HAVE_LQ_SO_LISTENQ)
75 # define HAVE_FPM_LQ 1
76 #else
77 # define HAVE_FPM_LQ 0
78 #endif
79