blob: 6078d89c733b49f778787887a0aeb8070e25123a [file] [log] [blame]
Igor Sysoevd90282d2004-09-28 08:34:51 +00001
2/*
Igor Sysoevff8da912004-09-29 16:00:49 +00003 * Copyright (C) Igor Sysoev
Igor Sysoevd90282d2004-09-28 08:34:51 +00004 */
5
6
Igor Sysoev6de5c2c2002-08-06 16:39:45 +00007#ifndef _NGX_CONFIG_H_INCLUDED_
8#define _NGX_CONFIG_H_INCLUDED_
9
10
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000011#include <ngx_auto_headers.h>
12
13
Igor Sysoev732a2712004-04-21 18:54:33 +000014#if defined __DragonFly__ && !defined __FreeBSD__
Igor Sysoev11dbe972004-03-29 17:43:58 +000015#define __FreeBSD__ 4
16#define __FreeBSD_version 480101
17#endif
18
19
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000020#if (NGX_FREEBSD)
Igor Sysoevfa73aac2003-05-21 13:28:21 +000021#include <ngx_freebsd_config.h>
22
23
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000024#elif (NGX_LINUX)
Igor Sysoevfa73aac2003-05-21 13:28:21 +000025#include <ngx_linux_config.h>
26
27
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000028#elif (NGX_SOLARIS)
Igor Sysoevfa73aac2003-05-21 13:28:21 +000029#include <ngx_solaris_config.h>
30
31
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000032#elif (NGX_WIN32)
Igor Sysoevfa73aac2003-05-21 13:28:21 +000033#include <ngx_win32_config.h>
Igor Sysoev6de5c2c2002-08-06 16:39:45 +000034
Igor Sysoev42feecb2002-12-15 06:25:09 +000035
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000036#else /* POSIX */
Igor Sysoevd09f7a12004-06-15 17:47:16 +000037#include <ngx_posix_config.h>
Igor Sysoev25b36fe2004-02-03 16:43:54 +000038
Igor Sysoevfa73aac2003-05-21 13:28:21 +000039#endif
Igor Sysoev42feecb2002-12-15 06:25:09 +000040
41
Igor Sysoev42b12b32004-12-02 18:40:46 +000042#ifndef NGX_HAVE_SO_SNDLOWAT
43#define NGX_HAVE_SO_SNDLOWAT 1
44#endif
45
46
Igor Sysoev1b735832004-11-11 14:07:14 +000047#if !(NGX_WIN32)
Igor Sysoeva7f7fa82003-07-11 04:50:59 +000048
Igor Sysoev3c3ca172004-01-05 20:55:48 +000049#define ngx_signal_helper(n) SIG##n
50#define ngx_signal_value(n) ngx_signal_helper(n)
Igor Sysoeva7f7fa82003-07-11 04:50:59 +000051
52/* TODO: #ifndef */
Igor Sysoev3c3ca172004-01-05 20:55:48 +000053#define NGX_SHUTDOWN_SIGNAL QUIT
54#define NGX_TERMINATE_SIGNAL TERM
Igor Sysoevb54698b2004-02-23 20:57:12 +000055#define NGX_NOACCEPT_SIGNAL WINCH
Igor Sysoevf2954c32004-01-08 21:02:06 +000056#define NGX_RECONFIGURE_SIGNAL HUP
Igor Sysoev8e811c12004-07-07 19:48:31 +000057
58#if (NGX_LINUXTHREADS)
59#define NGX_REOPEN_SIGNAL INFO
60#define NGX_CHANGEBIN_SIGNAL XCPU
61#else
Igor Sysoevf2954c32004-01-08 21:02:06 +000062#define NGX_REOPEN_SIGNAL USR1
Igor Sysoev3c3ca172004-01-05 20:55:48 +000063#define NGX_CHANGEBIN_SIGNAL USR2
Igor Sysoev8e811c12004-07-07 19:48:31 +000064#endif
Igor Sysoeva7f7fa82003-07-11 04:50:59 +000065
Igor Sysoev4d656dc2005-03-22 16:02:46 +000066#define ngx_cdecl
67#define ngx_libc_cdecl
68
Igor Sysoeva7f7fa82003-07-11 04:50:59 +000069#endif
70
71
72
Igor Sysoevfa73aac2003-05-21 13:28:21 +000073/* TODO: platform specific: array[NGX_INVALID_ARRAY_INDEX] must cause SIGSEGV */
Igor Sysoev86de4cb2003-01-30 07:28:09 +000074#define NGX_INVALID_ARRAY_INDEX 0x80000000
75
76
Igor Sysoev2f657222004-06-16 15:32:11 +000077#if 1
78/* STUB: autoconf */
Igor Sysoevc31a9bb2005-11-26 10:11:11 +000079typedef int ngx_int_t;
80typedef u_int ngx_uint_t;
81typedef int ngx_flag_t;
82#define NGX_INT_T_LEN sizeof("-2147483648") - 1
Igor Sysoev2f657222004-06-16 15:32:11 +000083
84#else
85
Igor Sysoevc31a9bb2005-11-26 10:11:11 +000086typedef long ngx_int_t;
87typedef u_long ngx_uint_t;
88typedef long ngx_flag_t;
89#define NGX_INT_T_LEN sizeof("-9223372036854775808") - 1
Igor Sysoev2f657222004-06-16 15:32:11 +000090
91#endif
92
Igor Sysoevc31a9bb2005-11-26 10:11:11 +000093#define NGX_INT32_LEN sizeof("-2147483648") - 1
94#define NGX_INT64_LEN sizeof("-9223372036854775808") - 1
Igor Sysoev3c3ca172004-01-05 20:55:48 +000095
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000096
Igor Sysoevc31a9bb2005-11-26 10:11:11 +000097#ifndef NGX_ALIGNMENT
98#define NGX_ALIGNMENT sizeof(unsigned long) /* platform word */
Igor Sysoev85cccfb2004-09-15 16:00:43 +000099#endif
100
Igor Sysoev24025022005-12-16 15:07:08 +0000101#define ngx_align(d, a) (((d) + (a - 1)) & ~(a - 1))
Igor Sysoev9e580192006-02-01 18:22:15 +0000102#define ngx_align_ptr(p, a) \
103 (u_char *) (((uintptr_t) (p) + ((uintptr_t) a - 1)) & ~((uintptr_t) a - 1))
Igor Sysoev6de5c2c2002-08-06 16:39:45 +0000104
105
Igor Sysoevc2068d02005-10-19 12:33:58 +0000106#define ngx_abort abort
107
108
Igor Sysoevfa73aac2003-05-21 13:28:21 +0000109/* TODO: auto_conf: ngx_inline inline __inline __inline__ */
110#ifndef ngx_inline
Igor Sysoevc31a9bb2005-11-26 10:11:11 +0000111#define ngx_inline inline
Igor Sysoevfa73aac2003-05-21 13:28:21 +0000112#endif
Igor Sysoev6de5c2c2002-08-06 16:39:45 +0000113
Igor Sysoevea521232004-07-26 16:21:18 +0000114#define NGX_ACCEPT_THRESHOLD 100
Igor Sysoev732a2712004-04-21 18:54:33 +0000115
Igor Sysoev09159772003-06-12 05:54:39 +0000116#ifndef INADDR_NONE /* Solaris */
117#define INADDR_NONE ((unsigned int) -1)
Igor Sysoevfa73aac2003-05-21 13:28:21 +0000118#endif
Igor Sysoev6de5c2c2002-08-06 16:39:45 +0000119
Igor Sysoev09159772003-06-12 05:54:39 +0000120#ifndef INET_ADDRSTRLEN /* Win32 */
121#define INET_ADDRSTRLEN 16
Igor Sysoev5eef6182002-12-15 21:08:04 +0000122#endif
123
Igor Sysoevd90282d2004-09-28 08:34:51 +0000124#define NGX_MAXHOSTNAMELEN 64
125/*
126#define NGX_MAXHOSTNAMELEN MAXHOSTNAMELEN
127*/
128
Igor Sysoev6de5c2c2002-08-06 16:39:45 +0000129
Igor Sysoev069899b2004-11-26 09:33:59 +0000130#if ((__GNU__ == 2) && (__GNUC_MINOR__ < 8))
Igor Sysoev4959ec42005-05-23 12:07:45 +0000131#define NGX_MAX_UINT32_VALUE (uint32_t) 0xffffffffLL
Igor Sysoev069899b2004-11-26 09:33:59 +0000132#else
Igor Sysoev4959ec42005-05-23 12:07:45 +0000133#define NGX_MAX_UINT32_VALUE (uint32_t) 0xffffffff
Igor Sysoev069899b2004-11-26 09:33:59 +0000134#endif
135
136
Igor Sysoev6de5c2c2002-08-06 16:39:45 +0000137#endif /* _NGX_CONFIG_H_INCLUDED_ */