Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Fix portability problem induced by commit a6f6b7819.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 15 Apr 2016 14:44:28 +0000 (10:44 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 15 Apr 2016 14:44:28 +0000 (10:44 -0400)
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.

src/backend/storage/buffer/bufmgr.c
src/include/storage/bufmgr.h

index 462dd4a22620e3394713bf1f899dddf6ebd40d57..a2b2c66a86a7fb7b1c0a1f441fad2d3ac52ac1d8 100644 (file)
@@ -4299,7 +4299,7 @@ IssuePendingWritebacks(WritebackContext *context)
  * For best performance, keep the tests that are fastest and/or most likely to
  * exclude a page from old snapshot testing near the front.
  */
-extern void
+void
 TestForOldSnapshot(Snapshot snapshot, Relation relation, Page page)
 {
    Assert(relation != NULL);
index afd8a847efdb7dbd303fc78e18450fa4323c8923..86040610e7737432b55dfa1e0e3aaad210fcebe1 100644 (file)
@@ -252,6 +252,15 @@ extern void FreeAccessStrategy(BufferAccessStrategy strategy);
 
 /* inline functions */
 
+/*
+ * Although this header file is nominally backend-only, certain frontend
+ * programs like pg_xlogdump include it.  For compilers that emit static
+ * inline functions even when they're unused, that leads to unsatisfied
+ * external references; hence hide these with #ifndef FRONTEND.
+ */
+
+#ifndef FRONTEND
+
 /*
  * BufferGetPage
  *     Returns the page associated with a buffer.
@@ -272,4 +281,6 @@ BufferGetPage(Buffer buffer, Snapshot snapshot, Relation relation,
    return page;
 }
 
-#endif
+#endif   /* FRONTEND */
+
+#endif   /* BUFMGR_H */