Re: Add version macro to libpq-fe.h
От | Tom Lane |
---|---|
Тема | Re: Add version macro to libpq-fe.h |
Дата | |
Msg-id | 968815.1623936849@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Add version macro to libpq-fe.h (Boris Kolpackov <boris@codesynthesis.com>) |
Ответы |
Re: Add version macro to libpq-fe.h
Re: Add version macro to libpq-fe.h |
Список | pgsql-hackers |
Boris Kolpackov <boris@codesynthesis.com> writes: > I am making use of the new pipeline mode added to libpq in > PostgreSQL 14. At the same time I would still like to support > older libpq versions by not providing the extended functionality > that depends on this mode. Good point. > The natural way to achieve this in C/C++ is to conditionally > enable code that depends on the additional APIs based on the > preprocessor macro. And I could easily do this if libpq-fe.h > provided a macro containing its version. I think putting a version number as such in there is a truly horrid idea. However, I could get behind adding a boolean flag that says specifically whether the pipeline feature exists. Then you'd do something like #ifdef LIBPQ_HAS_PIPELINING rather than embedding knowledge of exactly which release added that. regards, tom lane
В списке pgsql-hackers по дате отправления: