Introduce #include <tinygetopt.h>

The normal getopt() function is bloated because it links printf(). This
change exports the original authentic bsd getopt function, that cosmo's
always used internally so cosmocc users don't need to include internals
This commit is contained in:
Justine Tunney 2024-05-29 10:08:32 -07:00
parent 07cef612c3
commit b74b974cfd
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
2 changed files with 2 additions and 1 deletions

View file

@ -0,0 +1 @@
#include "third_party/getopt/getopt.internal.h"

View file

@ -16,7 +16,7 @@ COSMOPOLITAN_C_START_
extern char *optarg; extern char *optarg;
extern int optind, opterr, optopt, optreset; extern int optind, opterr, optopt, optreset;
int getopt(int, char *const[], const char *) paramsnonnull(); int getopt(int, char *const[], const char *) paramsnonnull() libcesque;
COSMOPOLITAN_C_END_ COSMOPOLITAN_C_END_
#endif /* COSMOPOLITAN_GETOPT_H_ */ #endif /* COSMOPOLITAN_GETOPT_H_ */