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 <jjelen@redhat.com>
This commit is contained in:
Mingyuan Li
2026-03-19 21:38:40 +08:00
committed by Jakub Jelen
parent 31a882016e
commit 950f796aca

View File

@@ -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
}
/**