From 3c86223c998280ea313480d319ec39f802453218 Mon Sep 17 00:00:00 2001 From: Thomas Munro Date: Tue, 25 Mar 2025 20:17:53 +1300 Subject: libpq: Deprecate pg_int64. Previously we used pg_int64 in three function prototypes in libpq. It was added by commit 461ef73f to expose the platform-dependent type used for int64 in the C89 era. As of commit 962da900 it is defined as standard int64_t, and the dust seems to have settled. Let's just use int64_t directly in these three client-facing functions instead of (yet) another name. We've required C99 and thus since PostgreSQL 12, C89 and C++98 compilers are long gone, and client applications very likely use standard types for their own 64-bit needs. This also cleans up the obscure placement of a new #include directive in postgres_ext.h, required for the new definition. The typedef was hiding in there for historical reasons, but it doesn't fit postgres_ext.h's own description of its purpose and there is no evidence of client applications including postgres_ext.h directly to see it. Keep a typedef marked deprecated for backward compatibility, but move it into libpq-fe.h where it was used. Reviewed-by: Peter Eisentraut Discussion: https://postgr.es/m/CA%2BhUKGKn_EkNNGMY5RzMcKP%2Ba6urT4JF%3DCPhw_zHtQwjvX6P2g%40mail.gmail.com --- src/test/examples/testlo64.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/test/examples') diff --git a/src/test/examples/testlo64.c b/src/test/examples/testlo64.c index 66c9abe1a99..c303db92e5b 100644 --- a/src/test/examples/testlo64.c +++ b/src/test/examples/testlo64.c @@ -12,6 +12,7 @@ * *------------------------------------------------------------------------- */ +#include #include #include @@ -75,7 +76,7 @@ importFile(PGconn *conn, char *filename) } static void -pickout(PGconn *conn, Oid lobjId, pg_int64 start, int len) +pickout(PGconn *conn, Oid lobjId, int64_t start, int len) { int lobj_fd; char *buf; @@ -110,7 +111,7 @@ pickout(PGconn *conn, Oid lobjId, pg_int64 start, int len) } static void -overwrite(PGconn *conn, Oid lobjId, pg_int64 start, int len) +overwrite(PGconn *conn, Oid lobjId, int64_t start, int len) { int lobj_fd; char *buf; @@ -148,7 +149,7 @@ overwrite(PGconn *conn, Oid lobjId, pg_int64 start, int len) } static void -my_truncate(PGconn *conn, Oid lobjId, pg_int64 len) +my_truncate(PGconn *conn, Oid lobjId, int64_t len) { int lobj_fd; -- cgit v1.2.3