diff options
Diffstat (limited to 'zencore')
| -rw-r--r-- | zencore/except.cpp | 2 | ||||
| -rw-r--r-- | zencore/include/zencore/except.h | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/zencore/except.cpp b/zencore/except.cpp index ebaecf815..fae629286 100644 --- a/zencore/except.cpp +++ b/zencore/except.cpp @@ -81,7 +81,7 @@ GetSystemErrorAsString(uint32_t ErrorCode) return std::error_code(ErrorCode, std::system_category()).message(); } -#if __cpp_lib_source_location +#if defined(__cpp_lib_source_location) void ThrowLastError(std::string_view Message, const std::source_location& Location) { diff --git a/zencore/include/zencore/except.h b/zencore/include/zencore/except.h index e0e4aaae0..6719c1319 100644 --- a/zencore/include/zencore/except.h +++ b/zencore/include/zencore/except.h @@ -8,7 +8,9 @@ #else # include <errno.h> #endif -#include <source_location> +#if __has_include("source_location") +# include <source_location> +#endif #include <string> #include <system_error> @@ -20,7 +22,7 @@ ZENCORE_API void ThrowSystemException [[noreturn]] (HRESULT hRes, std::string_vi ZENCORE_API void ThrowLastError [[noreturn]] (std::string_view Message); -#if __cpp_lib_source_location +#if defined(__cpp_lib_source_location) ZENCORE_API void ThrowLastError [[noreturn]] (std::string_view Message, const std::source_location& Location); #endif |