]> granicus.if.org Git - postgresql/commitdiff
Clean up some misplaced #includes.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 18 Mar 2016 17:43:13 +0000 (13:43 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 18 Mar 2016 17:43:17 +0000 (13:43 -0400)
Random .h files have no business including postgres-fe.h (or postgres.h).
If that wasn't the first #include done by the calling .c file, it's the
.c file that's broken.  Noted while prepping Kyotaro Horiguchi's psql
lexer refactoring patch.

src/bin/psql/common.h
src/bin/psql/create_help.pl
src/bin/psql/mainloop.h

index 6ba3f44e2cb07912699616b3314e70405a647780..ce7b93f9e5e1c80716b0e8c35980c50caa027d34 100644 (file)
@@ -8,10 +8,9 @@
 #ifndef COMMON_H
 #define COMMON_H
 
-#include "postgres_fe.h"
 #include <setjmp.h>
-#include "libpq-fe.h"
 
+#include "libpq-fe.h"
 #include "print.h"
 
 #define atooid(x)  ((Oid) strtoul((x), NULL, 10))
index b9b8e870e02f797e9ce44196e87c0a75d675f9c8..f3d8141b994982fe8ce986b78e9a7cade16a6aef 100644 (file)
@@ -59,7 +59,6 @@ print HFILE "/*
 #ifndef $define
 #define $define
 
-#include \"postgres_fe.h\"
 #include \"pqexpbuffer.h\"
 
 struct _helpStruct
@@ -84,6 +83,7 @@ print CFILE "/*
 
 #define N_(x) (x)                              /* gettext noop */
 
+#include \"postgres_fe.h\"
 #include \"$hfile\"
 
 ";
index 09747f85cab4319e2206e2a9305960000b656fed..e6476ca7c6c4dd61f7a5265d90f110f51c2cef23 100644 (file)
@@ -8,8 +8,6 @@
 #ifndef MAINLOOP_H
 #define MAINLOOP_H
 
-#include "postgres_fe.h"
-
-int                    MainLoop(FILE *source);
+extern int     MainLoop(FILE *source);
 
 #endif   /* MAINLOOP_H */