-
-
Save satta/abf66f4d28ea44b72e9601dd6d76ce57 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() { | |
int optind = 99, optreset = 98; | |
#if defined __GLIBC__ | |
/* glibc needs to have optind set to 0 instead of the "traditional | |
value" of 1 */ | |
optind = 0; | |
#else | |
/* 1 is the value that optind should be initialized to according to | |
IEEE Std 1003.1 */ | |
optind = 1; | |
#if defined __FreeBSD__ || defined __OpenBSD__ || defined __NetBSD__ || defined __APPLE__ || defined __DragonFly__ | |
/* BSD-like libc also needs to have optreset set to 1 */ | |
optreset = 1; | |
#endif | |
#endif | |
printf("ind %d reset %d\n", optind, optreset); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment