summaryrefslogtreecommitdiff
path: root/src/bin/psql/mainloop.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2009-11-10 23:12:52 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2009-11-10 23:12:52 +0000
commita81629696f97c7161e43c5ae889f487a739116e3 (patch)
tree5190670131b625d93eb3865e71eda398677b3730 /src/bin/psql/mainloop.c
parent5804f4b39bc11fdeed4fe652015170fd75ac8aba (diff)
Do not build psql's flex module on its own, but instead include it in
mainloop.c. This ensures that postgres_fe.h is read before including any system headers, which is necessary to avoid problems on some platforms where we make nondefault selections of feature macros for stdio.h or other headers. We have had this policy for flex modules in the backend for many years, but for some reason it was not applied to psql. Per trouble report from Alexandra Roy and diagnosis by Albe Laurenz.
Diffstat (limited to 'src/bin/psql/mainloop.c')
-rw-r--r--src/bin/psql/mainloop.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/bin/psql/mainloop.c b/src/bin/psql/mainloop.c
index 109f23192f8..9a242625c7d 100644
--- a/src/bin/psql/mainloop.c
+++ b/src/bin/psql/mainloop.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/psql/mainloop.c,v 1.66 2005/01/01 05:43:08 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/mainloop.c,v 1.66.4.1 2009/11/10 23:12:52 tgl Exp $
*/
#include "postgres_fe.h"
#include "mainloop.h"
@@ -346,3 +346,13 @@ MainLoop(FILE *source)
return successResult;
} /* MainLoop() */
+
+
+/*
+ * psqlscan.c is #include'd here instead of being compiled on its own.
+ * This is because we need postgres_fe.h to be read before any system
+ * include files, else things tend to break on platforms that have
+ * multiple infrastructures for stdio.h and so on. flex is absolutely
+ * uncooperative about that, so we can't compile psqlscan.c on its own.
+ */
+#include "psqlscan.c"