pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrew Gierth <andrew@tao11.riddles.org.uk>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: Should contrib modules install .h files?
Date: Tue, 31 Jul 2018 22:44:32 -0400
Message-ID: <27744.1533091472@sss.pgh.pa.us> (raw)
In-Reply-To: <87d0v3atbm.fsf@news-spur.riddles.org.uk>
References: <87y3euomjh.fsf@news-spur.riddles.org.uk>
	<ee05ea4c-3d5b-0ec6-8daa-3ec66f021076@2ndquadrant.com>
	<87tvpinfr4.fsf@news-spur.riddles.org.uk>
	<63444.1530537990@sss.pgh.pa.us>
	<87lgatohzp.fsf@news-spur.riddles.org.uk>
	<63655.1530540982@sss.pgh.pa.us>
	<87h8lhoevw.fsf@news-spur.riddles.org.uk>
	<63819.1530544945@sss.pgh.pa.us>
	<878t6to8j9.fsf@news-spur.riddles.org.uk>
	<874lhho071.fsf@news-spur.riddles.org.uk>
	<67427.1530738056@sss.pgh.pa.us>
	<87po02m0bh.fsf@news-spur.riddles.org.uk>
	<87in5tnafh.fsf@news-spur.riddles.org.uk>
	<87efghn7js.fsf@news-spur.riddles.org.uk>
	<87a7r5n4n2.fsf@news-spur.riddles.org.uk>
	<87o9enb4h7.fsf@news-spur.riddles.org.uk>
	<86036c67-d76f-3dc0-a9f5-69e776b4ecc5@2ndquadrant.com>
	<87d0v3atbm.fsf@news-spur.riddles.org.uk>

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




view thread (81+ messages)  latest in thread

Message-ID: <27744.1533091472@sss.pgh.pa.us>
Permalink:  ../27744.1533091472@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/27744.1533091472@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andrew@tao11.riddles.org.uk, peter.eisentraut@2ndquadrant.com
  Subject: Re: Should contrib modules install .h files?
  In-Reply-To: <27744.1533091472@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox