From 95069eb66e0dd348997acd06fec0fbe4604ae9f3 Mon Sep 17 00:00:00 2001 From: Roman Gershman Date: Sat, 12 Oct 2024 10:58:26 +0300 Subject: [PATCH] fix: macos build It has been failing due to OVERFLOW constant, which is predefined as a define macro on MacOS. Signed-off-by: Roman Gershman --- src/server/bitops_family.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/server/bitops_family.cc b/src/server/bitops_family.cc index 043b7a49eb1d..7565a65bf374 100644 --- a/src/server/bitops_family.cc +++ b/src/server/bitops_family.cc @@ -1011,20 +1011,20 @@ nonstd::expected ParseCommonAttr(CmdArgParser* pa // Returns the CommandList if the parsing completed succefully or std::string // to indicate an error nonstd::expected ParseToCommandList(CmdArgList args, bool read_only) { - enum class Cmds { OVERFLOW, GET, SET, INCRBY }; + enum class Cmds { OVERFLOW_OPT, GET_OPT, SET_OPT, INCRBY_OPT }; CommandList result; using nonstd::make_unexpected; CmdArgParser parser(args); while (parser.HasNext()) { - auto cmd = parser.MapNext("OVERFLOW", Cmds::OVERFLOW, "GET", Cmds::GET, "SET", Cmds::SET, - "INCRBY", Cmds::INCRBY); + auto cmd = parser.MapNext("OVERFLOW", Cmds::OVERFLOW_OPT, "GET", Cmds::GET_OPT, "SET", + Cmds::SET_OPT, "INCRBY", Cmds::INCRBY_OPT); if (parser.Error()) { return make_unexpected(kSyntaxErr); } - if (cmd == Cmds::OVERFLOW) { + if (cmd == Cmds::OVERFLOW_OPT) { if (read_only) { make_unexpected("BITFIELD_RO only supports the GET subcommand"); } @@ -1045,7 +1045,7 @@ nonstd::expected ParseToCommandList(CmdArgList args, b } auto attr = maybe_attr.value(); - if (cmd == Cmds::GET) { + if (cmd == Cmds::GET_OPT) { result.push_back(Command(Get(attr))); continue; } @@ -1058,12 +1058,12 @@ nonstd::expected ParseToCommandList(CmdArgList args, b if (parser.Error()) { return make_unexpected(kSyntaxErr); } - if (cmd == Cmds::SET) { + if (cmd == Cmds::SET_OPT) { result.push_back(Command(Set(attr, value))); continue; } - if (cmd == Cmds::INCRBY) { + if (cmd == Cmds::INCRBY_OPT) { result.push_back(Command(IncrBy(attr, value))); continue; }