#pragma once
#ifndef _WIN32
#include <sys/mman.h>
#if defined(__APPLE__) || defined(__FreeBSD__)
#if !defined(MAP_ANONYMOUS) && defined(MAP_ANON)
#define MAP_ANONYMOUS …
#endif
#endif
#else
#include <cstdint>
#include <sys/types.h>
using off64_t = int64_t;
#define MAP_ANONYMOUS …
#define MAP_ANON …
#define MAP_SHARED …
#define MAP_PRIVATE …
#define MAP_POPULATE …
#define MAP_NORESERVE …
#define MAP_FIXED …
#define MAP_FAILED …
#define PROT_NONE …
#define PROT_READ …
#define PROT_WRITE …
#define PROT_EXEC …
#define MADV_NORMAL …
#define MADV_DONTNEED …
#define MADV_SEQUENTIAL …
extern "C" {
int madvise(const void* addr, size_t len, int advise);
int mlock(const void* addr, size_t len);
void* mmap(void* addr, size_t length, int prot, int flags, int fd, off_t off);
void* mmap64(
void* addr, size_t length, int prot, int flags, int fd, off64_t off);
int mprotect(void* addr, size_t size, int prot);
int munlock(const void* addr, size_t length);
int munmap(void* addr, size_t length);
}
#endif