Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 6b85d4b

Browse files
committed
Fix portability problem induced by commit a6f6b78.
pg_xlogdump includes bufmgr.h. With a compiler that emits code for static inline functions even when they're unreferenced, that leads to unresolved external references in the new static-inline version of BufferGetPage(). So hide it with #ifndef FRONTEND, as we've done for similar issues elsewhere. Per buildfarm member pademelon.
1 parent ba8fe38 commit 6b85d4b

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src/backend/storage/buffer/bufmgr.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -4299,7 +4299,7 @@ IssuePendingWritebacks(WritebackContext *context)
42994299
* For best performance, keep the tests that are fastest and/or most likely to
43004300
* exclude a page from old snapshot testing near the front.
43014301
*/
4302-
extern void
4302+
void
43034303
TestForOldSnapshot(Snapshot snapshot, Relation relation, Page page)
43044304
{
43054305
Assert(relation != NULL);

src/include/storage/bufmgr.h

+12-1
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,15 @@ extern void FreeAccessStrategy(BufferAccessStrategy strategy);
252252

253253
/* inline functions */
254254

255+
/*
256+
* Although this header file is nominally backend-only, certain frontend
257+
* programs like pg_xlogdump include it. For compilers that emit static
258+
* inline functions even when they're unused, that leads to unsatisfied
259+
* external references; hence hide these with #ifndef FRONTEND.
260+
*/
261+
262+
#ifndef FRONTEND
263+
255264
/*
256265
* BufferGetPage
257266
* Returns the page associated with a buffer.
@@ -272,4 +281,6 @@ BufferGetPage(Buffer buffer, Snapshot snapshot, Relation relation,
272281
return page;
273282
}
274283

275-
#endif
284+
#endif /* FRONTEND */
285+
286+
#endif /* BUFMGR_H */

0 commit comments

Comments
 (0)