summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorMitya Selivanov <automainint@guattari.tech>2023-09-15 23:25:28 +0200
committerMitya Selivanov <automainint@guattari.tech>2023-09-15 23:25:28 +0200
commit3f7f888e81cc8f34520bc23145422eadb0affad4 (patch)
tree180c836971e315208ffc1eb565bc88e1d66372ed /source
parentd87589121a81f79bc4c10848f29bbe0ffc35e3af (diff)
downloadkit-3f7f888e81cc8f34520bc23145422eadb0affad4.zip
fix
Diffstat (limited to 'source')
-rw-r--r--source/kit/file.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/source/kit/file.c b/source/kit/file.c
index c0d986f..ec878c2 100644
--- a/source/kit/file.c
+++ b/source/kit/file.c
@@ -28,6 +28,10 @@ enum { PATH_BUF_SIZE = 4096 };
# define st_mtim st_mtimespec
#endif
+#ifndef PATH_MAX
+# define PATH_MAX MAX_PATH
+#endif
+
static i32 is_delim(char c) {
return c == '/' || c == '\\';
}
@@ -416,7 +420,7 @@ kit_path_list_t kit_folder_enum(kit_str_t path,
buf[path.size] = '\\';
buf[path.size + 1] = '*';
- WIN32_FIND_DATAW data;
+ WIN32_FIND_DATAA data;
HANDLE find = FindFirstFileA(buf, &data);
if (find == INVALID_HANDLE_VALUE)
@@ -494,10 +498,6 @@ 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);
@@ -581,8 +581,6 @@ 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);