Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit36825f3

Browse files
committed
Can't completely get rid of #ifndef FRONTEND in palloc.h :-(
pg_controldata includes postgres.h not postgres_fe.h, so utils/palloc.hmust be able to compile in a "#define FRONTEND" context. It appears thatSolaris 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 weneed an #ifndef FRONTEND around that declaration. Per buildfarm.
1 parente4c1a49 commit36825f3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

‎src/include/utils/palloc.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,14 @@ extern void pfree(void *pointer);
7171
* MemoryContextSwitchTo can't be a macro in standard C compilers.
7272
* But we can make it an inline function if the compiler supports it.
7373
* See STATIC_IF_INLINE in c.h.
74+
*
75+
* Although this header file is nominally backend-only, certain frontend
76+
* programs like pg_controldata include it via postgres.h. For some compilers
77+
* it's necessary to hide the inline definition of MemoryContextSwitchTo in
78+
* this scenario; hence the #ifndef FRONTEND.
7479
*/
7580

81+
#ifndefFRONTEND
7682
#ifndefPG_USE_INLINE
7783
externMemoryContextMemoryContextSwitchTo(MemoryContextcontext);
7884
#endif/* !PG_USE_INLINE */
@@ -86,6 +92,7 @@ MemoryContextSwitchTo(MemoryContext context)
8692
returnold;
8793
}
8894
#endif/* PG_USE_INLINE || MCXT_INCLUDE_DEFINITIONS */
95+
#endif/* FRONTEND */
8996

9097
/*
9198
* These are like standard strdup() except the copied string is

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp