Skip to content

Commit b74b974

Browse files
committed
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
1 parent 07cef61 commit b74b974

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

libc/isystem/tinygetopt.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#include "third_party/getopt/getopt.internal.h"

third_party/getopt/getopt.internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ COSMOPOLITAN_C_START_
1616
extern char *optarg;
1717
extern int optind, opterr, optopt, optreset;
1818

19-
int getopt(int, char *const[], const char *) paramsnonnull();
19+
int getopt(int, char *const[], const char *) paramsnonnull() libcesque;
2020

2121
COSMOPOLITAN_C_END_
2222
#endif /* COSMOPOLITAN_GETOPT_H_ */

0 commit comments

Comments
 (0)