mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2025-01-12 21:37:19 +01:00
Added support for _POSIX_MAPPED_FILES if defined in source (#564)
This commit is contained in:
parent
1a5ee11377
commit
c9c820ff36
2
main.cpp
2
main.cpp
@ -24,6 +24,8 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
#elif defined (_POSIX_MAPPED_FILES)
|
||||||
|
#include <sys/mman.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define ROUNDUP(X, K) (((X) + (K)-1) & -(K))
|
#define ROUNDUP(X, K) (((X) + (K)-1) & -(K))
|
||||||
|
3
mmap.h
3
mmap.h
@ -8,11 +8,12 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#if defined (_MSC_VER) && !(defined (_POSIX_MAPPED_FILES))
|
||||||
#define NEED_WIN32_MMAP
|
#define NEED_WIN32_MMAP
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user