summaryrefslogtreecommitdiff
path: root/rts/PathUtils.h
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2021-03-15 19:42:43 -0400
committerBen Gamari <ben@well-typed.com>2021-03-22 17:48:05 -0400
commitb97f28ccf743056b1ff15a483bf6c77fb9a2d354 (patch)
tree645fd541064104b7f58b53e2a0ed8ff115679ffc /rts/PathUtils.h
parenta9129f9fdfbd358e76aa197ba00bfe75012d6b4f (diff)
downloadhaskell-wip/T19541.tar.gz
rts: Use long-path-aware statwip/T19541
Previously `pathstat` relied on msvcrt's `stat` implementation, which was not long-path-aware. It should rather be defined in terms of the `stat` implementation provided by `utils/fs`. Fixes #19541.
Diffstat (limited to 'rts/PathUtils.h')
-rw-r--r--rts/PathUtils.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/rts/PathUtils.h b/rts/PathUtils.h
index b1746f8769..8a42e34b54 100644
--- a/rts/PathUtils.h
+++ b/rts/PathUtils.h
@@ -12,10 +12,13 @@
// Use wchar_t for pathnames on Windows (#5697)
#if defined(mingw32_HOST_OS)
+#include "fs_rts.h"
+
#define pathcmp wcscmp
#define pathlen wcslen
-#define pathopen __rts_fwopen
-#define pathstat _wstat
+// N.B. Use the Win32-based file routines from utils/fs.
+#define pathopen FS(fwopen)
+#define pathstat FS(_wstat)
#define struct_stat struct _stat
#define open wopen
#define WSTR(s) L##s