mongoose/src/arch_unix.h

56 lines
1.0 KiB
C
Raw Normal View History

2020-12-05 11:26:32 +00:00
#pragma once
#if MG_ARCH == MG_ARCH_UNIX
2021-07-24 10:35:48 +01:00
#define _DARWIN_UNLIMITED_SELECT 1 // No limit on file descriptors
2020-12-05 11:26:32 +00:00
2022-07-01 17:28:06 +01:00
#if defined(__APPLE__)
#include <mach/mach_time.h>
#endif
2022-08-03 15:07:16 +01:00
#if !defined(MG_ENABLE_EPOLL) && defined(__linux__)
#define MG_ENABLE_EPOLL 1
#elif !defined(MG_ENABLE_POLL)
#define MG_ENABLE_POLL 1
#endif
2020-12-05 11:26:32 +00:00
#include <arpa/inet.h>
#include <ctype.h>
2020-12-05 11:26:32 +00:00
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <inttypes.h>
#include <limits.h>
2020-12-05 11:26:32 +00:00
#include <netdb.h>
2022-01-24 02:20:45 +00:00
#include <netinet/in.h>
2020-12-05 11:26:32 +00:00
#include <netinet/tcp.h>
#include <signal.h>
#include <stdarg.h>
2020-12-05 11:26:32 +00:00
#include <stdbool.h>
#include <stddef.h>
2020-12-05 11:26:32 +00:00
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
2022-08-03 15:07:16 +01:00
#if defined(MG_ENABLE_EPOLL) && MG_ENABLE_EPOLL
#include <sys/epoll.h>
#elif defined(MG_ENABLE_POLL) && MG_ENABLE_POLL
#include <poll.h>
#else
2020-12-05 11:26:32 +00:00
#include <sys/select.h>
#endif
2022-08-03 15:07:16 +01:00
2020-12-05 11:26:32 +00:00
#include <sys/socket.h>
#include <sys/stat.h>
2020-12-05 11:26:32 +00:00
#include <sys/time.h>
#include <sys/types.h>
#include <time.h>
2020-12-05 11:26:32 +00:00
#include <unistd.h>
2022-02-14 11:32:01 +00:00
#ifndef MG_ENABLE_DIRLIST
#define MG_ENABLE_DIRLIST 1
#endif
2020-12-05 11:26:32 +00:00
#endif