summaryrefslogtreecommitdiffstats
path: root/osdep
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2023-12-23 18:44:55 +0100
committersfan5 <sfan5@live.de>2023-12-27 22:55:56 +0100
commitf57ec94d9f176184414ad8ef916a0b657c1b22ec (patch)
tree3ec8b202bf0c4df4bc339dd5439f214afd4db433 /osdep
parentdd48a53b6594052b337a89bcecb11494207300a1 (diff)
downloadmpv-f57ec94d9f176184414ad8ef916a0b657c1b22ec.tar.bz2
mpv-f57ec94d9f176184414ad8ef916a0b657c1b22ec.tar.xz
osdep: clarify and rename a constant on win32
This is about the maximum filename not path length.
Diffstat (limited to 'osdep')
-rw-r--r--osdep/io.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/osdep/io.c b/osdep/io.c
index bdf79f8894..bba9ddc1dd 100644
--- a/osdep/io.c
+++ b/osdep/io.c
@@ -558,7 +558,9 @@ FILE *mp_fopen(const char *filename, const char *mode)
// Thus we need MP_PATH_MAX as the UTF-8/char version of PATH_MAX.
// Also make sure there's free space for the terminating \0.
// (For codepoints encoded as UTF-16 surrogate pairs, UTF-8 has the same length.)
-#define MP_PATH_MAX (FILENAME_MAX * 3 + 1)
+// Lastly, note that neither _wdirent nor WIN32_FIND_DATA can store filenames
+// longer than this, so long-path support for readdir() is impossible.
+#define MP_FILENAME_MAX (FILENAME_MAX * 3 + 1)
struct mp_dir {
DIR crap; // must be first member
@@ -568,9 +570,9 @@ struct mp_dir {
// dirent has space only for FILENAME_MAX bytes. _wdirent has space for
// FILENAME_MAX wchar_t, which might end up bigger as UTF-8 in some
// cases. Guarantee we can always hold _wdirent.d_name converted to
- // UTF-8 (see MP_PATH_MAX).
+ // UTF-8 (see above).
// This works because dirent.d_name is the last member of dirent.
- char space[MP_PATH_MAX];
+ char space[MP_FILENAME_MAX];
};
};