]> granicus.if.org Git - postgresql/commitdiff
In transam.h, don't expose static inline functions to frontend code.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 22 May 2019 14:38:21 +0000 (10:38 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 22 May 2019 14:38:21 +0000 (10:38 -0400)
That leads to unsatisfied external references if the C compiler fails
to elide unused static functions.  Apparently, we have no buildfarm
members building HEAD that have that issue ... but such compilers still
exist in the wild.  Need to do something about that.

In passing, fix Berkeley-era typo in comment.

Discussion: https://postgr.es/m/27054.1558533367@sss.pgh.pa.us

src/include/access/transam.h

index 7966a9e90bac1297b3f1bd7b7af637f24459154d..4e08c4b8654328657097496ad0731cdaf3e3f46b 100644 (file)
@@ -231,6 +231,13 @@ extern void AdvanceOldestClogXid(TransactionId oldest_datfrozenxid);
 extern bool ForceTransactionIdLimitUpdate(void);
 extern Oid     GetNewObjectId(void);
 
+/*
+ * Some frontend programs include this header.  For compilers that emit static
+ * inline functions even when they're unused, that leads to unsatisfied
+ * external references; hence hide them with #ifndef FRONTEND.
+ */
+#ifndef FRONTEND
+
 /*
  * For callers that just need the XID part of the next transaction ID.
  */
@@ -240,4 +247,6 @@ ReadNewTransactionId(void)
        return XidFromFullTransactionId(ReadNextFullTransactionId());
 }
 
-#endif                                                 /* TRAMSAM_H */
+#endif                                                 /* FRONTEND */
+
+#endif                                                 /* TRANSAM_H */