1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:07:45 +00:00

LibC: Don't include things required for getopt_long in unistd.h

Previously, we were including the whole of <getopt.h> in <unistd.h>.
However according to the posix <unistd.h> doesn't have to contain
everything we had in <getopt.h>.

This fixes some symbol collisions that broke the git port.
This commit is contained in:
Itamar 2020-09-05 20:47:40 +03:00 committed by Andreas Kling
parent efac3d27d2
commit c5b0e0b96b
4 changed files with 19 additions and 20 deletions

View file

@ -37,7 +37,6 @@
#include <limits.h>
#include <sys/cdefs.h>
#include <sys/types.h>
#include <getopt.h>
__BEGIN_DECLS
@ -191,4 +190,20 @@ struct crypt_data {
char* crypt(const char* key, const char* salt);
char* crypt_r(const char* key, const char* salt, struct crypt_data* data);
// If opterr is set (the default), print error messages to stderr.
extern int opterr;
// On errors, optopt is set to the erroneous *character*.
extern int optopt;
// Index of the next argument to process upon a getopt*() call.
extern int optind;
// If set, reset the internal state kept by getopt*(). You may also want to set
// optind to 1 in that case. Alternatively, setting optind to 0 is treated like
// doing both of the above.
extern int optreset;
// After parsing an option that accept an argument, set to point to the argument
// value.
extern char* optarg;
int getopt(int argc, char** argv, const char* short_options);
__END_DECLS