config/Parser: work around conflicting macro MAX_INPUT

linux/limits.h defines MAX_INPUT which breaks the build.
This commit is contained in:
Max Kellermann 2019-05-30 16:09:23 +02:00
parent 4eb101f046
commit cfb678d618

View File

@ -41,8 +41,8 @@ template<size_t OPERAND>
static size_t
Multiply(size_t value)
{
static constexpr size_t MAX_INPUT = SIZE_MAX / OPERAND;
if (value > MAX_INPUT)
static constexpr size_t MAX_VALUE = SIZE_MAX / OPERAND;
if (value > MAX_VALUE)
throw std::runtime_error("Value too large");
return value * OPERAND;