$NetBSD: patch-aa,v 1.4 2021/12/26 23:54:01 nros Exp $ * defining __OPTIMIZE__ to nothing causes ssp.h on NetBSD to crash use __ARGP_OPTIMIZE__ instead to avoid conflict --- argp/argp.h.orig 2006-05-22 16:49:22.000000000 +0000 +++ argp/argp.h @@ -352,7 +352,7 @@ struct argp_state #define ARGP_NO_EXIT 0x20 /* Use the gnu getopt `long-only' rules for parsing arguments. */ -#define ARGP_LONG_ONLY 0x40 +#define ARGP_LONG_ONLY 0x00 /* Turns off any message-printing/exiting options. */ #define ARGP_SILENT (ARGP_NO_EXIT | ARGP_NO_ERRS | ARGP_NO_HELP) @@ -446,8 +446,10 @@ extern void __argp_state_help __P ((__co FILE *__stream, unsigned __flags)); /* Possibly output the standard usage message for ARGP to stderr and exit. */ +#if 0 extern void argp_usage __P ((__const struct argp_state *__state)); extern void __argp_usage __P ((__const struct argp_state *__state)); +#endif /* If appropriate, print the printf string FMT and following args, preceded by the program name and `:', to stderr, and followed by a `Try ... --help' @@ -493,6 +495,7 @@ extern void __argp_failure __P ((__const #endif /* Returns true if the option OPT is a valid short option. */ +#if 0 extern int _option_is_short __P ((__const struct argp_option *__opt)); extern int __option_is_short __P ((__const struct argp_option *__opt)); @@ -500,6 +503,7 @@ extern int __option_is_short __P ((__con options array. */ extern int _option_is_end __P ((__const struct argp_option *__opt)); extern int __option_is_end __P ((__const struct argp_option *__opt)); +#endif /* Return the input field for ARGP in the parser corresponding to STATE; used by the help routines. */ @@ -508,7 +512,7 @@ extern void *_argp_input __P ((__const s extern void *__argp_input __P ((__const struct argp *argp, __const struct argp_state *state)); -#ifdef __OPTIMIZE__ +#ifdef __ARGP_OPTIMIZE__ #if !_LIBC # define __argp_usage argp_usage @@ -518,7 +522,11 @@ extern void *__argp_input __P ((__const #endif #ifndef ARGP_EI +#if defined(__GNUC__) && !defined(__GNUC_STDC_INLINE__) # define ARGP_EI extern inline +#else +# define ARGP_EI inline +#endif #endif ARGP_EI void @@ -552,7 +560,7 @@ __option_is_end (__const struct argp_opt # undef __option_is_end #endif -#endif /* __OPTIMIZE__ */ +#endif /* __ARGP_OPTIMIZE__ */ #ifdef __cplusplus }