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)
|
2022-05-26 08:55:28 +01:00
|
|
|
#define MG_ENABLE_POLL 1
|
|
|
|
#endif
|
|
|
|
|
2020-12-05 11:26:32 +00:00
|
|
|
#include <arpa/inet.h>
|
2021-03-13 12:34:26 +00:00
|
|
|
#include <ctype.h>
|
2020-12-05 11:26:32 +00:00
|
|
|
#include <dirent.h>
|
2021-03-13 12:34:26 +00:00
|
|
|
#include <errno.h>
|
|
|
|
#include <fcntl.h>
|
2021-01-26 17:43:31 +00:00
|
|
|
#include <inttypes.h>
|
2021-03-13 12:34:26 +00:00
|
|
|
#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>
|
2021-03-13 12:34:26 +00:00
|
|
|
#include <stdarg.h>
|
2020-12-05 11:26:32 +00:00
|
|
|
#include <stdbool.h>
|
2021-03-13 12:34:26 +00:00
|
|
|
#include <stddef.h>
|
2020-12-05 11:26:32 +00:00
|
|
|
#include <stdint.h>
|
2021-03-13 12:34:26 +00:00
|
|
|
#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
|
2022-05-25 00:43:22 +03:00
|
|
|
#include <poll.h>
|
|
|
|
#else
|
2020-12-05 11:26:32 +00:00
|
|
|
#include <sys/select.h>
|
2022-05-25 00:43:22 +03:00
|
|
|
#endif
|
2022-08-03 15:07:16 +01:00
|
|
|
|
2020-12-05 11:26:32 +00:00
|
|
|
#include <sys/socket.h>
|
2021-03-13 12:34:26 +00:00
|
|
|
#include <sys/stat.h>
|
2020-12-05 11:26:32 +00:00
|
|
|
#include <sys/time.h>
|
2021-03-13 12:34:26 +00:00
|
|
|
#include <sys/types.h>
|
|
|
|
#include <time.h>
|
2020-12-05 11:26:32 +00:00
|
|
|
#include <unistd.h>
|
2021-03-13 12:34:26 +00:00
|
|
|
|
2022-02-14 11:32:01 +00:00
|
|
|
#ifndef MG_ENABLE_DIRLIST
|
|
|
|
#define MG_ENABLE_DIRLIST 1
|
|
|
|
#endif
|
|
|
|
|
2022-08-06 22:19:55 +01:00
|
|
|
#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
|