diff --git a/include/tgbotxx/objects/Object.hpp b/include/tgbotxx/objects/Object.hpp index e209ec70e..7eb0efa94 100644 --- a/include/tgbotxx/objects/Object.hpp +++ b/include/tgbotxx/objects/Object.hpp @@ -45,12 +45,12 @@ namespace nl = nlohmann; field = json[json_field].get(); \ } catch(const std::exception& e) { \ std::ostringstream err{}; \ - err << __FILE__ << ':' << __LINE__ <<": "<<__PRETTY_FUNCTION__<<": Failed to deserialize \"" \ + err << __FILE__ << ':' << __LINE__ <<": "<<__FUNCTION__<<": Failed to deserialize \"" \ << json_field << "\" from json object: " << json.dump(2) << "\nReason: " << e.what(); \ throw Exception(err.str()); \ } catch(...) { \ std::ostringstream err{}; \ - err << __FILE__ << ':' << __LINE__ <<": "<<__PRETTY_FUNCTION__<<": Failed to deserialize \"" \ + err << __FILE__ << ':' << __LINE__ <<": "<<__FUNCTION__<<": Failed to deserialize \"" \ << json_field << "\" from json object: " << json.dump(2); \ throw Exception(err.str()); \ } \ @@ -60,7 +60,7 @@ namespace nl = nlohmann; if(not (optional)) \ { \ std::ostringstream err{}; \ - err << __FILE__ << ':' << __LINE__ <<": "<<__PRETTY_FUNCTION__<<": Missing required field \"" \ + err << __FILE__ << ':' << __LINE__ <<": "<<__FUNCTION__<<": Missing required field \"" \ << json_field << "\" from json object: " << json.dump(2); \ throw Exception(err.str()); \ } \ @@ -79,7 +79,7 @@ namespace nl = nlohmann; if(not (optional)) \ { \ std::ostringstream err{}; \ - err << __FILE__ << ':' << __LINE__ <<": "<<__PRETTY_FUNCTION__<<": Missing required field \"" \ + err << __FILE__ << ':' << __LINE__ <<": "<<__FUNCTION__<<": Missing required field \"" \ << json_field << "\" from json object: " << json.dump(2); \ throw Exception(err.str()); \ } \ @@ -101,7 +101,7 @@ namespace nl = nlohmann; if(not (optional)) \ { \ std::ostringstream err{}; \ - err << __FILE__ << ':' << __LINE__ <<": "<<__PRETTY_FUNCTION__<<": Missing required field \"" \ + err << __FILE__ << ':' << __LINE__ <<": "<<__FUNCTION__<<": Missing required field \"" \ << json_field << "\" from json object: " << json.dump(2); \ throw Exception(err.str()); \ } \ @@ -131,7 +131,7 @@ namespace nl = nlohmann; if(not (optional)) \ { \ std::ostringstream err{}; \ - err << __FILE__ << ':' << __LINE__ <<": "<<__PRETTY_FUNCTION__<<": Missing required field \"" \ + err << __FILE__ << ':' << __LINE__ <<": "<<__FUNCTION__<<": Missing required field \"" \ << json_field << "\" from json object: " << json.dump(2); \ throw Exception(err.str()); \ } \ diff --git a/src/Api.cpp b/src/Api.cpp index 3859b4fe9..ebb7bf6de 100644 --- a/src/Api.cpp +++ b/src/Api.cpp @@ -73,7 +73,7 @@ std::vector> Api::getUpdates(std::int32_t offset, std::int32_t limit const std::vector &allowedUpdates) const { cpr::Multipart data = { {"offset", offset}, - {"limit", std::max(1, std::min(100, limit))}, + {"limit", (std::max)(1, (std::min)(100, limit))}, {"timeout", timeout}, {"allowed_updates", allowedUpdates.empty() ? "[]" : nl::json{allowedUpdates}.dump()}, }; diff --git a/src/Bot.cpp b/src/Bot.cpp index 318467622..35288e789 100644 --- a/src/Bot.cpp +++ b/src/Bot.cpp @@ -135,7 +135,7 @@ void Bot::dispatchMessage(const Ptr &message) { } else if (atSymbolPosition == std::string::npos) { splitPosition = spacePosition; } else { - splitPosition = std::min(spacePosition, atSymbolPosition); + splitPosition = (std::min)(spacePosition, atSymbolPosition); } std::string command = message->text.substr(1, splitPosition - 1); std::vector> myCommands = m_api->getMyCommands();