diff options
Diffstat (limited to 'include/argp.h')
-rw-r--r-- | include/argp.h | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/include/argp.h b/include/argp.h index 8e8674296..d67723521 100644 --- a/include/argp.h +++ b/include/argp.h @@ -46,12 +46,14 @@ /* This feature is available in gcc versions 2.5 and later. */ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || defined(__STRICT_ANSI__) # define __attribute__(Spec) /* empty */ +# define __UCLIBC_ATTRIBUTE_FALLBACK__ # endif /* The __-protected variants of `format' and `printf' attributes are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) || defined(__STRICT_ANSI__) # define __format__ format # define __printf__ printf +# define __UCLIBC_PRINTF_FALLBACK__ # endif #endif @@ -71,7 +73,7 @@ typedef int error_t; # define __error_t_defined #endif - + #ifdef __cplusplus extern "C" { #endif @@ -145,7 +147,7 @@ struct argp_option distinguish these two cases, -x should probably be marked OPTION_NO_USAGE. */ #define OPTION_NO_USAGE 0x10 - + struct argp; /* fwd declare this type */ struct argp_state; /* " */ struct argp_child; /* " */ @@ -283,7 +285,7 @@ struct argp suppressed. */ #define ARGP_KEY_HELP_DUP_ARGS_NOTE 0x2000005 #define ARGP_KEY_HELP_ARGS_DOC 0x2000006 /* Argument doc string. */ - + /* When an argp has a non-zero CHILDREN field, it should point to a vector of argp_child structures, each of which describes a subsidiary argp. */ struct argp_child @@ -308,7 +310,7 @@ struct argp_child (merging the child's grouping levels with the parents). */ int group; }; - + /* Parsing state. This is provided to parsing functions called by argp, which may examine and, as noted, modify fields. */ struct argp_state @@ -356,7 +358,7 @@ struct argp_state void *pstate; /* Private, for use by argp. */ }; - + /* Flags for argp_parse (note that the defaults are those that are convenient for program command line parsing): */ @@ -412,7 +414,7 @@ extern error_t argp_parse (__const struct argp *__restrict __argp, int __argc, char **__restrict __argv, unsigned __flags, int *__restrict __arg_index, void *__restrict __input); - + /* Global variables. */ /* If defined or set by the user program to a non-zero value, then a default @@ -441,7 +443,7 @@ extern __const char *argp_program_bug_address; If not defined or set by the user program, this defaults to EX_USAGE from <sysexits.h>. */ extern error_t argp_err_exit_status; - + /* Flags for argp_help. */ #define ARGP_HELP_USAGE 0x01 /* a Usage: message. */ #define ARGP_HELP_SHORT_USAGE 0x02 /* " but don't actually print options. */ @@ -476,7 +478,7 @@ extern error_t argp_err_exit_status; extern void argp_help (__const struct argp *__restrict __argp, FILE *__restrict __stream, unsigned __flags, char *__restrict __name); - + /* The following routines are intended to be called from within an argp parsing routine (thus taking an argp_state structure as the first argument). They may or may not print an error message and exit, depending @@ -526,7 +528,7 @@ extern int __option_is_end (__const struct argp_option *__opt) __THROW; extern void *__argp_input (__const struct argp *__restrict __argp, __const struct argp_state *__restrict __state) __THROW; - + #ifdef __USE_EXTERN_INLINES # ifndef ARGP_EI @@ -562,4 +564,13 @@ __NTH (__option_is_end (__const struct argp_option *__opt)) } #endif +#ifdef __UCLIBC_ATTRIBUTE_FALLBACK__ +# undef __attribute__ +#endif + +#ifdef __UCLIBC_PRINTF_FALLBACK__ +# undef __format__ +# undef __printf__ +#endif + #endif /* argp.h */ |