Re: Should contrib modules install .h files?

From: Andres Freund <andres(at)anarazel(dot)de>
To: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Should contrib modules install .h files?
Date: 2018-08-01 03:55:15
Message-ID: 20180801035515.gn45uqoqd7kwgans@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2018-08-01 04:52:28 +0100, Andrew Gierth wrote:
> >>>>> "Tom" == Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
>
> >> If your extension is relying on pg11+, or you have checked the pg
> >> version when constructing the makefile, you can just do:
> >> PG_CPPFLAGS += -I$(includedir_server)/extension/hstore
> >> and #include "hstore.h" will work.
>
> Tom> I remain of the opinion that it'd be smarter to do
>
> Tom> PG_CPPFLAGS += -I$(includedir_server)/extension
>
> Tom> then
>
> Tom> #include "hstore/hstore.h"
>
> Tom> This way requires fewer -I options and is far more robust against
> Tom> header name conflicts.
>
> Sure, it works for the simple cases like hstore, but how does it handle
> the case of a pgxs extension that installs more than one include file,
> one of which includes another?

I might be momentarily daft (just was on a conference call for a while
;)), but why'd that be problematic? The header files can just specify
the full path, and they'll find each other because of the aforementioned
-I?

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Paul Guo 2018-08-01 03:56:30 Re: pg_ugprade test failure on data set with column with default value with type bit/varbit
Previous Message Andrew Gierth 2018-08-01 03:52:28 Re: Should contrib modules install .h files?