Re: libpq version macro to use or not PQsocketPoll

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dominique Devienne <ddevienne(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: libpq version macro to use or not PQsocketPoll
Date: 2024-08-06 14:31:04
Message-ID: 1340430.1722954664@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dominique Devienne <ddevienne(at)gmail(dot)com> writes:
> Hi. Now that v17beta2 is part of my dev-env, I'm trying out the new API.
> And I discover there's no version macro for conditional compilation in LIBPQ...

Indeed, that's an oversight, and there's a number of other things
we added to libpq-fe.h between 16 and 17 that probably deserve
their own LIBPQ_HAS symbols.

> I'm not sure what's so wrong with version macro as such.

A couple of things:
* It doesn't help if we forget to update it, so it's not really
better than HAS_ symbols on that score.
* Usage is error-prone (you might test for the wrong cutoff version)
and not very readable.
* We can't retroactively make such a symbol appear in old copies
of libpq-fe.h.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dominique Devienne 2024-08-06 14:48:00 Re: libpq version macro to use or not PQsocketPoll
Previous Message Dominique Devienne 2024-08-06 13:28:21 libpq version macro to use or not PQsocketPoll