Skip to content

Commit b5acf10

Browse files
committed
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
1 parent ca051d8 commit b5acf10

File tree

1 file changed

+11
-10
lines changed
  • src/backend/access/transam

1 file changed

+11
-10
lines changed

src/backend/access/transam/xlog.c

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6228,16 +6228,17 @@ GetXLogReceiptTime(TimestampTz *rtime, bool *fromStream)
62286228
* Note that text field supplied is a parameter name and does not require
62296229
* translation
62306230
*/
6231-
#define RecoveryRequiresIntParameter(param_name, currValue, minValue) \
6232-
do { \
6233-
if ((currValue) < (minValue)) \
6234-
ereport(ERROR, \
6235-
(errcode(ERRCODE_INVALID_PARAMETER_VALUE), \
6236-
errmsg("hot standby is not possible because %s = %d is a lower setting than on the primary server (its value was %d)", \
6237-
param_name, \
6238-
currValue, \
6239-
minValue))); \
6240-
} while(0)
6231+
static void
6232+
RecoveryRequiresIntParameter(const char *param_name, int currValue, int minValue)
6233+
{
6234+
if (currValue < minValue)
6235+
ereport(ERROR,
6236+
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
6237+
errmsg("hot standby is not possible because %s = %d is a lower setting than on the primary server (its value was %d)",
6238+
param_name,
6239+
currValue,
6240+
minValue)));
6241+
}
62416242

62426243
/*
62436244
* Check to see if required parameters are set high enough on this server

0 commit comments

Comments
 (0)