aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2014-04-27 21:24:19 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2014-04-27 21:24:19 -0400
commita9baeb361d635963a19a0268a7d60636c813d2ee (patch)
tree9e1a9dbec4612bca05cc79fba7ec3881ba54c67d /src
parent5035701e07e8bd395aa878465a102afd7b74e8c3 (diff)
downloadpostgresql-a9baeb361d635963a19a0268a7d60636c813d2ee.tar.gz
postgresql-a9baeb361d635963a19a0268a7d60636c813d2ee.zip
Can't completely get rid of #ifndef FRONTEND in palloc.h :-(
pg_controldata includes postgres.h not postgres_fe.h, so utils/palloc.h must be able to compile in a "#define FRONTEND" context. It appears that Solaris Studio is smart enough to persuade us to define PG_USE_INLINE, but not smart enough to not make a copy of unreferenced static functions; which leads to an unsatisfied reference to CurrentMemoryContext. So we need an #ifndef FRONTEND around that declaration. Per buildfarm.
Diffstat (limited to 'src')
-rw-r--r--src/include/utils/palloc.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/include/utils/palloc.h b/src/include/utils/palloc.h
index 61d03351d13..d99be84e2dc 100644
--- a/src/include/utils/palloc.h
+++ b/src/include/utils/palloc.h
@@ -75,8 +75,14 @@ extern void *repalloc_huge(void *pointer, Size size);
* MemoryContextSwitchTo can't be a macro in standard C compilers.
* But we can make it an inline function if the compiler supports it.
* See STATIC_IF_INLINE in c.h.
+ *
+ * Although this header file is nominally backend-only, certain frontend
+ * programs like pg_controldata include it via postgres.h. For some compilers
+ * it's necessary to hide the inline definition of MemoryContextSwitchTo in
+ * this scenario; hence the #ifndef FRONTEND.
*/
+#ifndef FRONTEND
#ifndef PG_USE_INLINE
extern MemoryContext MemoryContextSwitchTo(MemoryContext context);
#endif /* !PG_USE_INLINE */
@@ -90,6 +96,7 @@ MemoryContextSwitchTo(MemoryContext context)
return old;
}
#endif /* PG_USE_INLINE || MCXT_INCLUDE_DEFINITIONS */
+#endif /* FRONTEND */
/*
* These are like standard strdup() except the copied string is