summaryrefslogtreecommitdiff
path: root/nt/inc/ms-w32.h
diff options
context:
space:
mode:
Diffstat (limited to 'nt/inc/ms-w32.h')
-rw-r--r--nt/inc/ms-w32.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/nt/inc/ms-w32.h b/nt/inc/ms-w32.h
index b4eb5622242..24076a31eeb 100644
--- a/nt/inc/ms-w32.h
+++ b/nt/inc/ms-w32.h
@@ -186,6 +186,13 @@ extern struct tm * sys_localtime (const time_t *);
supply the 2nd arg correctly, so don't use _setjmp directly in that
case. */
#undef HAVE__SETJMP
+
+/* Unlike MS and mingw.org, MinGW64 doesn't define gai_strerror as an
+ inline function in a system header file, and instead seems to
+ require to link against ws2_32.a. But we don't want to link with
+ -lws2_32, as that would make Emacs dependent on the respective DLL.
+ So MinGW64 is amply punished here by the following: */
+#undef HAVE_GAI_STRERROR
#endif
/* The following is needed for recovery from C stack overflows. */
@@ -285,6 +292,19 @@ extern int sys_umask (int);
/* Map to MSVC names. */
#define execlp _execlp
#define execvp _execvp
+#include <stdint.h> /* for intptr_t */
+extern intptr_t _execvp (const char *, char **);
+#ifdef MINGW_W64
+/* GCC 6 has a builtin execve with the prototype shown below. MinGW64
+ changed the prototype in its process.h to match that, although the
+ library function still calls _execve, which still returns intptr_t.
+ However, using the prototype with intptr_t causes GCC to emit
+ warnings. Fortunately, execve is not used in the MinGW build, but
+ the code that references it is still compiled. */
+extern int execve (const char *, char * const *, char * const *);
+#else
+extern intptr_t execve (const char *, char * const *, char * const *);
+#endif
#define fdatasync _commit
#define fdopen _fdopen
#define fsync _commit