0
|
1
|
|
2 /*
|
|
3 * Copyright (C) Igor Sysoev
|
660
|
4 * Copyright (C) Nginx, Inc.
|
0
|
5 */
|
|
6
|
|
7
|
|
8 #ifndef _NGX_CONFIG_H_INCLUDED_
|
|
9 #define _NGX_CONFIG_H_INCLUDED_
|
|
10
|
|
11
|
4
|
12 #include <ngx_auto_headers.h>
|
|
13
|
|
14
|
0
|
15 #if defined __DragonFly__ && !defined __FreeBSD__
|
|
16 #define __FreeBSD__ 4
|
|
17 #define __FreeBSD_version 480101
|
|
18 #endif
|
|
19
|
|
20
|
4
|
21 #if (NGX_FREEBSD)
|
0
|
22 #include <ngx_freebsd_config.h>
|
|
23
|
|
24
|
4
|
25 #elif (NGX_LINUX)
|
0
|
26 #include <ngx_linux_config.h>
|
|
27
|
|
28
|
4
|
29 #elif (NGX_SOLARIS)
|
0
|
30 #include <ngx_solaris_config.h>
|
|
31
|
|
32
|
390
|
33 #elif (NGX_DARWIN)
|
|
34 #include <ngx_darwin_config.h>
|
|
35
|
|
36
|
4
|
37 #elif (NGX_WIN32)
|
0
|
38 #include <ngx_win32_config.h>
|
|
39
|
|
40
|
4
|
41 #else /* POSIX */
|
0
|
42 #include <ngx_posix_config.h>
|
|
43
|
|
44 #endif
|
|
45
|
|
46
|
22
|
47 #ifndef NGX_HAVE_SO_SNDLOWAT
|
|
48 #define NGX_HAVE_SO_SNDLOWAT 1
|
|
49 #endif
|
|
50
|
|
51
|
10
|
52 #if !(NGX_WIN32)
|
0
|
53
|
|
54 #define ngx_signal_helper(n) SIG##n
|
|
55 #define ngx_signal_value(n) ngx_signal_helper(n)
|
|
56
|
250
|
57 #define ngx_random random
|
|
58
|
0
|
59 /* TODO: #ifndef */
|
|
60 #define NGX_SHUTDOWN_SIGNAL QUIT
|
|
61 #define NGX_TERMINATE_SIGNAL TERM
|
|
62 #define NGX_NOACCEPT_SIGNAL WINCH
|
|
63 #define NGX_RECONFIGURE_SIGNAL HUP
|
|
64
|
|
65 #if (NGX_LINUXTHREADS)
|
|
66 #define NGX_REOPEN_SIGNAL INFO
|
|
67 #define NGX_CHANGEBIN_SIGNAL XCPU
|
|
68 #else
|
|
69 #define NGX_REOPEN_SIGNAL USR1
|
|
70 #define NGX_CHANGEBIN_SIGNAL USR2
|
|
71 #endif
|
|
72
|
52
|
73 #define ngx_cdecl
|
|
74 #define ngx_libc_cdecl
|
|
75
|
0
|
76 #endif
|
|
77
|
324
|
78 typedef intptr_t ngx_int_t;
|
|
79 typedef uintptr_t ngx_uint_t;
|
|
80 typedef intptr_t ngx_flag_t;
|
0
|
81
|
|
82
|
130
|
83 #define NGX_INT32_LEN sizeof("-2147483648") - 1
|
|
84 #define NGX_INT64_LEN sizeof("-9223372036854775808") - 1
|
0
|
85
|
324
|
86 #if (NGX_PTR_SIZE == 4)
|
|
87 #define NGX_INT_T_LEN NGX_INT32_LEN
|
|
88 #else
|
|
89 #define NGX_INT_T_LEN NGX_INT64_LEN
|
|
90 #endif
|
|
91
|
4
|
92
|
130
|
93 #ifndef NGX_ALIGNMENT
|
|
94 #define NGX_ALIGNMENT sizeof(unsigned long) /* platform word */
|
0
|
95 #endif
|
|
96
|
138
|
97 #define ngx_align(d, a) (((d) + (a - 1)) & ~(a - 1))
|
154
|
98 #define ngx_align_ptr(p, a) \
|
|
99 (u_char *) (((uintptr_t) (p) + ((uintptr_t) a - 1)) & ~((uintptr_t) a - 1))
|
0
|
100
|
|
101
|
112
|
102 #define ngx_abort abort
|
|
103
|
|
104
|
324
|
105 /* TODO: platform specific: array[NGX_INVALID_ARRAY_INDEX] must cause SIGSEGV */
|
|
106 #define NGX_INVALID_ARRAY_INDEX 0x80000000
|
|
107
|
|
108
|
0
|
109 /* TODO: auto_conf: ngx_inline inline __inline __inline__ */
|
|
110 #ifndef ngx_inline
|
130
|
111 #define ngx_inline inline
|
0
|
112 #endif
|
|
113
|
|
114 #ifndef INADDR_NONE /* Solaris */
|
|
115 #define INADDR_NONE ((unsigned int) -1)
|
|
116 #endif
|
|
117
|
376
|
118 #ifdef MAXHOSTNAMELEN
|
|
119 #define NGX_MAXHOSTNAMELEN MAXHOSTNAMELEN
|
|
120 #else
|
|
121 #define NGX_MAXHOSTNAMELEN 256
|
|
122 #endif
|
0
|
123
|
|
124
|
20
|
125 #if ((__GNU__ == 2) && (__GNUC_MINOR__ < 8))
|
66
|
126 #define NGX_MAX_UINT32_VALUE (uint32_t) 0xffffffffLL
|
20
|
127 #else
|
66
|
128 #define NGX_MAX_UINT32_VALUE (uint32_t) 0xffffffff
|
20
|
129 #endif
|
|
130
|
632
|
131 #define NGX_MAX_INT32_VALUE (uint32_t) 0x7fffffff
|
|
132
|
20
|
133
|
0
|
134 #endif /* _NGX_CONFIG_H_INCLUDED_ */
|