1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-17 17:02:08 +03:00

Centralize getopt-related declarations in a new header file pg_getopt.h.

We used to have externs for getopt() and its API variables scattered
all over the place.  Now that we find we're going to need to tweak the
variable declarations for Cygwin, it seems like a good idea to have
just one place to tweak.

In this commit, the variables are declared "#ifndef HAVE_GETOPT_H".
That may or may not work everywhere, but we'll soon find out.

Andres Freund
This commit is contained in:
Tom Lane
2014-02-15 14:31:30 -05:00
parent 32be1c8e90
commit 60ff2fdd99
19 changed files with 57 additions and 130 deletions

View File

@ -32,9 +32,6 @@
#include <sys/time.h>
#include <sys/resource.h>
#endif
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#endif
#ifndef HAVE_GETRUSAGE
#include "rusagestub.h"
@ -55,6 +52,7 @@
#include "pg_trace.h"
#include "parser/analyze.h"
#include "parser/parser.h"
#include "pg_getopt.h"
#include "postmaster/autovacuum.h"
#include "postmaster/postmaster.h"
#include "replication/walsender.h"
@ -77,14 +75,6 @@
#include "mb/pg_wchar.h"
extern char *optarg;
extern int optind;
#ifdef HAVE_INT_OPTRESET
extern int optreset; /* might not be declared by system headers */
#endif
/* ----------------
* global variables
* ----------------