Re: Should contrib modules install .h files? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Should contrib modules install .h files?
Date
Msg-id 27744.1533091472@sss.pgh.pa.us
Whole thread Raw
In response to Re: Should contrib modules install .h files?  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Responses Re: Should contrib modules install .h files?
List pgsql-hackers
Andrew Gierth <andrew@tao11.riddles.org.uk> writes:
> "Peter" == Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
>  Peter> I'm missing some guidance what an extension using those headers
>  Peter> is supposed to do. How does it get the right -I options?

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

I remain of the opinion that it'd be smarter to do

PG_CPPFLAGS += -I$(includedir_server)/extension

then

#include "hstore/hstore.h"

This way requires fewer -I options and is far more robust against header
name conflicts.

            regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: New Defects reported by Coverity Scan for PostgreSQL
Next
From: Bruce Momjian
Date:
Subject: Re: pg_upgrade from 9.4 to 10.4