--- gforth/Attic/main.c 1994/09/08 17:20:09 1.11 +++ gforth/Attic/main.c 1994/09/12 19:00:34 1.12 @@ -1,5 +1,5 @@ /* - $Id: main.c,v 1.11 1994/09/08 17:20:09 anton Exp $ + $Id: main.c,v 1.12 1994/09/12 19:00:34 pazsan Exp $ Copyright 1993 by the ANSI figForth Development Group */ @@ -14,7 +14,14 @@ #include #include "forth.h" #include "io.h" -#include "getopt.h" +#ifdef USE_GETOPT +# include "getopt.h" +#else + extern int getopt (argc, argv, optstring); + + extern char *optarg; + extern int optind, opterr; +#endif #ifndef DEFAULTPATH # define DEFAULTPATH "/usr/local/lib/gforth:." @@ -184,7 +191,7 @@ int main(int argc, char **argv, char **e char *path, *path1; char *imagename="gforth.fi"; FILE *image_file; - int c; + int c, retvalue; #if defined(i386) && defined(ALIGNMENT_CHECK) /* turn on alignment checks on the 486. @@ -198,6 +205,7 @@ int main(int argc, char **argv, char **e opterr=0; while (1) { int option_index=0; +#ifdef USE_GETOPT static struct option opts[] = { {"image-file", required_argument, NULL, 'i'}, {"dictionary-size", required_argument, NULL, 'm'}, @@ -211,6 +219,10 @@ int main(int argc, char **argv, char **e }; c = getopt_long(argc, argv, "+drfl", opts, &option_index); +#else + c = getopt(argc, argv, "imdrflp"); +#endif + if (c==EOF) break; if (c=='?') { @@ -255,6 +267,8 @@ int main(int argc, char **argv, char **e for (i=0; i