Remove a boatload of useless definitions of 'int optreset'. If we
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 5 Apr 2009 04:19:59 +0000 (04:19 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 5 Apr 2009 04:19:59 +0000 (04:19 +0000)
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.

src/backend/postmaster/postmaster.c
src/bin/initdb/initdb.c
src/bin/pg_ctl/pg_ctl.c
src/bin/pg_dump/pg_dump.c
src/bin/pg_dump/pg_dumpall.c
src/bin/pg_dump/pg_restore.c
src/bin/psql/startup.c
src/bin/scripts/common.c
src/bin/scripts/common.h
src/include/getopt_long.h
src/port/getopt_long.c

index b1e5bb86170a6a1340fb474fec7c508f5070aa6a..c9940764a9391e83f7b78c975dbb1b3a7df1450b 100644 (file)
@@ -309,7 +309,7 @@ extern int  optind,
                        opterr;
 
 #ifdef HAVE_INT_OPTRESET
-extern int     optreset;
+extern int     optreset;                       /* might not be declared by system headers */
 #endif
 
 /*
index 804226c2619d94ffe7231c596987ecc243f4d941..bc3837630a0c157403d86b8ea1f4c6f5f8d3bb8e 100644 (file)
 #include "getopt_long.h"
 #include "miscadmin.h"
 
-#ifndef HAVE_INT_OPTRESET
-int                    optreset;
-#endif
-
 
 /*
  * these values are passed in by makefile defines
index 1a8b5983be4bc510053f6ca0ba9e3788017acd92..9ce2497416b198d4ce22f4e4879c084f6f84aff1 100644 (file)
 #undef WIN32
 #endif
 
-#ifndef HAVE_INT_OPTRESET
-int                    optreset;
-#endif
-
 /* PID can be negative for standalone backend */
 typedef long pgpid_t;
 
index 29335264c0133a7042d5042609a4802bb4e83fb0..2a3e49b8b49f52ca00c909614fd2a73954aa1280 100644 (file)
 
 #include "getopt_long.h"
 
-#ifndef HAVE_INT_OPTRESET
-int                    optreset;
-#endif
-
 #include "access/attnum.h"
 #include "access/sysattr.h"
 #include "catalog/pg_cast.h"
index 3d1d64dc6a7b672a5d32ba200ff819ed000d8463..5a79819e59b8ae40043bd803ea2e1c80efa90cb8 100644 (file)
 
 #include "getopt_long.h"
 
-#ifndef HAVE_INT_OPTRESET
-int                    optreset;
-#endif
-
 #include "dumputils.h"
 #include "pg_backup.h"
 
index ff8fb3d2a3718d3799ed75bffa27c77ee7355261..396f647dde1af5bee4d37c65d8d111b4f490dd12 100644 (file)
 extern char *optarg;
 extern int     optind;
 
-#ifndef HAVE_INT_OPTRESET
-int                    optreset;
-#endif
-
 #ifdef ENABLE_NLS
 #include <locale.h>
 #endif
index e452554e32373e1c13f258195ce5680ef97e4115..429e5d906505d2da0b1bd3b5ba3294859c97d20a 100644 (file)
 
 #include "getopt_long.h"
 
-#ifndef HAVE_INT_OPTRESET
-int                    optreset;
-#endif
-
 #include <locale.h>
 
-
 #include "command.h"
 #include "common.h"
 #include "describe.h"
index 7beb1eb44b4fab71ac5ed8e24091f904f14a521a..5ecbdc6d6474f15334ee2a272e810af14d37099c 100644 (file)
 static void SetCancelConn(PGconn *conn);
 static void ResetCancelConn(void);
 
-#ifndef HAVE_INT_OPTRESET
-int                    optreset;
-#endif
-
 static PGcancel *volatile cancelConn = NULL;
 
 #ifdef WIN32
index 23f918813d1872088e8731d469e5ea27881e481d..f242576fc1af3b92c088c90d96e15a9101749b9a 100644 (file)
 #include "getopt_long.h"
 #include "pqexpbuffer.h"
 
-#ifndef HAVE_INT_OPTRESET
-extern int     optreset;
-#endif
-
 enum trivalue
 {
        TRI_DEFAULT,
index fbcd1fabc72fbfe98cb7fa49532a93f563cc1cfc..be0b806db903a0c20bf338c454241148815d6fe0 100644 (file)
@@ -18,8 +18,6 @@ extern int    opterr;
 extern int     optind;
 extern int     optopt;
 extern char *optarg;
-
-/* Some systems have this, otherwise you need to define it somewhere. */
 extern int     optreset;
 
 #ifndef HAVE_STRUCT_OPTION
index 81912d79ffa9ea44ec499c12cf996b9b9ee48b53..982f2cba26088ff574946278666aa26ce25dc91d 100644 (file)
@@ -40,6 +40,7 @@
 
 #ifndef HAVE_INT_OPTRESET
 int                    optreset;
+/* else the "extern" was provided by getopt_long.h */
 #endif
 
 #define BADCH  '?'