aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2010-02-13 20:46:52 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2010-02-13 20:46:52 +0000
commit7507b193bc54a3e9b351d32b47d0f9e71e5d97cd (patch)
tree88387dd1b11ae5f7fd81eca44daa07480333cace
parent8eccf7614baa6cab004d79bd0e79f19e0c31f304 (diff)
downloadpostgresql-7507b193bc54a3e9b351d32b47d0f9e71e5d97cd.tar.gz
postgresql-7507b193bc54a3e9b351d32b47d0f9e71e5d97cd.zip
Don't expose the inline definition of MemoryContextSwitchTo when FRONTEND is
defined. Its reference to CurrentMemoryContext causes link failures on some platforms, evidently because the inline function gets compiled despite lack of use. Per buildfarm member warthog.
-rw-r--r--src/include/utils/palloc.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/include/utils/palloc.h b/src/include/utils/palloc.h
index af59c3ce54d..304a5a84a53 100644
--- a/src/include/utils/palloc.h
+++ b/src/include/utils/palloc.h
@@ -21,7 +21,7 @@
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/utils/palloc.h,v 1.43 2010/02/13 02:34:16 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/utils/palloc.h,v 1.44 2010/02/13 20:46:52 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -73,8 +73,12 @@ extern void *repalloc(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.
+ *
+ * This file has to be includable by some non-backend code such as
+ * pg_resetxlog, so don't expose the CurrentMemoryContext reference
+ * if FRONTEND is defined.
*/
-#ifdef USE_INLINE
+#if defined(USE_INLINE) && !defined(FRONTEND)
static inline MemoryContext
MemoryContextSwitchTo(MemoryContext context)
@@ -87,7 +91,7 @@ MemoryContextSwitchTo(MemoryContext context)
#else
extern MemoryContext MemoryContextSwitchTo(MemoryContext context);
-#endif /* USE_INLINE */
+#endif /* USE_INLINE && !FRONTEND */
/*
* These are like standard strdup() except the copied string is