From b6dfae560188a549bedd098464d43b22170fcf99 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Sat, 16 May 2026 16:33:06 +0300 Subject: [PATCH] os: fix g++ C++ compilation by adding extern "C" to posix_spawn declarations --- vlib/os/execute_capture_nix.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vlib/os/execute_capture_nix.h b/vlib/os/execute_capture_nix.h index 11bb63abb..6c8eadf02 100644 --- a/vlib/os/execute_capture_nix.h +++ b/vlib/os/execute_capture_nix.h @@ -87,6 +87,9 @@ static int v_os_exec_capture_start(char *const argv[], int *child_pid, int *read // declared. Calling these via void* is ABI-compatible: pointer parameters // are passed identically regardless of pointee type. typedef struct { unsigned char _opaque[128]; } v_posix_spawn_file_actions_t; +#ifdef __cplusplus +extern "C" { +#endif extern int posix_spawn(pid_t *, const char *, const void *, const void *, char *const [], char *const []); extern int posix_spawnp(pid_t *, const char *, const void *, const void *, char *const [], char *const []); extern int posix_spawn_file_actions_init(void *); @@ -95,6 +98,9 @@ extern int posix_spawn_file_actions_adddup2(void *, int, int); extern int posix_spawn_file_actions_addclose(void *, int); extern char **environ; +#ifdef __cplusplus +} +#endif static int v_os_execute_capture_start(const char *cmd, int *child_pid, int *read_fd) { int pipefd[2]; -- 2.39.5