diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/pg_dump/pg_restore.c | 11 | ||||
-rw-r--r-- | src/bin/pg_id/pg_id.c | 14 | ||||
-rw-r--r-- | src/include/config.h.in | 5 | ||||
-rw-r--r-- | src/interfaces/ecpg/preproc/ecpg.c | 6 |
4 files changed, 12 insertions, 24 deletions
diff --git a/src/bin/pg_dump/pg_restore.c b/src/bin/pg_dump/pg_restore.c index 7e446ac21f4..546b90c2508 100644 --- a/src/bin/pg_dump/pg_restore.c +++ b/src/bin/pg_dump/pg_restore.c @@ -67,14 +67,7 @@ #ifdef HAVE_GETOPT_H #include <getopt.h> -#else -#ifdef HAVE_OPTARG_DECL -#include <unistd.h> -#else -extern char *optarg; -extern int optind, opterr, optopt; -#endif /* HAVE_OPTARG_DECL */ -#endif /* HAVE_GETOPT_H */ +#endif /* Forward decls */ static void usage(const char *progname); @@ -120,6 +113,8 @@ int main(int argc, char **argv) int c; Archive* AH; char *fileSpec = NULL; + extern int optind; + extern char *optarg; opts = NewRestoreOptions(); diff --git a/src/bin/pg_id/pg_id.c b/src/bin/pg_id/pg_id.c index 325d6d6b142..41bd6733c33 100644 --- a/src/bin/pg_id/pg_id.c +++ b/src/bin/pg_id/pg_id.c @@ -6,20 +6,13 @@ * * Copyright (C) 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/pg_id/Attic/pg_id.c,v 1.18 2001/02/27 08:13:28 ishii Exp $ + * $Header: /cvsroot/pgsql/src/bin/pg_id/Attic/pg_id.c,v 1.19 2001/03/01 05:05:29 ishii Exp $ */ #include "postgres_fe.h" #ifdef HAVE_GETOPT_H #include <getopt.h> -#else -#ifdef HAVE_OPTARG_DECL -#include <unistd.h> -#else -extern char *optarg; -extern int optind, opterr, optopt; -#endif /* HAVE_OPTARG_DECL */ -#endif /* HAVE_GETOPT_H */ +#endif #include <pwd.h> #include <stdio.h> @@ -38,6 +31,9 @@ main(int argc, char *argv[]) struct passwd *pw; + extern int optind; + extern char *optarg; + while ((c = getopt(argc, argv, "nru")) != -1) { switch (c) diff --git a/src/include/config.h.in b/src/include/config.h.in index bae18263567..aba0daafd88 100644 --- a/src/include/config.h.in +++ b/src/include/config.h.in @@ -8,7 +8,7 @@ * or in config.h afterwards. Of course, if you edit config.h, then your * changes will be overwritten the next time you run configure. * - * $Id: config.h.in,v 1.159 2001/02/27 08:13:27 ishii Exp $ + * $Id: config.h.in,v 1.160 2001/03/01 05:05:29 ishii Exp $ */ #ifndef CONFIG_H @@ -579,9 +579,6 @@ extern int fdatasync(int fildes); /* Set to 1 if you have getopt_long() (GNU long options) */ #undef HAVE_GETOPT_LONG -/* Set to 1 if optarg is declared in unistd.h */ -#undef HAVE_OPTARG_DECL - /* Set to 1 if you have union semun */ #undef HAVE_UNION_SEMUN diff --git a/src/interfaces/ecpg/preproc/ecpg.c b/src/interfaces/ecpg/preproc/ecpg.c index c3f29294791..a3030098f3c 100644 --- a/src/interfaces/ecpg/preproc/ecpg.c +++ b/src/interfaces/ecpg/preproc/ecpg.c @@ -8,9 +8,6 @@ #ifdef HAVE_GETOPT_H #include "getopt.h" -#else -extern char *optarg; -extern int optind, opterr, optopt; #endif #include "extern.h" @@ -64,6 +61,9 @@ main(int argc, char *const argv[]) out_option = 0; struct _include_path *ip; + extern int optind; + extern char *optarg; + add_include_path("/usr/include"); add_include_path(INCLUDE_PATH); add_include_path("/usr/local/include"); |