3 * Copyright (C) Igor Sysoev
7 #ifndef _NGX_CONFIG_H_INCLUDED_
8 #define _NGX_CONFIG_H_INCLUDED_
11 #include <ngx_auto_headers.h>
14 #if defined __DragonFly__ && !defined __FreeBSD__
16 #define __FreeBSD_version 480101
21 #include <ngx_freebsd_config.h>
25 #include <ngx_linux_config.h>
29 #include <ngx_solaris_config.h>
33 #include <ngx_darwin_config.h>
37 #include <ngx_win32_config.h>
41 #include <ngx_posix_config.h>
46 #ifndef NGX_HAVE_SO_SNDLOWAT
47 #define NGX_HAVE_SO_SNDLOWAT 1
53 #define ngx_signal_helper(n) SIG##n
54 #define ngx_signal_value(n) ngx_signal_helper(n)
56 #define ngx_random random
59 #define NGX_SHUTDOWN_SIGNAL QUIT
60 #define NGX_TERMINATE_SIGNAL TERM
61 #define NGX_NOACCEPT_SIGNAL WINCH
62 #define NGX_RECONFIGURE_SIGNAL HUP
64 #if (NGX_LINUXTHREADS)
65 #define NGX_REOPEN_SIGNAL INFO
66 #define NGX_CHANGEBIN_SIGNAL XCPU
68 #define NGX_REOPEN_SIGNAL USR1
69 #define NGX_CHANGEBIN_SIGNAL USR2
73 #define ngx_libc_cdecl
77 typedef intptr_t ngx_int_t;
78 typedef uintptr_t ngx_uint_t;
79 typedef intptr_t ngx_flag_t;
82 #define NGX_INT32_LEN sizeof("-2147483648") - 1
83 #define NGX_INT64_LEN sizeof("-9223372036854775808") - 1
85 #if (NGX_PTR_SIZE == 4)
86 #define NGX_INT_T_LEN NGX_INT32_LEN
88 #define NGX_INT_T_LEN NGX_INT64_LEN
93 #define NGX_ALIGNMENT sizeof(unsigned long) /* platform word */
96 #define ngx_align(d, a) (((d) + (a - 1)) & ~(a - 1))
97 #define ngx_align_ptr(p, a) \
98 (u_char *) (((uintptr_t) (p) + ((uintptr_t) a - 1)) & ~((uintptr_t) a - 1))
101 #define ngx_abort abort
104 /* TODO: platform specific: array[NGX_INVALID_ARRAY_INDEX] must cause SIGSEGV */
105 #define NGX_INVALID_ARRAY_INDEX 0x80000000
108 /* TODO: auto_conf: ngx_inline inline __inline __inline__ */
110 #define ngx_inline inline
113 #ifndef INADDR_NONE /* Solaris */
114 #define INADDR_NONE ((unsigned int) -1)
117 #ifdef MAXHOSTNAMELEN
118 #define NGX_MAXHOSTNAMELEN MAXHOSTNAMELEN
120 #define NGX_MAXHOSTNAMELEN 256
124 #if ((__GNU__ == 2) && (__GNUC_MINOR__ < 8))
125 #define NGX_MAX_UINT32_VALUE (uint32_t) 0xffffffffLL
127 #define NGX_MAX_UINT32_VALUE (uint32_t) 0xffffffff
131 #endif /* _NGX_CONFIG_H_INCLUDED_ */