libpq version macro to use or not PQsocketPoll

From: Dominique Devienne <ddevienne(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: libpq version macro to use or not PQsocketPoll
Date: 2024-08-06 13:28:21
Message-ID: CAFCRh-_Fz4HDKt_y+qr-Gztrh+vMiJ4EFxFHDLgC6AePJpWOzQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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...

I found https://www.postgresql.org/message-id/968815.1623936849%40sss.pgh.pa.us
where Tom thinks that a horrible idea, and instead proposes a new
_HAS_ flag instead.
Except of course there's on such flag for the new PQsocketPoll in beta2...
I see only 3 such _HAS_ flags.

I'm not sure what's so wrong with version macro as such.
- GCC has one.
- [SQLite has one][1].
- Why can't LIBPQ have one?

That's exactly the kind of issues they are designed to solve for code
that needs to be portable across versions. What am I missing?

Thanks, --DD

[1]: https://www.sqlite.org/c3ref/c_source_id.html

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2024-08-06 14:31:04 Re: libpq version macro to use or not PQsocketPoll
Previous Message Peter J. Holzer 2024-08-06 11:44:05 Re: Windows installation problem at post-install step