From: | Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> |
---|---|
To: | Heikki Linnakangas <hlinnaka(at)iki(dot)fi> |
Cc: | Tristan Partin <tristan(at)neon(dot)tech>, Pg Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
Subject: | Re: make BuiltinTrancheNames less ugly |
Date: | 2024-03-01 14:00:49 |
Message-ID: | 202403011400.znd4wzeofwnp@alvherre.pgsql |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On 2024-Feb-23, Heikki Linnakangas wrote:
> On 12/02/2024 19:01, Tristan Partin wrote:
> > On Wed Jan 24, 2024 at 8:09 AM CST, Alvaro Herrera wrote:
> > > IMO it would be less ugly to have the origin file lwlocknames.txt be
> > > not a text file but a .h with a macro that can be defined by
> > > interested parties so that they can extract what they want from the
> > > file, like PG_CMDTAG or PG_KEYWORD. Using Perl for this seems dirty...
> >
> > I really like this idea, and would definitely be more inclined to see
> > a solution like this.
>
> +1 to that idea from me too. Seems pretty straightforward.
OK, here's a patch that does it. I have not touched Meson yet.
I'm pretty disappointed of not being able to remove
generate-lwlocknames.pl (it now generates the .h, no longer the .c
file), but I can't find a way to do the equivalent #defines in CPP ...
it'd require invoking the C preprocessor twice. Maybe an intermediate
.h file would solve the problem, but I have no idea how would that work
with Meson. I guess I'll do it in Make and let somebody suggest a Meson
way.
--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/
"El hombre nunca sabe de lo que es capaz hasta que lo intenta" (C. Dickens)
Attachment | Content-Type | Size |
---|---|---|
0001-Rework-lwlocknames.txt-to-become-lwlocklist.h.patch | text/x-diff | 15.4 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Tomas Vondra | 2024-03-01 14:05:49 | Re: BitmapHeapScan streaming read user and prelim refactoring |
Previous Message | Andrey M. Borodin | 2024-03-01 13:57:35 | Re: Commitfest Manager for March |