diff options
-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); |