Commit fa2e3cff authored by Tatsuo Ishii's avatar Tatsuo Ishii

Remove HAVE_OPTARG per discussion in hackers list.

parent 7c5b2487
This diff is collapsed.
...@@ -777,9 +777,6 @@ AC_CHECK_FUNCS([fcvt getopt_long memmove pstat setproctitle setsid sigprocmask s ...@@ -777,9 +777,6 @@ AC_CHECK_FUNCS([fcvt getopt_long memmove pstat setproctitle setsid sigprocmask s
dnl Check whether <unistd.h> declares fdatasync(). dnl Check whether <unistd.h> declares fdatasync().
AC_EGREP_HEADER(fdatasync, unistd.h, AC_DEFINE(HAVE_FDATASYNC_DECL)) AC_EGREP_HEADER(fdatasync, unistd.h, AC_DEFINE(HAVE_FDATASYNC_DECL))
dnl Check whether <unistd.h> declares optarg
AC_EGREP_HEADER(optarg, unistd.h, AC_DEFINE(HAVE_OPTARG_DECL))
AC_CACHE_CHECK([for PS_STRINGS], [pgac_cv_var_PS_STRINGS], AC_CACHE_CHECK([for PS_STRINGS], [pgac_cv_var_PS_STRINGS],
[AC_TRY_LINK( [AC_TRY_LINK(
[#include <machine/vmparam.h> [#include <machine/vmparam.h>
......
...@@ -67,14 +67,7 @@ ...@@ -67,14 +67,7 @@
#ifdef HAVE_GETOPT_H #ifdef HAVE_GETOPT_H
#include <getopt.h> #include <getopt.h>
#else #endif
#ifdef HAVE_OPTARG_DECL
#include <unistd.h>
#else
extern char *optarg;
extern int optind, opterr, optopt;
#endif /* HAVE_OPTARG_DECL */
#endif /* HAVE_GETOPT_H */
/* Forward decls */ /* Forward decls */
static void usage(const char *progname); static void usage(const char *progname);
...@@ -120,6 +113,8 @@ int main(int argc, char **argv) ...@@ -120,6 +113,8 @@ int main(int argc, char **argv)
int c; int c;
Archive* AH; Archive* AH;
char *fileSpec = NULL; char *fileSpec = NULL;
extern int optind;
extern char *optarg;
opts = NewRestoreOptions(); opts = NewRestoreOptions();
......
...@@ -6,20 +6,13 @@ ...@@ -6,20 +6,13 @@
* *
* Copyright (C) 2000 by PostgreSQL Global Development Group * 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" #include "postgres_fe.h"
#ifdef HAVE_GETOPT_H #ifdef HAVE_GETOPT_H
#include <getopt.h> #include <getopt.h>
#else #endif
#ifdef HAVE_OPTARG_DECL
#include <unistd.h>
#else
extern char *optarg;
extern int optind, opterr, optopt;
#endif /* HAVE_OPTARG_DECL */
#endif /* HAVE_GETOPT_H */
#include <pwd.h> #include <pwd.h>
#include <stdio.h> #include <stdio.h>
...@@ -38,6 +31,9 @@ main(int argc, char *argv[]) ...@@ -38,6 +31,9 @@ main(int argc, char *argv[])
struct passwd *pw; struct passwd *pw;
extern int optind;
extern char *optarg;
while ((c = getopt(argc, argv, "nru")) != -1) while ((c = getopt(argc, argv, "nru")) != -1)
{ {
switch (c) switch (c)
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* or in config.h afterwards. Of course, if you edit config.h, then your * or in config.h afterwards. Of course, if you edit config.h, then your
* changes will be overwritten the next time you run configure. * 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 #ifndef CONFIG_H
...@@ -579,9 +579,6 @@ extern int fdatasync(int fildes); ...@@ -579,9 +579,6 @@ extern int fdatasync(int fildes);
/* Set to 1 if you have getopt_long() (GNU long options) */ /* Set to 1 if you have getopt_long() (GNU long options) */
#undef HAVE_GETOPT_LONG #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 */ /* Set to 1 if you have union semun */
#undef HAVE_UNION_SEMUN #undef HAVE_UNION_SEMUN
......
...@@ -8,9 +8,6 @@ ...@@ -8,9 +8,6 @@
#ifdef HAVE_GETOPT_H #ifdef HAVE_GETOPT_H
#include "getopt.h" #include "getopt.h"
#else
extern char *optarg;
extern int optind, opterr, optopt;
#endif #endif
#include "extern.h" #include "extern.h"
...@@ -64,6 +61,9 @@ main(int argc, char *const argv[]) ...@@ -64,6 +61,9 @@ main(int argc, char *const argv[])
out_option = 0; out_option = 0;
struct _include_path *ip; struct _include_path *ip;
extern int optind;
extern char *optarg;
add_include_path("/usr/include"); add_include_path("/usr/include");
add_include_path(INCLUDE_PATH); add_include_path(INCLUDE_PATH);
add_include_path("/usr/local/include"); add_include_path("/usr/local/include");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment