aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2019-05-22 10:38:21 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2019-05-22 10:38:21 -0400
commit4fbf809e13c3ba09c4f03d148cb58767e56f67f1 (patch)
tree645311a3389011470fc764bda186e2fd727d2902 /src
parentb8c6014a65ee0819e8fe4c7536f72da0df5d8e46 (diff)
downloadpostgresql-4fbf809e13c3ba09c4f03d148cb58767e56f67f1.tar.gz
postgresql-4fbf809e13c3ba09c4f03d148cb58767e56f67f1.zip
In transam.h, don't expose static inline functions to frontend code.
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
Diffstat (limited to 'src')
-rw-r--r--src/include/access/transam.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/include/access/transam.h b/src/include/access/transam.h
index 7966a9e90ba..4e08c4b8654 100644
--- a/src/include/access/transam.h
+++ b/src/include/access/transam.h
@@ -232,6 +232,13 @@ 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.
*/
static inline TransactionId
@@ -240,4 +247,6 @@ ReadNewTransactionId(void)
return XidFromFullTransactionId(ReadNextFullTransactionId());
}
-#endif /* TRAMSAM_H */
+#endif /* FRONTEND */
+
+#endif /* TRANSAM_H */