Re: [PATCH 1/5] Centralize Assert* macros into c.h so its common between backend/frontend

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH 1/5] Centralize Assert* macros into c.h so its common between backend/frontend
Date: 2013-01-08 20:18:08
Message-ID: 20130108201808.GA10185@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2013-01-08 14:35:12 -0500, Tom Lane wrote:
> Andres Freund <andres(at)2ndquadrant(dot)com> writes:
> > On 2013-01-08 14:25:06 -0500, Tom Lane wrote:
> >> This patch seems unnecessary given that we already put a version of Assert()
> >> into postgres_fe.h.
>
> > The problem is that some (including existing) pieces of code need to
> > include postgres.h itself, those can't easily include postgres_fe.h as
> > well without getting into problems with redefinitions.
>
> There is no place, anywhere, that should be including both. So I don't
> see the problem.

Sorry, misremembered the problem somewhat. The problem is that code that
includes postgres.h atm ends up with ExceptionalCondition() et
al. declared even if FRONTEND is defined. So if anything uses an assert
you need to provide wrappers for those which seems nasty. If they are
provided centrally and check for FRONTEND that problem doesn't exist.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2013-01-08 20:22:13 Re: json api WIP patch
Previous Message Andrew Dunstan 2013-01-08 20:12:44 Re: json api WIP patch