pgsql: Unwind #if spaghetti in hmac_openssl.c a bit.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Unwind #if spaghetti in hmac_openssl.c a bit.
Date: 2024-04-02 14:41:58
Message-ID: E1rrfKn-0008u5-Jh@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Unwind #if spaghetti in hmac_openssl.c a bit.

Make this code a little less confusing by defining a separate macro
that controls whether we'll use ResourceOwner facilities to track
the existence of a pg_hmac_ctx context.

The proximate reason to touch this is that since b8bff07da, we got
"unused function" warnings if building with older OpenSSL, because
the #if guards around the ResourceOwner wrapper function definitions
were different from those around the calls of those functions.
Pulling the ResourceOwner machinations outside of the #ifdef HAVE_xxx
guards fixes that and makes the code clearer too.

Discussion: https://postgr.es/m/1394271.1712016101@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/38698dd38e56b6de31545ac284e36feb00d413cb

Modified Files
--------------
src/common/hmac_openssl.c | 32 ++++++++++++++++++--------------
1 file changed, 18 insertions(+), 14 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Nathan Bossart 2024-04-02 15:16:29 pgsql: Refactor code for setting pg_popcount* function pointers.
Previous Message Robert Haas 2024-04-02 14:30:30 pgsql: Allow SIGINT to cancel psql database reconnections.