diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2020-11-20 11:25:25 +0100 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2020-11-20 11:25:25 +0100 |
commit | b5acf10cfc63ed1e0bc4eef466c0f4670a725ef3 (patch) | |
tree | 2c2d7d98483da765ea1ecdbfb5121be6458989c5 /src/backend/access/transam/xlog.c | |
parent | ca051d8b101d3205f1c5faf0d1da8a523ffc95a1 (diff) | |
download | postgresql-b5acf10cfc63ed1e0bc4eef466c0f4670a725ef3.tar.gz postgresql-b5acf10cfc63ed1e0bc4eef466c0f4670a725ef3.zip |
Replace a macro by a function
Using a macro is ugly and not justified here.
Discussion: https://www.postgresql.org/message-id/flat/4ad69a4c-cc9b-0dfe-0352-8b1b0cd36c7b@2ndquadrant.com
Diffstat (limited to 'src/backend/access/transam/xlog.c')
-rw-r--r-- | src/backend/access/transam/xlog.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 7d97b96e728..13f1d8c3dc7 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -6228,16 +6228,17 @@ GetXLogReceiptTime(TimestampTz *rtime, bool *fromStream) * Note that text field supplied is a parameter name and does not require * translation */ -#define RecoveryRequiresIntParameter(param_name, currValue, minValue) \ -do { \ - if ((currValue) < (minValue)) \ - ereport(ERROR, \ - (errcode(ERRCODE_INVALID_PARAMETER_VALUE), \ - errmsg("hot standby is not possible because %s = %d is a lower setting than on the primary server (its value was %d)", \ - param_name, \ - currValue, \ - minValue))); \ -} while(0) +static void +RecoveryRequiresIntParameter(const char *param_name, int currValue, int minValue) +{ + if (currValue < minValue) + ereport(ERROR, + (errcode(ERRCODE_INVALID_PARAMETER_VALUE), + errmsg("hot standby is not possible because %s = %d is a lower setting than on the primary server (its value was %d)", + param_name, + currValue, + minValue))); +} /* * Check to see if required parameters are set high enough on this server |