summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);