mirror of
https://github.com/apache/nuttx.git
synced 2026-09-28 15:54:57 +08:00
libc: Add opterr global variable
defined here: https://pubs.opengroup.org/onlinepubs/9699919799/functions/getopt.html Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
@@ -296,10 +296,12 @@ extern "C"
|
||||
|
||||
#ifndef __NXFLAT__
|
||||
EXTERN FAR char *optarg; /* Optional argument following option */
|
||||
EXTERN int opterr; /* Print error message */
|
||||
EXTERN int optind; /* Index into argv */
|
||||
EXTERN int optopt; /* Unrecognized option character */
|
||||
#else
|
||||
# define optarg (*(getoptargp()))
|
||||
# define opterr (*(getopterrp()))
|
||||
# define optind (*(getoptindp()))
|
||||
# define optopt (*(getoptoptp()))
|
||||
#endif
|
||||
@@ -389,6 +391,7 @@ int getopt(int argc, FAR char * const argv[], FAR const char *optstring);
|
||||
*/
|
||||
|
||||
FAR char **getoptargp(void); /* Optional argument following option */
|
||||
FAR int *getopterrp(void); /* Print error message */
|
||||
FAR int *getoptindp(void); /* Index into argv */
|
||||
FAR int *getoptoptp(void); /* Unrecognized option character */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user