diff options
| author | Eli Zaretskii <eliz@gnu.org> | 2026-01-22 19:36:54 +0200 |
|---|---|---|
| committer | Eli Zaretskii <eliz@gnu.org> | 2026-01-22 19:36:54 +0200 |
| commit | 7b9d3e90ce32e2e19f0b4725868f9a6f76346ae6 (patch) | |
| tree | 7fd45102d4d10da2f9a0e7d11521465713021e8c /nt | |
| parent | 5290b5dddb9903b2e8010fe63564a31f208d209d (diff) | |
Fix MS-Windows build broken by recent updates in MinGW64 headers
* nt/inc/ms-w32.h (strerror): Redirect to sys_strerror after
including <string.h>, to prevent the linker from thinking it
should be imported from some DLL. Reported by Richard Copley
<rcopley@gmail.com>.
* src/w32.c: Remove now unneeded prototype of sys_strerror.
Diffstat (limited to 'nt')
| -rw-r--r-- | nt/inc/ms-w32.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/nt/inc/ms-w32.h b/nt/inc/ms-w32.h index fc853959b49..1e2af4a424e 100644 --- a/nt/inc/ms-w32.h +++ b/nt/inc/ms-w32.h @@ -227,7 +227,6 @@ extern void w32_reset_stack_overflow_guard (void); #define select sys_select #define pselect sys_select #define sleep sys_sleep -#define strerror sys_strerror #undef unlink #define unlink sys_unlink #undef opendir @@ -268,6 +267,13 @@ extern int sys_umask (int); #define cmputc sys_cmputc #define Wcm_clear sys_Wcm_clear +/* MinGW64 system headers include string.h too early, causing the + compiler to emit a warning about sys_strerror having no + prototype, or the linker fail to link. */ +#include <string.h> +#define strerror sys_strerror +char *sys_strerror (int); + #endif /* emacs */ /* Used both in Emacs, in lib-src, and in Gnulib. */ |
