Skip to content

Commit

Permalink
Remove workaround for MinGW's old prototypes for execv{e,p}
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewFluet committed Aug 9, 2024
1 parent c527a50 commit bc6937b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 15 deletions.
4 changes: 2 additions & 2 deletions runtime/basis/Posix/Process/exece.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion runtime/basis/Posix/Process/execp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 1 addition & 9 deletions runtime/platform.h
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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

Expand Down
3 changes: 0 additions & 3 deletions runtime/platform/mingw.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit bc6937b

Please sign in to comment.