We have a longstanding project convention that all .h files should
be includable with no prerequisites other than postgres.h. This is
tested/relied-on by cpluspluscheck. However, cpluspluscheck has not
historically been applied to most headers outside the src/include
tree, with the predictable consequence that some of them don't work.
Fix that, usually by adding missing #include dependencies.
The change in printf_hack.h might require some explanation: without
it, my C++ compiler whines that the function is unused. There's
not so many call sites that "inline" is going to cost much, and
besides all the callers are in test code that we really don't care
about the size of.
There's no actual bugs being fixed here, so I see no need to back-patch.
Discussion: https://postgr.es/m/
b517ec3918d645eb950505eac8dd434e@gaz-is.ru
#ifndef RMGRDESC_H
#define RMGRDESC_H
+#include "access/xlogreader.h"
#include "lib/stringinfo.h"
typedef struct RmgrDescData
#ifndef CROSSTABVIEW_H
#define CROSSTABVIEW_H
+#include "libpq-fe.h"
+
/*
* Limit the number of output columns generated in memory by the crosstabview
* algorithm. A new output column is added for each distinct value found in the
#include "sqlda-native.h"
#include "sqlda-compat.h"
#include "ecpg_config.h"
+#include "ecpgtype.h"
#ifndef CHAR_BIT
#include <limits.h>
* print_double(x) has the same effect as printf("%g", x), but is intended
* to produce the same formatting across all platforms.
*/
-static void
+static inline void
print_double(double x)
{
#ifdef WIN32
#include "libpq-fe.h"
#include "libpq-int.h"
+#ifdef ENABLE_GSS
+
void pg_GSS_error(const char *mprefix, PGconn *conn,
OM_uint32 maj_stat, OM_uint32 min_stat);
bool pg_GSS_have_ccache(gss_cred_id_t *cred_out);
int pg_GSS_load_servicename(PGconn *conn);
+
+#endif
+
#endif /* FE_GSSAPI_COMMON_H */
#include "mb/pg_wchar.h"
+#include "plperl.h"
+
+
/*
* convert from utf8 to database encoding
*
#ifndef PLPY_ELOG_H
#define PLPY_ELOG_H
+#include "plpython.h"
+
/* global exception classes */
extern PyObject *PLy_exc_error;
extern PyObject *PLy_exc_fatal;
#include "access/tupdesc.h"
+#include "plpython.h"
+
typedef struct PLyResultObject
{
#include "utils/resowner.h"
+#include "plpython.h"
+
extern PyObject *PLy_spi_prepare(PyObject *self, PyObject *args);
extern PyObject *PLy_spi_execute(PyObject *self, PyObject *args);
extern PyObject *PLy_spi_execute_plan(PyObject *ob, PyObject *list, long limit);
#include "nodes/pg_list.h"
#include "utils/resowner.h"
+#include "plpython.h"
+
/* a list of nested explicit subtransactions */
extern List *explicit_subtransactions;
#include "fmgr.h"
#include "utils/typcache.h"
+#include "plpython.h"
+
struct PLyProcedure; /* avoid requiring plpy_procedure.h here */
#ifndef PLPY_UTIL_H
#define PLPY_UTIL_H
+#include "plpython.h"
+
extern PyObject *PLyUnicode_Bytes(PyObject *unicode);
extern char *PLyUnicode_AsString(PyObject *unicode);
/*
* Include order should be: postgres.h, other postgres headers, plpython.h,
- * other plpython headers
+ * other plpython headers. (In practice, other plpython headers will also
+ * include this file, so that they can compile standalone.)
*/
#ifndef POSTGRES_H
#error postgres.h must be included before plpython.h