1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-29 23:43:17 +03:00

Change coding pattern for CURL_IGNORE_DEPRECATION()

Instead of having to write a semicolon inside the macro argument, we can
insert a semicolon with another macro layer.  This no longer gives
pg_bsd_indent indigestion, so we can remove the digestive aids that had
to be installed in the pgindent Perl script.

Author: Álvaro Herrera <alvherre@kurilemu.de>
Reviewed-by: Andrew Dunstan <andrew@dunslane.net>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/202511111134.njrwf5w5nbjm@alvherre.pgsql
Backpatch-through: 18
This commit is contained in:
Álvaro Herrera
2025-11-12 12:35:14 +01:00
parent 040a39ed25
commit 78aae29830
2 changed files with 9 additions and 18 deletions

View File

@@ -1919,6 +1919,12 @@ start_request(struct async_ctx *actx)
#define CURL_IGNORE_DEPRECATION(x) x
#endif
/*
* Add another macro layer that inserts the needed semicolon, to avoid having
* to write a literal semicolon in the call below, which would break pgindent.
*/
#define PG_CURL_IGNORE_DEPRECATION(x) CURL_IGNORE_DEPRECATION(x;)
/*
* Drives the multi handle towards completion. The caller should have already
* set up an asynchronous request via start_request().
@@ -1948,11 +1954,10 @@ drive_request(struct async_ctx *actx)
* to remove or break this API, so ignore the deprecation. See
*
* https://curl.se/mail/lib-2024-11/0028.html
*
*/
CURL_IGNORE_DEPRECATION(
err = curl_multi_socket_all(actx->curlm, &actx->running);
)
PG_CURL_IGNORE_DEPRECATION(err =
curl_multi_socket_all(actx->curlm,
&actx->running));
if (err)
{