diff options
Diffstat (limited to 'soltools/javadep/javadep.c')
-rw-r--r-- | soltools/javadep/javadep.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/soltools/javadep/javadep.c b/soltools/javadep/javadep.c index d840e6606689..d0517d832f45 100644 --- a/soltools/javadep/javadep.c +++ b/soltools/javadep/javadep.c @@ -138,12 +138,14 @@ void usage(void); void err_quit(const char *, ...); void silent_quit(void); +#ifdef WNT /* poor man's getopt() */ int simple_getopt(char *pargv[], const char *poptstring); char *optarg = NULL; int optind = 1; int optopt = 0; int opterr = 0; +#endif uint8 read_uint8(const file_t *pfile) @@ -731,6 +733,7 @@ usage() pprogname); } +#ifdef WNT /* my very simple minded implementation of getopt() * it's to sad that getopt() is not available everywhere * note: this is not a full POSIX conforming getopt() @@ -748,7 +751,7 @@ int simple_getopt(char *pargv[], const char *poptstring) char *popt; int c = parg[1]; if ( (popt = strchr(poptstring, c)) == NULL ) { - optopt = c; + optopt = c; if ( opterr ) fprintf(stderr, "Unknown option character `\\x%x'.\n", optopt); return '?'; @@ -768,7 +771,7 @@ int simple_getopt(char *pargv[], const char *poptstring) } return -1; } - +#endif int CDECL main(int argc, char *argv[]) @@ -817,7 +820,11 @@ main(int argc, char *argv[]) opterr = 0; pincs = allocate_growable(); +#ifdef WNT while( (c = simple_getopt(pall_argv, ":i:I:s:S:o:OhHvV")) != -1 ) { +#else + while( (c = getopt(nall_argc, pall_argv, ":i:I:s:S:o:OhHvV")) != -1 ) { +#endif switch(c) { case 'i': case 'I': |