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