Commit 27fbfd39 authored by Tom Lane's avatar Tom Lane

Remove a boatload of useless definitions of 'int optreset'. If we

are using our own ports of getopt or getopt_long, those will define
the variable for themselves; and if not, we don't need these, because
we never touch the variable anyway.
parent 2227e2f1
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.576 2009/03/04 13:56:40 heikki Exp $ * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.577 2009/04/05 04:19:58 tgl Exp $
* *
* NOTES * NOTES
* *
...@@ -309,7 +309,7 @@ extern int optind, ...@@ -309,7 +309,7 @@ extern int optind,
opterr; opterr;
#ifdef HAVE_INT_OPTRESET #ifdef HAVE_INT_OPTRESET
extern int optreset; extern int optreset; /* might not be declared by system headers */
#endif #endif
/* /*
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* Portions taken from FreeBSD. * Portions taken from FreeBSD.
* *
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.169 2009/03/31 18:58:16 mha Exp $ * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.170 2009/04/05 04:19:58 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -62,10 +62,6 @@ ...@@ -62,10 +62,6 @@
#include "getopt_long.h" #include "getopt_long.h"
#include "miscadmin.h" #include "miscadmin.h"
#ifndef HAVE_INT_OPTRESET
int optreset;
#endif
/* /*
* these values are passed in by makefile defines * these values are passed in by makefile defines
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* *
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* *
* $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.109 2009/02/25 13:03:06 petere Exp $ * $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.110 2009/04/05 04:19:58 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -42,10 +42,6 @@ ...@@ -42,10 +42,6 @@
#undef WIN32 #undef WIN32
#endif #endif
#ifndef HAVE_INT_OPTRESET
int optreset;
#endif
/* PID can be negative for standalone backend */ /* PID can be negative for standalone backend */
typedef long pgpid_t; typedef long pgpid_t;
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* by PostgreSQL * by PostgreSQL
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.532 2009/04/01 18:54:27 tgl Exp $ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.533 2009/04/05 04:19:58 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -30,10 +30,6 @@ ...@@ -30,10 +30,6 @@
#include "getopt_long.h" #include "getopt_long.h"
#ifndef HAVE_INT_OPTRESET
int optreset;
#endif
#include "access/attnum.h" #include "access/attnum.h"
#include "access/sysattr.h" #include "access/sysattr.h"
#include "catalog/pg_cast.h" #include "catalog/pg_cast.h"
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* *
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.120 2009/03/22 16:44:26 tgl Exp $ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.121 2009/04/05 04:19:58 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -22,10 +22,6 @@ ...@@ -22,10 +22,6 @@
#include "getopt_long.h" #include "getopt_long.h"
#ifndef HAVE_INT_OPTRESET
int optreset;
#endif
#include "dumputils.h" #include "dumputils.h"
#include "pg_backup.h" #include "pg_backup.h"
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_restore.c,v 1.96 2009/03/20 09:21:09 petere Exp $ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_restore.c,v 1.97 2009/04/05 04:19:58 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -55,10 +55,6 @@ ...@@ -55,10 +55,6 @@
extern char *optarg; extern char *optarg;
extern int optind; extern int optind;
#ifndef HAVE_INT_OPTRESET
int optreset;
#endif
#ifdef ENABLE_NLS #ifdef ENABLE_NLS
#include <locale.h> #include <locale.h>
#endif #endif
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* Copyright (c) 2000-2009, PostgreSQL Global Development Group * Copyright (c) 2000-2009, PostgreSQL Global Development Group
* *
* $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.155 2009/02/26 16:02:38 petere Exp $ * $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.156 2009/04/05 04:19:58 tgl Exp $
*/ */
#include "postgres_fe.h" #include "postgres_fe.h"
...@@ -18,13 +18,8 @@ ...@@ -18,13 +18,8 @@
#include "getopt_long.h" #include "getopt_long.h"
#ifndef HAVE_INT_OPTRESET
int optreset;
#endif
#include <locale.h> #include <locale.h>
#include "command.h" #include "command.h"
#include "common.h" #include "common.h"
#include "describe.h" #include "describe.h"
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/bin/scripts/common.c,v 1.35 2009/02/26 16:02:38 petere Exp $ * $PostgreSQL: pgsql/src/bin/scripts/common.c,v 1.36 2009/04/05 04:19:59 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -24,10 +24,6 @@ ...@@ -24,10 +24,6 @@
static void SetCancelConn(PGconn *conn); static void SetCancelConn(PGconn *conn);
static void ResetCancelConn(void); static void ResetCancelConn(void);
#ifndef HAVE_INT_OPTRESET
int optreset;
#endif
static PGcancel *volatile cancelConn = NULL; static PGcancel *volatile cancelConn = NULL;
#ifdef WIN32 #ifdef WIN32
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* *
* Copyright (c) 2003-2009, PostgreSQL Global Development Group * Copyright (c) 2003-2009, PostgreSQL Global Development Group
* *
* $PostgreSQL: pgsql/src/bin/scripts/common.h,v 1.22 2009/02/26 16:02:39 petere Exp $ * $PostgreSQL: pgsql/src/bin/scripts/common.h,v 1.23 2009/04/05 04:19:59 tgl Exp $
*/ */
#ifndef COMMON_H #ifndef COMMON_H
#define COMMON_H #define COMMON_H
...@@ -13,10 +13,6 @@ ...@@ -13,10 +13,6 @@
#include "getopt_long.h" #include "getopt_long.h"
#include "pqexpbuffer.h" #include "pqexpbuffer.h"
#ifndef HAVE_INT_OPTRESET
extern int optreset;
#endif
enum trivalue enum trivalue
{ {
TRI_DEFAULT, TRI_DEFAULT,
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* *
* Portions Copyright (c) 2003-2009, PostgreSQL Global Development Group * Portions Copyright (c) 2003-2009, PostgreSQL Global Development Group
* *
* $PostgreSQL: pgsql/src/include/getopt_long.h,v 1.10 2009/01/01 17:23:55 momjian Exp $ * $PostgreSQL: pgsql/src/include/getopt_long.h,v 1.11 2009/04/05 04:19:59 tgl Exp $
*/ */
#ifndef GETOPT_LONG_H #ifndef GETOPT_LONG_H
#define GETOPT_LONG_H #define GETOPT_LONG_H
...@@ -18,8 +18,6 @@ extern int opterr; ...@@ -18,8 +18,6 @@ extern int opterr;
extern int optind; extern int optind;
extern int optopt; extern int optopt;
extern char *optarg; extern char *optarg;
/* Some systems have this, otherwise you need to define it somewhere. */
extern int optreset; extern int optreset;
#ifndef HAVE_STRUCT_OPTION #ifndef HAVE_STRUCT_OPTION
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $PostgreSQL: pgsql/src/port/getopt_long.c,v 1.6 2007/03/26 21:44:11 momjian Exp $ * $PostgreSQL: pgsql/src/port/getopt_long.c,v 1.7 2009/04/05 04:19:59 tgl Exp $
*/ */
#include "c.h" #include "c.h"
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#ifndef HAVE_INT_OPTRESET #ifndef HAVE_INT_OPTRESET
int optreset; int optreset;
/* else the "extern" was provided by getopt_long.h */
#endif #endif
#define BADCH '?' #define BADCH '?'
......
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