mongoose/src/arch_unix.h

68 lines
1.2 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
#ifndef MG_PATH_MAX
#define MG_PATH_MAX FILENAME_MAX
#endif
2024-08-14 05:26:08 +01:00
#ifndef MG_ENABLE_POSIX_FS
#define MG_ENABLE_POSIX_FS 1
#endif
2024-08-30 12:20:09 +01:00
#ifndef MG_IO_SIZE
#define MG_IO_SIZE 16384
#endif
2020-12-05 11:26:32 +00:00
#endif