Re: Avoid circular header file dependency - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Avoid circular header file dependency
Date
Msg-id aAyOgHY7IXN7GQFv@paquier.xyz
Whole thread Raw
In response to Re: Avoid circular header file dependency  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Avoid circular header file dependency
List pgsql-hackers
On Sat, Apr 26, 2025 at 01:20:56AM -0400, Tom Lane wrote:
> Bertrand Drouvot <bertranddrouvot.pg@gmail.com> writes:
>> While working on wait events I faced some compilation issues due to circular
>> header file dependency (introduced in fa88928470b5) between wait_event.h and
>> wait_event_types.h.
>
> Ugh.  I still carry the scars of cleaning up after a previous
> circular-inclusion mess (cf 1609797c2), so I'm always worried about
> introducing new cases.  I don't have an opinion about whether this
> specific refactoring is the best way to deal with this case, but
> I definitely feel that we mustn't allow the situation to persist.

This one is my fault, so I'll take care of it.  Splitting the values
of the wait classes into their own header makes sense, but the header
name wait_class_constants.h sounds a bit off.  Why not a simpler
"wait_classes.h" that gets included by wait_event.h and
wait_event_types.h?
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: "Joel Jacobson"
Date:
Subject: Re: Sanding down some edge cases for PL/pgSQL reserved words
Next
From: Bertrand Drouvot
Date:
Subject: Re: Avoid circular header file dependency