From 60ff2fdd9970ba29f5267317a5e7354d2658c1e5 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 15 Feb 2014 14:31:30 -0500 Subject: 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 --- src/backend/tcop/postgres.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'src/backend/tcop/postgres.c') diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index b7612b9b5f7..a230d7eda69 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -32,9 +32,6 @@ #include #include #endif -#ifdef HAVE_GETOPT_H -#include -#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 * ---------------- -- cgit v1.2.3