From 950f796aca06be8b4bce27b990eed55afc9d9e9d Mon Sep 17 00:00:00 2001 From: Mingyuan Li <2560359315@qq.com> Date: Thu, 19 Mar 2026 21:38:40 +0800 Subject: [PATCH] options: Enable ssh_options_getopt on all platforms Include the new platform-independent getopt wrapper header and remove the #ifdef _MSC_VER guard that disabled ssh_options_getopt() on MSVC. The function is now compiled unconditionally on all platforms. Signed-off-by: Mingyuan Li <2560359315@qq.com> Reviewed-by: Jakub Jelen --- src/options.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/options.c b/src/options.c index 31b0e26e..461efd42 100644 --- a/src/options.c +++ b/src/options.c @@ -46,6 +46,7 @@ #include "libssh/options.h" #include "libssh/config_parser.h" #include "libssh/gssapi.h" +#include "libssh/getopt.h" #include "libssh/token.h" #ifdef WITH_SERVER #include "libssh/server.h" @@ -1838,13 +1839,6 @@ int ssh_options_get(ssh_session session, enum ssh_options_e type, char** value) */ int ssh_options_getopt(ssh_session session, int *argcptr, char **argv) { -#ifdef _MSC_VER - (void)session; - (void)argcptr; - (void)argv; - /* Not supported with a Microsoft compiler */ - return -1; -#else char *user = NULL; char *cipher = NULL; char *identity = NULL; @@ -2008,7 +2002,6 @@ int ssh_options_getopt(ssh_session session, int *argcptr, char **argv) } return SSH_OK; -#endif } /**