libpq version macro to use or not PQsocketPoll - Mailing list pgsql-general

From Dominique Devienne
Subject libpq version macro to use or not PQsocketPoll
Date
Msg-id CAFCRh-_Fz4HDKt_y+qr-Gztrh+vMiJ4EFxFHDLgC6AePJpWOzQ@mail.gmail.com
Whole thread Raw
Responses Re: libpq version macro to use or not PQsocketPoll
List 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



pgsql-general by date:

Previous
From: "Peter J. Holzer"
Date:
Subject: Re: Windows installation problem at post-install step
Next
From: Tom Lane
Date:
Subject: Re: libpq version macro to use or not PQsocketPoll