From bc6937b3388a27a60d113c2479b8d5080a649eb9 Mon Sep 17 00:00:00 2001 From: Matthew Fluet Date: Fri, 9 Aug 2024 12:13:04 -0400 Subject: [PATCH] Remove workaround for MinGW's old prototypes for `execv{e,p}` --- runtime/basis/Posix/Process/exece.c | 4 ++-- runtime/basis/Posix/Process/execp.c | 2 +- runtime/platform.h | 10 +--------- runtime/platform/mingw.h | 3 --- 4 files changed, 4 insertions(+), 15 deletions(-) diff --git a/runtime/basis/Posix/Process/exece.c b/runtime/basis/Posix/Process/exece.c index b60590d5fc..e48d8862d4 100644 --- a/runtime/basis/Posix/Process/exece.c +++ b/runtime/basis/Posix/Process/exece.c @@ -21,8 +21,8 @@ C_Errno_t(C_Int_t) Posix_Process_exece (NullString8_t pNStr, eLen = GC_getSequenceLength((pointer)eStr); eSaved = env[eLen - 1]; env[eLen - 1] = NULL; - res = EXECVE (path, - (char * const *)args, + res = execve (path, + (char * const *)args, (char * const *)env); /* exece failed */ args[aLen - 1] = aSaved; diff --git a/runtime/basis/Posix/Process/execp.c b/runtime/basis/Posix/Process/execp.c index b9020303e9..d87288deb6 100644 --- a/runtime/basis/Posix/Process/execp.c +++ b/runtime/basis/Posix/Process/execp.c @@ -13,7 +13,7 @@ C_Errno_t(C_Int_t) Posix_Process_execp (NullString8_t fNStr, aLen = GC_getSequenceLength((pointer)aStr); aSaved = args[aLen - 1]; args[aLen - 1] = NULL; - res = EXECVP (file, + res = execvp (file, (char * const *)args); /* execp failed */ args[aLen - 1] = aSaved; diff --git a/runtime/platform.h b/runtime/platform.h index c88ea3b852..758ead7cbc 100644 --- a/runtime/platform.h +++ b/runtime/platform.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2010,2012,2016,2019,2021 Matthew Fluet. +/* Copyright (C) 2010,2012,2016,2019,2021,2024 Matthew Fluet. * Copyright (C) 1999-2008 Henry Cejtin, Matthew Fluet, Suresh * Jagannathan, and Stephen Weeks. * Copyright (C) 1997-2000 NEC Research Institute. @@ -55,14 +55,6 @@ #error HAS_TIME_PROFILING not defined #endif -#ifndef EXECVP -#define EXECVP execvp -#endif - -#ifndef EXECVE -#define EXECVE execve -#endif - #define FE_NOSUPPORT -1 diff --git a/runtime/platform/mingw.h b/runtime/platform/mingw.h index 7441ee5e24..4f405c0e40 100644 --- a/runtime/platform/mingw.h +++ b/runtime/platform/mingw.h @@ -821,9 +821,6 @@ MLTON_WRAPPER int MLton_uname (struct utsname *buf); /* Posix.Process */ /* ------------------------------------------------- */ -#define EXECVE(path, args, env) \ - execve (path, (const char* const*)args, (const char* const*)env) -#define EXECVP(file, args) execvp (file, (const char* const*) args) #define SPAWN_MODE _P_NOWAIT /* Windows exit status comes from: