lib: posix: add missing getopt_long guard

Added ifdef guard (CONFIG_GETOPT_LONG) around the functions in
getopt_shim.c that requires getopt_long implementation.

Signed-off-by: Magne Værnes <magne.varnes@nordicsemi.no>
This commit is contained in:
Magne Værnes
2026-01-19 13:36:30 +01:00
committed by Henrik Brix Andersen
parent 7c66a65c73
commit c2011b9d0f

View File

@@ -34,6 +34,7 @@ void z_getopt_global_state_update_shim(struct sys_getopt_state *state)
optarg = state->optarg;
}
#if CONFIG_GETOPT_LONG
int getopt_long(int argc, char *const argv[], const char *shortopts,
const struct option *longopts, int *longind)
{
@@ -45,3 +46,4 @@ int getopt_long_only(int argc, char *const argv[], const char *shortopts,
{
return sys_getopt_long_only(argc, argv, shortopts, longopts, longind);
}
#endif