From 10a7d49726c993732880f520aac58afac82b196f Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Thu, 17 Jul 2025 13:34:52 +0300 Subject: [PATCH] Use XLogRecPtr for LSNs in C generated code. This hopefully silences the static assertion Erik is seeing: ``` pgxn/neon/communicator_new.c:1352:9: error: static assertion failed due to requirement '__builtin_types_compatible_p(unsigned long long, unsigned long)': (r->lsn) does not have type XLogRecPtr 1352 | LSN_FORMAT_ARGS(r->lsn)); | ^~~~~~~~~~~~~~~~~~~~~~~ ``` --- pgxn/neon/communicator/src/neon_request.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pgxn/neon/communicator/src/neon_request.rs b/pgxn/neon/communicator/src/neon_request.rs index d68ec24ed9..732c35d6ce 100644 --- a/pgxn/neon/communicator/src/neon_request.rs +++ b/pgxn/neon/communicator/src/neon_request.rs @@ -1,4 +1,15 @@ -pub type CLsn = u64; + +// Definitions of some core PostgreSQL datatypes. + +/// XLogRecPtr is defined in "access/xlogdefs.h" as: +/// +/// ``` +/// typedef uint64 XLogRecPtr; +/// ``` +/// cbindgen:no-export +pub type XLogRecPtr = u64; + +pub type CLsn = XLogRecPtr; pub type COid = u32; // This conveniently matches PG_IOV_MAX