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

From Alvaro Herrera
Subject Re: Re: [PATCH 1/5] Centralize Assert* macros into c.h so its common between backend/frontend
Date
Msg-id 20130118152307.GB4063@alvh.no-ip.org
Whole thread Raw
In response to Re: Re: [PATCH 1/5] Centralize Assert* macros into c.h so its common between backend/frontend  (Andres Freund <andres@2ndquadrant.com>)
Responses Re: Re: [PATCH 1/5] Centralize Assert* macros into c.h so its common between backend/frontend
Re: Re: [PATCH 1/5] Centralize Assert* macros into c.h so its common between backend/frontend
List pgsql-hackers
Andres Freund wrote:
> On 2013-01-18 15:48:01 +0100, Andres Freund wrote:
> > Here's a trivially updated patch which also defines AssertArg() for
> > FRONTEND-ish environments since Alvaro added one in xlogreader.c.
>
> This time for real. Please.

Here's a different idea: move all the Assert() and StaticAssert() etc
definitions from c.h and postgres.h into a new header, say pgassert.h.
That header is included directly by postgres.h (just like palloc.h and
elog.h already are) so we don't have to touch the backend code at all.
Frontend programs that want that functionality can just #include
"pgassert.h" by themselves.  The definitions are (obviously) protected
by #ifdef FRONTEND so that it all works in both environments cleanly.

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: HS locking broken in HEAD
Next
From: Tom Lane
Date:
Subject: Re: Re: [PATCH 1/5] Centralize Assert* macros into c.h so its common between backend/frontend