Re: Add version macro to libpq-fe.h

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Boris Kolpackov <boris(at)codesynthesis(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Álvaro Herrera <alvaro(dot)herrera(at)2ndquadrant(dot)com>
Subject: Re: Add version macro to libpq-fe.h
Date: 2021-06-17 18:34:11
Message-ID: 20210617183411.2taf6r32kftvfnb3@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2021-06-17 13:16:17 -0400, Tom Lane wrote:
> > Then again, why would pg_config.h be absent?
>
> Likely because somebody decided it was a server-side include rather
> than an application-side include.

Which is the right call - pg_config.h can't easily be included in
applications that themselves use autoconf. Most problematically it
defines all the standard autotools PACKAGE_* macros that are guaranteed
to conflict in any autotools using project. There's obviously also a lot
of other defines in there that quite possibly could conflict.

We probably split pg_config.h at some point. Even for extensions it can
be annoying because pg_config.h is always included in server code, which
means that the extension can't easily include an autoheader style header
itself.

I'm not sure I understand why you think that exposing the version number
for libpq is such a bad idea?

I think it'd be reasonable to add a few more carefully chosen macros to
pg_config_ext.h.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2021-06-17 18:34:18 Re: Add version macro to libpq-fe.h
Previous Message Robert Haas 2021-06-17 18:22:52 Re: [Proposal] Fully WAL logged CREATE DATABASE - No Checkpoints