Remove private prototype for 'execve' and its uses in MinGW build

* src/sysdep.c (emacs_exec_file): Don't compile this function
anymore on WINDOWSNT, since it is not used there.  This function
was the only reason for having 'execve' prototype in ms-w32.h.

* nt/inc/ms-w32.h (execve): Remove prototype and the MinGW64 vs
ming.org mess that it causes.
This commit is contained in:
Eli Zaretskii 2020-05-30 13:56:20 +03:00
parent f42db4b6e1
commit 360d7c716d
2 changed files with 3 additions and 11 deletions

View file

@ -300,17 +300,6 @@ extern int sys_umask (int);
#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 tcdrain _commit
#define fdopen _fdopen
#define fsync _commit

View file

@ -199,6 +199,7 @@ maybe_disable_address_randomization (int argc, char **argv)
}
#endif
#ifndef WINDOWSNT
/* Execute the program in FILE, with argument vector ARGV and environ
ENVP. Return an error number if unsuccessful. This is like execve
except it reenables ASLR in the executed program if necessary, and
@ -215,6 +216,8 @@ emacs_exec_file (char const *file, char *const *argv, char *const *envp)
return errno;
}
#endif /* !WINDOWSNT */
/* If FD is not already open, arrange for it to be open with FLAGS. */
static void
force_open (int fd, int flags)