summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Gran <spk121@yahoo.com>2025-03-22 17:42:41 -0700
committerMichael Gran <spk121@yahoo.com>2025-03-22 21:02:42 -0700
commit87402c849eda1a75df7882b3c04ba08f33848da4 (patch)
treeed0f82621abf7729f43c3fd91d2a7a2bb8c1990c
parent0f2125e66f3ad9df386e7887c87abea1b5e880e9 (diff)
downloadguile-87402c849eda1a75df7882b3c04ba08f33848da4.tar.gz
MinGW32: cast arguments to execvp
MinGW32's MSVCRT library requires strict casting for exec family functions * libguile/posix.c (scm_execl, scm_execlp, scm_execle) [__MINGW32__]: cast arguments
-rw-r--r--libguile/posix.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/libguile/posix.c b/libguile/posix.c
index 7cd80ed76..3d38bc310 100644
--- a/libguile/posix.c
+++ b/libguile/posix.c
@@ -1,4 +1,4 @@
-/* Copyright 1995-2014, 2016-2019, 2021-2024
+/* Copyright 1995-2014, 2016-2019, 2021-2025
Free Software Foundation, Inc.
Copyright 2021 Maxime Devos <maximedevos@telenet.be>
@@ -1174,7 +1174,11 @@ SCM_DEFINE (scm_execl, "execl", 1, 0, 1,
exec_argv = scm_i_allocate_string_pointers (args);
+#ifdef __MINGW32__
+ execv (exec_file, (const char * const *)exec_argv);
+#else
execv (exec_file, exec_argv);
+#endif
SCM_SYSERROR;
/* not reached. */
@@ -1203,7 +1207,11 @@ SCM_DEFINE (scm_execlp, "execlp", 1, 0, 1,
exec_argv = scm_i_allocate_string_pointers (args);
+#ifdef __MINGW32__
+ execvp (exec_file, (const char * const *)exec_argv);
+#else
execvp (exec_file, exec_argv);
+#endif
SCM_SYSERROR;
/* not reached. */
@@ -1237,7 +1245,11 @@ SCM_DEFINE (scm_execle, "execle", 2, 0, 1,
exec_argv = scm_i_allocate_string_pointers (args);
exec_env = scm_i_allocate_string_pointers (env);
+#ifdef __MINGW32__
+ execve (exec_file, (const char * const *) exec_argv, (const char * const *) exec_env);
+#else
execve (exec_file, exec_argv, exec_env);
+#endif
SCM_SYSERROR;
/* not reached. */