mirror of
https://github.com/cesanta/mongoose.git
synced 2024-12-28 15:40:23 +08:00
68 lines
1.2 KiB
C
68 lines
1.2 KiB
C
#pragma once
|
|
|
|
#if MG_ARCH == MG_ARCH_UNIX
|
|
|
|
#define _DARWIN_UNLIMITED_SELECT 1 // No limit on file descriptors
|
|
|
|
#if defined(__APPLE__)
|
|
#include <mach/mach_time.h>
|
|
#endif
|
|
|
|
#if !defined(MG_ENABLE_EPOLL) && defined(__linux__)
|
|
#define MG_ENABLE_EPOLL 1
|
|
#elif !defined(MG_ENABLE_POLL)
|
|
#define MG_ENABLE_POLL 1
|
|
#endif
|
|
|
|
#include <arpa/inet.h>
|
|
#include <ctype.h>
|
|
#include <dirent.h>
|
|
#include <errno.h>
|
|
#include <fcntl.h>
|
|
#include <inttypes.h>
|
|
#include <limits.h>
|
|
#include <netdb.h>
|
|
#include <netinet/in.h>
|
|
#include <netinet/tcp.h>
|
|
#include <signal.h>
|
|
#include <stdarg.h>
|
|
#include <stdbool.h>
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
#if defined(MG_ENABLE_EPOLL) && MG_ENABLE_EPOLL
|
|
#include <sys/epoll.h>
|
|
#elif defined(MG_ENABLE_POLL) && MG_ENABLE_POLL
|
|
#include <poll.h>
|
|
#else
|
|
#include <sys/select.h>
|
|
#endif
|
|
|
|
#include <sys/socket.h>
|
|
#include <sys/stat.h>
|
|
#include <sys/time.h>
|
|
#include <sys/types.h>
|
|
#include <time.h>
|
|
#include <unistd.h>
|
|
|
|
#ifndef MG_ENABLE_DIRLIST
|
|
#define MG_ENABLE_DIRLIST 1
|
|
#endif
|
|
|
|
#ifndef MG_PATH_MAX
|
|
#define MG_PATH_MAX FILENAME_MAX
|
|
#endif
|
|
|
|
#ifndef MG_ENABLE_POSIX_FS
|
|
#define MG_ENABLE_POSIX_FS 1
|
|
#endif
|
|
|
|
#ifndef MG_IO_SIZE
|
|
#define MG_IO_SIZE 16384
|
|
#endif
|
|
|
|
#endif
|