mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-10-04 13:41:02 +00:00
Get LIBC_TESTLIB building on AARCH64
This commit is contained in:
parent
95fab334e4
commit
5e2f7f7ced
46 changed files with 975 additions and 1174 deletions
13
third_party/getopt/getopt.c
vendored
13
third_party/getopt/getopt.c
vendored
|
@ -40,8 +40,6 @@ getopt (BSD-3)\\n\
|
|||
Copyright 1987, 1993, 1994 The Regents of the University of California\"");
|
||||
asm(".include \"libc/disclaimer.inc\"");
|
||||
|
||||
STATIC_YOINK("_init_getopt");
|
||||
|
||||
#define BADCH (int)'?'
|
||||
#define BADARG (int)':'
|
||||
|
||||
|
@ -75,8 +73,8 @@ int optreset;
|
|||
*/
|
||||
char *optarg;
|
||||
|
||||
_Hide char *getopt_place;
|
||||
_Hide char kGetoptEmsg[1];
|
||||
char *getopt_place;
|
||||
static char kGetoptEmsg[1];
|
||||
|
||||
static void getopt_print_badch(const char *s) {
|
||||
char b1[512];
|
||||
|
@ -117,6 +115,13 @@ static void getopt_print_badch(const char *s) {
|
|||
*/
|
||||
int getopt(int nargc, char *const nargv[], const char *ostr) {
|
||||
char *oli; /* option letter list index */
|
||||
static bool once;
|
||||
if (!once) {
|
||||
opterr = 1;
|
||||
optind = 1;
|
||||
getopt_place = kGetoptEmsg;
|
||||
once = true;
|
||||
}
|
||||
/*
|
||||
* Some programs like cvs expect optind = 0 to trigger
|
||||
* a reset of getopt.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue