]> git.eshelyaron.com Git - emacs.git/commitdiff
Remove private prototype for 'execve' and its uses in MinGW build
authorEli Zaretskii <eliz@gnu.org>
Sat, 30 May 2020 10:56:20 +0000 (13:56 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sat, 30 May 2020 10:56:20 +0000 (13:56 +0300)
* 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.

nt/inc/ms-w32.h
src/sysdep.c

index cbe35ea1053f0772eaa4ea6fcf8199e93fc87277..4cbae16dc5ae6f7f7da3d01d68cac10aac2a98a8 100644 (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
index 86e7c20cd0123202d363302e2b46185fe64e0adb..cbd306a6b67c175b8822cf99d2ecf2792af8d2e4 100644 (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)