nginx 0.1.11
[nginx-catap.git] / src / core / ngx_config.h
blobb72add7f71e0a7bb43675581de2e7bf777734339
2 /*
3 * Copyright (C) Igor Sysoev
4 */
7 #ifndef _NGX_CONFIG_H_INCLUDED_
8 #define _NGX_CONFIG_H_INCLUDED_
11 #include <ngx_auto_headers.h>
14 #if defined __DragonFly__ && !defined __FreeBSD__
15 #define __FreeBSD__ 4
16 #define __FreeBSD_version 480101
17 #endif
20 #if (NGX_FREEBSD)
21 #include <ngx_freebsd_config.h>
24 #elif (NGX_LINUX)
25 #include <ngx_linux_config.h>
28 #elif (NGX_SOLARIS)
29 #include <ngx_solaris_config.h>
32 #elif (NGX_WIN32)
33 #include <ngx_win32_config.h>
36 #else /* POSIX */
37 #include <ngx_posix_config.h>
39 #endif
42 #ifndef NGX_HAVE_SO_SNDLOWAT
43 #define NGX_HAVE_SO_SNDLOWAT 1
44 #endif
47 #if !(NGX_WIN32)
49 #define ngx_signal_helper(n) SIG##n
50 #define ngx_signal_value(n) ngx_signal_helper(n)
52 /* TODO: #ifndef */
53 #define NGX_SHUTDOWN_SIGNAL QUIT
54 #define NGX_TERMINATE_SIGNAL TERM
55 #define NGX_NOACCEPT_SIGNAL WINCH
56 #define NGX_RECONFIGURE_SIGNAL HUP
58 #if (NGX_LINUXTHREADS)
59 #define NGX_REOPEN_SIGNAL INFO
60 #define NGX_CHANGEBIN_SIGNAL XCPU
61 #else
62 #define NGX_REOPEN_SIGNAL USR1
63 #define NGX_CHANGEBIN_SIGNAL USR2
64 #endif
66 #endif
70 /* TODO: platform specific: array[NGX_INVALID_ARRAY_INDEX] must cause SIGSEGV */
71 #define NGX_INVALID_ARRAY_INDEX 0x80000000
74 #if 1
75 /* STUB: autoconf */
76 typedef int ngx_int_t;
77 typedef u_int ngx_uint_t;
78 typedef int ngx_flag_t;
79 #define NGX_INT_T_LEN sizeof("-2147483648") - 1
81 #else
83 typedef long ngx_int_t;
84 typedef u_long ngx_uint_t;
85 typedef long ngx_flag_t;
86 #define NGX_INT_T_LEN sizeof("-9223372036854775808") - 1
88 #endif
90 /* TODO: auto */
91 #define NGX_INT32_LEN sizeof("-2147483648") - 1
92 #define NGX_INT64_LEN sizeof("-9223372036854775808") - 1
93 #define NGX_OFF_T_LEN sizeof("-9223372036854775808") - 1
95 #define NGX_MAX_INT_LEN (sizeof("-9223372036854775808") - 1)
98 #if (NGX_SOLARIS)
100 /* TODO: auto_conf */
101 #define NGX_ALIGN (_MAX_ALIGNMENT - 1) /* platform word */
102 #define NGX_ALIGN_CAST (unsigned long) /* size of the pointer */
104 #else
106 /* TODO: auto_conf */
107 #define NGX_ALIGN (sizeof(unsigned long) - 1) /* platform word */
108 #define NGX_ALIGN_CAST (unsigned long) /* size of the pointer */
110 #endif
112 #define ngx_align(p) (char *) ((NGX_ALIGN_CAST p + NGX_ALIGN) & ~NGX_ALIGN)
115 /* TODO: auto_conf: ngx_inline inline __inline __inline__ */
116 #ifndef ngx_inline
117 #define ngx_inline __inline
118 #endif
120 #define NGX_ACCEPT_THRESHOLD 100
122 #ifndef INADDR_NONE /* Solaris */
123 #define INADDR_NONE ((unsigned int) -1)
124 #endif
126 #ifndef INET_ADDRSTRLEN /* Win32 */
127 #define INET_ADDRSTRLEN 16
128 #endif
130 #define NGX_MAXHOSTNAMELEN 64
132 #define NGX_MAXHOSTNAMELEN MAXHOSTNAMELEN
136 #if ((__GNU__ == 2) && (__GNUC_MINOR__ < 8))
137 #define NGX_MAX_UINT32_VALUE 0xffffffffLL
138 #else
139 #define NGX_MAX_UINT32_VALUE 0xffffffff
140 #endif
143 #endif /* _NGX_CONFIG_H_INCLUDED_ */