1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 08:57:47 +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

@ -28,20 +28,6 @@
__BEGIN_DECLS
// 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;
#define no_argument 0
#define required_argument 1
#define optional_argument 2
@ -53,7 +39,6 @@ struct option {
int val;
};
int getopt(int argc, char** argv, const char* short_options);
int getopt_long(int argc, char** argv, const char* short_options, const struct option* long_options, int* out_long_option_index);
__END_DECLS