Move MAXIMUM_ALIGNOF definition to c.h - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Move MAXIMUM_ALIGNOF definition to c.h
Date
Msg-id 58cedbc7-5658-468d-868e-a4d06de04ca6@eisentraut.org
Whole thread Raw
List pgsql-hackers
As suggested at [0], we can move the computation of MAXIMUM_ALIGNOF from 
configure.ac and meson.build to c.h.  This eliminates code duplication. 
(For example, the AIX patch contemplates some changes, so it would be 
good to make those in only one place.)  Also, it used to be more 
complicated, but now it's not really a computation anymore, it's just a 
#define and two static assertions, so it's just much easier and natural 
this way.  (For example, doing a symbol lookup on MAXIMUM_ALIGNOF will 
take you to a place with useful context, instead of to pg_config.h.)

The only trick is that the there are some ordering problems in c.h. 
MAXIMUM_ALIGNOF is used in the definition of the int128, which comes 
very early, before the alignment handling.  I moved the int128 stuff to 
later in the file, near other types with alignment dependencies.  (If 
you look closer, you will find other opportunities for a more 
comprehensive reshuffling in c.h, but maybe that should be a separate 
project.)

[0]: 
https://www.postgresql.org/message-id/CA%2BhUKGLQUivg-NC7dHdbRAPmG0Hapg1gGnygM5KgDfDM2a_TMg%40mail.gmail.com
Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Fwd: [PATCH] Add zstd compression for TOAST using extended header format
Next
From: shveta malik
Date:
Subject: Re: pg_upgrade: optimize replication slot caught-up check