[Git][ghc/ghc][master] Import new name for 'utimbuf' on windows to fix #26337

Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: f9f2ffcf by Alexandre Esteves at 2025-08-27T07:19:14-04:00 Import new name for 'utimbuf' on windows to fix #26337 Fixes an `-Wincompatible-pointer-types` instance that turns into an error on recent toolchains and surfaced as such on nixpkgs when doing linux->ucrt cross. This long-standing warning has been present at least since 9.4: ``` C:\GitLabRunner\builds\0\1709189\tmp\ghc16652_0\ghc_4.c:26:115: error: warning: incompatible pointer types passing 'struct utimbuf *' to parameter of type 'struct _utimbuf *' [-Wincompatible-pointer-types] | 26 | HsInt32 ghczuwrapperZC9ZCbaseZCSystemziPosixziInternalsZCzuutime(char* a1, struct utimbuf* a2) {return _utime(a1, a2);} | ^ HsInt32 ghczuwrapperZC9ZCbaseZCSystemziPosixziInternalsZCzuutime(char* a1, struct utimbuf* a2) {return _utime(a1, a2);} ^~ C:\GitLabRunner\builds\0\1709189\_build\stage0\lib\..\..\mingw\x86_64-w64-mingw32\include\sys\utime.h:109:72: error: note: passing argument to parameter '_Utimbuf' here | 109 | __CRT_INLINE int __cdecl _utime(const char *_Filename,struct _utimbuf *_Utimbuf) { | ^ __CRT_INLINE int __cdecl _utime(const char *_Filename,struct _utimbuf *_Utimbuf) { ``` - - - - - 1 changed file: - libraries/ghc-internal/src/GHC/Internal/System/Posix/Internals.hs Changes: ===================================== libraries/ghc-internal/src/GHC/Internal/System/Posix/Internals.hs ===================================== @@ -97,7 +97,11 @@ data {-# CTYPE "struct stat" #-} CStat data {-# CTYPE "struct termios" #-} CTermios data {-# CTYPE "struct tm" #-} CTm data {-# CTYPE "struct tms" #-} CTms +#if defined(mingw32_HOST_OS) +data {-# CTYPE "struct _utimbuf" #-} CUtimbuf +#else data {-# CTYPE "struct utimbuf" #-} CUtimbuf +#endif data {-# CTYPE "struct utsname" #-} CUtsname type FD = CInt View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f9f2ffcf8449dea2d3639b5aba25dbc9... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f9f2ffcf8449dea2d3639b5aba25dbc9... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Marge Bot (@marge-bot)