diff options
author | Mitya Selivanov <automainint@guattari.tech> | 2023-09-15 22:14:23 +0200 |
---|---|---|
committer | Mitya Selivanov <automainint@guattari.tech> | 2023-09-15 22:14:23 +0200 |
commit | cdc5ceea3634fd6bdd55156ef0523d927624eb4c (patch) | |
tree | 220d84239c1d9a63c2e26dd226400dc73f9d9b88 /source | |
parent | 94c01870418373c93744b73d29ebc74986cedd5c (diff) | |
download | kit-cdc5ceea3634fd6bdd55156ef0523d927624eb4c.zip |
win32: file mapping fix
Diffstat (limited to 'source')
-rw-r--r-- | source/kit/file.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/kit/file.c b/source/kit/file.c index 7b80e67..4d6b979 100644 --- a/source/kit/file.c +++ b/source/kit/file.c @@ -517,6 +517,10 @@ void kit_path_list_destroy(kit_path_list_t list) { } kit_mapped_file_t kit_file_map(kit_str_t path, i64 size, i32 mode) { +#if defined(_WIN32) && !defined(__CYGWIN__) +# define PATH_MAX MAX_PATH +#endif + assert(size > 0); assert(path.size > 0); assert(path.size <= PATH_MAX); @@ -600,6 +604,8 @@ kit_mapped_file_t kit_file_map(kit_str_t path, i64 size, i32 mode) { mf.bytes = p; mf._file = file; mf._map = map; + +# undef PATH_MAX #else char buf[PATH_MAX + 1]; memcpy(buf, path.values, path.size); |