Back to home page

Nginx displayed by LXR

Source navigation ]
Diff markup ]
Identifier search ]
general search ]
 
 
Version: nginx-1.13.12 ]​[ nginx-1.12.2 ]​

0001 
0002 /*
0003  * Copyright (C) Igor Sysoev
0004  * Copyright (C) Nginx, Inc.
0005  */
0006 
0007 
0008 #ifndef _NGX_CONFIG_H_INCLUDED_
0009 #define _NGX_CONFIG_H_INCLUDED_
0010 
0011 
0012 #include <ngx_auto_headers.h>
0013 
0014 
0015 #if defined __DragonFly__ && !defined __FreeBSD__
0016 #define __FreeBSD__        4
0017 #define __FreeBSD_version  480101
0018 #endif
0019 
0020 
0021 #if (NGX_FREEBSD)
0022 #include <ngx_freebsd_config.h>
0023 
0024 
0025 #elif (NGX_LINUX)
0026 #include <ngx_linux_config.h>
0027 
0028 
0029 #elif (NGX_SOLARIS)
0030 #include <ngx_solaris_config.h>
0031 
0032 
0033 #elif (NGX_DARWIN)
0034 #include <ngx_darwin_config.h>
0035 
0036 
0037 #elif (NGX_WIN32)
0038 #include <ngx_win32_config.h>
0039 
0040 
0041 #else /* POSIX */
0042 #include <ngx_posix_config.h>
0043 
0044 #endif
0045 
0046 
0047 #ifndef NGX_HAVE_SO_SNDLOWAT
0048 #define NGX_HAVE_SO_SNDLOWAT     1
0049 #endif
0050 
0051 
0052 #if !(NGX_WIN32)
0053 
0054 #define ngx_signal_helper(n)     SIG##n
0055 #define ngx_signal_value(n)      ngx_signal_helper(n)
0056 
0057 #define ngx_random               random
0058 
0059 /* TODO: #ifndef */
0060 #define NGX_SHUTDOWN_SIGNAL      QUIT
0061 #define NGX_TERMINATE_SIGNAL     TERM
0062 #define NGX_NOACCEPT_SIGNAL      WINCH
0063 #define NGX_RECONFIGURE_SIGNAL   HUP
0064 
0065 #if (NGX_LINUXTHREADS)
0066 #define NGX_REOPEN_SIGNAL        INFO
0067 #define NGX_CHANGEBIN_SIGNAL     XCPU
0068 #else
0069 #define NGX_REOPEN_SIGNAL        USR1
0070 #define NGX_CHANGEBIN_SIGNAL     USR2
0071 #endif
0072 
0073 #define ngx_cdecl
0074 #define ngx_libc_cdecl
0075 
0076 #endif
0077 
0078 typedef intptr_t        ngx_int_t;
0079 typedef uintptr_t       ngx_uint_t;
0080 typedef intptr_t        ngx_flag_t;
0081 
0082 
0083 #define NGX_INT32_LEN   (sizeof("-2147483648") - 1)
0084 #define NGX_INT64_LEN   (sizeof("-9223372036854775808") - 1)
0085 
0086 #if (NGX_PTR_SIZE == 4)
0087 #define NGX_INT_T_LEN   NGX_INT32_LEN
0088 #define NGX_MAX_INT_T_VALUE  2147483647
0089 
0090 #else
0091 #define NGX_INT_T_LEN   NGX_INT64_LEN
0092 #define NGX_MAX_INT_T_VALUE  9223372036854775807
0093 #endif
0094 
0095 
0096 #ifndef NGX_ALIGNMENT
0097 #define NGX_ALIGNMENT   sizeof(unsigned long)    /* platform word */
0098 #endif
0099 
0100 #define ngx_align(d, a)     (((d) + (a - 1)) & ~(a - 1))
0101 #define ngx_align_ptr(p, a)                                                   \
0102     (u_char *) (((uintptr_t) (p) + ((uintptr_t) a - 1)) & ~((uintptr_t) a - 1))
0103 
0104 
0105 #define ngx_abort       abort
0106 
0107 
0108 /* TODO: platform specific: array[NGX_INVALID_ARRAY_INDEX] must cause SIGSEGV */
0109 #define NGX_INVALID_ARRAY_INDEX 0x80000000
0110 
0111 
0112 /* TODO: auto_conf: ngx_inline   inline __inline __inline__ */
0113 #ifndef ngx_inline
0114 #define ngx_inline      inline
0115 #endif
0116 
0117 #ifndef INADDR_NONE  /* Solaris */
0118 #define INADDR_NONE  ((unsigned int) -1)
0119 #endif
0120 
0121 #ifdef MAXHOSTNAMELEN
0122 #define NGX_MAXHOSTNAMELEN  MAXHOSTNAMELEN
0123 #else
0124 #define NGX_MAXHOSTNAMELEN  256
0125 #endif
0126 
0127 
0128 #define NGX_MAX_UINT32_VALUE  (uint32_t) 0xffffffff
0129 #define NGX_MAX_INT32_VALUE   (uint32_t) 0x7fffffff
0130 
0131 
0132 #if (NGX_COMPAT)
0133 
0134 #define NGX_COMPAT_BEGIN(slots)  uint64_t spare[slots];
0135 #define NGX_COMPAT_END
0136 
0137 #else
0138 
0139 #define NGX_COMPAT_BEGIN(slots)
0140 #define NGX_COMPAT_END
0141 
0142 #endif
0143 
0144 
0145 #endif /* _NGX_CONFIG_H_INCLUDED_ */