diff options
-rw-r--r-- | include/source_location.hpp | 27 | ||||
-rw-r--r-- | redfish-core/include/error_messages.hpp | 6 | ||||
-rw-r--r-- | redfish-core/src/error_messages.cpp | 4 |
3 files changed, 5 insertions, 32 deletions
diff --git a/include/source_location.hpp b/include/source_location.hpp deleted file mode 100644 index 9880752d66..0000000000 --- a/include/source_location.hpp +++ /dev/null @@ -1,27 +0,0 @@ -#pragma once - -// As of clang-12, clang still doesn't support std::source_location, which -// means that clang-tidy also doesn't support std::source_location. -// Inside the libstdc++ implementation of <source_location> is this check of -// __builtin_source_location to determine if the compiler supports the -// necessary bits for std::source_location, and if not the header ends up doing -// nothing. Use this same builtin-check to detect when we're running under -// an "older" clang and fallback to std::experimental::source_location instead. - -#if __has_builtin(__builtin_source_location) -#include <source_location> - -namespace bmcweb -{ -using source_location = std::source_location; -} - -#else -#include <experimental/source_location> - -namespace bmcweb -{ -using source_location = std::experimental::source_location; -} - -#endif diff --git a/redfish-core/include/error_messages.hpp b/redfish-core/include/error_messages.hpp index 6f1e4e8911..6c5952d727 100644 --- a/redfish-core/include/error_messages.hpp +++ b/redfish-core/include/error_messages.hpp @@ -16,12 +16,12 @@ #pragma once #include "http_response.hpp" -#include "source_location.hpp" #include <boost/url/url_view.hpp> #include <nlohmann/json.hpp> #include <cstdint> +#include <source_location> #include <string> #include <string_view> @@ -121,8 +121,8 @@ void actionParameterValueNotInList(crow::Response& res, std::string_view arg1, * @returns Message InternalError formatted to JSON */ nlohmann::json internalError(); -void internalError(crow::Response& res, bmcweb::source_location location = - bmcweb::source_location::current()); +void internalError(crow::Response& res, std::source_location location = + std::source_location::current()); /** * @brief Formats UnrecognizedRequestBody message into JSON diff --git a/redfish-core/src/error_messages.cpp b/redfish-core/src/error_messages.cpp index 1742d23114..7d1f3a94f9 100644 --- a/redfish-core/src/error_messages.cpp +++ b/redfish-core/src/error_messages.cpp @@ -19,7 +19,6 @@ #include "logging.hpp" #include "registries.hpp" #include "registries/base_message_registry.hpp" -#include "source_location.hpp" #include <boost/beast/http/field.hpp> #include <boost/beast/http/status.hpp> @@ -27,6 +26,7 @@ #include <array> #include <cstddef> +#include <source_location> #include <span> #include <string> #include <utility> @@ -280,7 +280,7 @@ nlohmann::json internalError(void) return getLog(redfish::registries::base::Index::internalError, {}); } -void internalError(crow::Response& res, const bmcweb::source_location location) +void internalError(crow::Response& res, const std::source_location location) { BMCWEB_LOG_CRITICAL << "Internal Error " << location.file_name() << "(" << location.line() << ":" << location.column() << ") `" |