diff --git a/src/include/pg_getopt.h b/src/include/pg_getopt.h
index 6488004..fc900b7 100644
--- a/src/include/pg_getopt.h
+++ b/src/include/pg_getopt.h
@@ -29,12 +29,12 @@ extern int	optind;
 extern int	opterr;
 extern int	optopt;
 
+#endif	/* HAVE_GETOPT_H */
+
 #ifdef HAVE_INT_OPTRESET
 extern int	optreset;
 #endif
 
-#endif   /* HAVE_GETOPT_H */
-
 #ifndef HAVE_GETOPT
 extern int	getopt(int nargc, char *const * nargv, const char *ostr);
 #endif
