Fix shadowing messages in pgsql and regex_pcre2.

This commit is contained in:
Sadie Powell 2024-07-22 17:11:07 +01:00
parent d5fc385bf7
commit 5d2f760e4d
2 changed files with 8 additions and 8 deletions

View File

@ -579,17 +579,17 @@ public:
void init() override
{
int version = PQlibVersion();
int minor = version / 100 % 100;
int revision = version % 100;
if (version >= 10'00'00)
int pqversion = PQlibVersion();
int minor = pqversion / 100 % 100;
int revision = pqversion % 100;
if (pqversion >= 10'00'00)
{
// Ref: https://www.postgresql.org/docs/current/libpq-misc.html#LIBPQ-PQLIBVERSION
minor = revision;
revision = 0;
}
ServerInstance->Logs.Normal(MODNAME, "Module was compiled against libpq version {} and is running against version {}.{}.{}",
PG_VERSION, version / 10000, minor, revision);
PG_VERSION, pqversion / 10000, minor, revision);
}
void ReadConfig(ConfigStatus& status) override

View File

@ -139,12 +139,12 @@ public:
void init() override
{
std::vector<char> version(16);
if (pcre2_config(PCRE2_CONFIG_VERSION, version.data()) < 0)
std::vector<char> pcre_version(16);
if (pcre2_config(PCRE2_CONFIG_VERSION, pcre_version.data()) < 0)
return;
ServerInstance->Logs.Normal(MODNAME, "Module was compiled against PCRE2 version {}.{} and is running against version {}",
PCRE2_MAJOR, PCRE2_MINOR, version.data());
PCRE2_MAJOR, PCRE2_MINOR, pcre_version.data());
}
};