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

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: [PATCH 1/5] Centralize Assert* macros into c.h so its common between backend/frontend
Дата
Msg-id 20130108193129.GB8311@awork2.anarazel.de
обсуждение исходный текст
Ответ на Re: [PATCH 1/5] Centralize Assert* macros into c.h so its common between backend/frontend  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [PATCH 1/5] Centralize Assert* macros into c.h so its common between backend/frontend  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 2013-01-08 14:25:06 -0500, Tom Lane wrote:
> Andres Freund <andres@2ndquadrant.com> writes:
> > From: Andres Freund <andres@anarazel.de>
> > c.h already had parts of the assert support (StaticAssert*) and its the shared
> > file between postgres.h and postgres_fe.h. This makes it easier to build
> > frontend programs which have to do the hack.
>
> This patch seems unnecessary given that we already put a version of Assert()
> into postgres_fe.h.  I don't think that moving the two different
> definitions into an #if block in one file is an improvement.  If that
> were an improvement, we might as well move everything in both postgres.h
> and postgres_fe.h into c.h with a pile of #ifs.

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. It seems the most
consistent to move all of that into c.h, enough of the assertion stuff
is already there, I don't see an advantage of splitting it across 3
files as it currently is.

Greetings,

Andres Freund

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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [PATCH 2/5] Make relpathbackend return a statically result instead of palloc()'ing it
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [PATCH 1/5] Centralize Assert* macros into c.h so its common between backend/frontend