nginx-quic/src/core/ngx_config.h

221 lines
3.6 KiB
C
Raw Normal View History

#ifndef _NGX_CONFIG_H_INCLUDED_
#define _NGX_CONFIG_H_INCLUDED_
#include <ngx_auto_config.h>
/*
auto_conf
ngx_inline inline __inline __inline__
*/
2002-12-23 03:29:22 -03:00
/* STUB */
#undef FD_SETSIZE
#define FD_SETSIZE 1024
2002-12-15 03:25:09 -03:00
/* auto_conf */
#define NGX_ALIGN (4 - 1)
#define NGX_ALIGN_TYPE unsigned
#define ngx_align(p) (char *) (((NGX_ALIGN_TYPE) p + NGX_ALIGN) & ~NGX_ALIGN)
2003-01-30 04:28:09 -03:00
/* Platform specific: array[NGX_INVALID_ARRAY_INDEX] should cause SIGSEGV */
#define NGX_INVALID_ARRAY_INDEX 0x80000000
#ifdef _WIN32
#define WIN32 1
#include <winsock2.h>
#include <mswsock.h>
2002-09-02 10:48:24 -04:00
#include <stddef.h> /* offsetof */
#include <stdio.h>
#include <stdarg.h>
#define ngx_inline __inline
2002-08-20 10:48:28 -04:00
#ifndef HAVE_INHERITED_NONBLOCK
#define HAVE_INHERITED_NONBLOCK 1
#endif
#ifndef HAVE_WIN32_TRANSMITPACKETS
#define HAVE_WIN32_TRANSMITPACKETS 1
#define HAVE_WIN32_TRANSMITFILE 0
#endif
#ifndef HAVE_WIN32_TRANSMITFILE
#define HAVE_WIN32_TRANSMITFILE 1
#endif
#if (HAVE_WIN32_TRANSMITPACKETS) || (HAVE_WIN32_TRANSMITFILE)
#define HAVE_SENDFILE 1
#endif
#else /* POSIX */
2002-12-19 14:49:51 -03:00
/* Solaris */
#if defined(sun) && (defined(__svr4__) || defined(__SVR4))
#define SOLARIS 1
#define _FILE_OFFSET_BITS 64 /* should be before sys/types.h */
#ifndef HAVE_INHERITED_NONBLOCK
#define HAVE_INHERITED_NONBLOCK 1
#endif
2002-12-23 15:22:18 -03:00
#include <sys/stropts.h> /* INFTIM */
2002-12-19 14:49:51 -03:00
#endif /* Solaris */
#include <unistd.h>
2002-12-23 15:22:18 -03:00
#include <stddef.h> /* offsetof */
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <fcntl.h>
2002-08-15 13:20:26 -04:00
#include <signal.h>
#include <string.h>
#include <sys/types.h>
2003-05-06 13:03:16 -04:00
#include <sys/mman.h>
2002-08-15 13:20:26 -04:00
#include <sys/wait.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <sys/uio.h>
#include <netinet/in.h>
#include <arpa/inet.h>
2003-04-08 11:40:10 -04:00
#include <netdb.h>
2003-02-06 14:21:13 -03:00
2002-12-23 03:29:22 -03:00
#ifndef HAVE_POLL
#define HAVE_POLL 1
#include <poll.h>
#endif
2002-12-24 14:30:59 -03:00
#if (HAVE_DEVPOLL)
2003-02-06 14:21:13 -03:00
#include <sys/ioctl.h>
2002-12-24 14:30:59 -03:00
#include <sys/devpoll.h> /* Solaris, HP/UX */
#endif
2003-02-06 14:21:13 -03:00
#if (HAVE_AIO)
#include <aio.h>
#endif
#define ngx_inline inline
#endif /* POSIX */
#define LF 10
#define CR 13
#define CRLF "\x0d\x0a"
2002-12-15 18:08:04 -03:00
#ifndef INET_ADDRSTRLEN
#define INET_ADDRSTRLEN 16
#endif
#if defined SO_ACCEPTFILTER || defined TCP_DEFER_ACCEPT
#ifndef HAVE_DEFERRED_ACCEPT
#define HAVE_DEFERRED_ACCEPT 1
#endif
#endif
2002-09-02 10:48:24 -04:00
#ifndef HAVE_SELECT
#define HAVE_SELECT 1
#endif
#ifdef __FreeBSD__
#include <osreldate.h>
2002-08-20 10:48:28 -04:00
#ifndef HAVE_INHERITED_NONBLOCK
#define HAVE_INHERITED_NONBLOCK 1
#endif
2002-12-17 12:48:27 -03:00
/* FreeBSD sendfile */
#if __FreeBSD_version >= 300007
#ifndef HAVE_FREEBSD_SENDFILE
#define HAVE_FREEBSD_SENDFILE 1
#endif
#ifndef HAVE_FREEBSD_SENDFILE_NBYTES_BUG
#define HAVE_FREEBSD_SENDFILE_NBYTES_BUG 2
#endif
2002-12-17 12:48:27 -03:00
#endif /* FreeBSD sendfile */
2002-12-17 12:48:27 -03:00
/* FreeBSD sendfile nbytes bug */
#if (__FreeBSD__ == 4 && __FreeBSD_version >= 460100) \
2003-05-06 13:03:16 -04:00
|| __FreeBSD_version == 460001 \
|| __FreeBSD_version >= 500029
#if (HAVE_FREEBSD_SENDFILE_NBYTES_BUG == 2)
2003-05-06 13:03:16 -04:00
#undef HAVE_FREEBSD_SENDFILE_NBYTES_BUG
#define HAVE_FREEBSD_SENDFILE_NBYTES_BUG 0
#endif
2002-12-17 12:48:27 -03:00
#endif /* FreeBSD sendfile nbytes bug */
#if (HAVE_FREEBSD_SENDFILE)
#define HAVE_SENDFILE 1
#endif
2002-12-17 12:48:27 -03:00
/* FreeBSD kqueue */
#if (__FreeBSD__ == 4 && __FreeBSD_version >= 410000) \
|| __FreeBSD_version >= 500011
#ifndef HAVE_KQUEUE
#define HAVE_KQUEUE 1
#include <sys/event.h>
#endif
2003-03-04 03:33:48 -03:00
/* kqueue's NOTE_LOWAT */
#if (__FreeBSD__ == 4 && __FreeBSD_version >= 430000) \
|| __FreeBSD_version >= 500018
#ifndef HAVE_LOWAT_EVENT
#define HAVE_LOWAT_EVENT 1
#endif
#endif
2002-12-17 12:48:27 -03:00
#endif /* FreeBSD kqueue */
#endif /* __FreeBSD__ */
2002-08-20 10:48:28 -04:00
#ifdef __SOME_OS_TEMPLATE__
#ifndef HAVE_INHERITED_NONBLOCK
#define HAVE_INHERITED_NONBLOCK 1
#endif
#endif
#endif /* _NGX_CONFIG_H_INCLUDED_ */