diff --git a/deps/ox/src/ox/std/error.hpp b/deps/ox/src/ox/std/error.hpp index e604eec1..baa3d07f 100644 --- a/deps/ox/src/ox/std/error.hpp +++ b/deps/ox/src/ox/std/error.hpp @@ -11,7 +11,7 @@ #include "types.hpp" #ifdef DEBUG -#define OxError(x) x ? reinterpret_cast(__FILE__) | _errorTags(__LINE__, x) : 0 +#define OxError(x) ox::_error(__FILE__, __LINE__, x) #else #define OxError(x) x #endif @@ -48,6 +48,10 @@ static constexpr Error _errorTags(Error line, Error errCode) { return errCode | line; } +static constexpr Error _error(const char *file, int line, Error errCode) { + return errCode ? reinterpret_cast(file) | _errorTags(line, errCode) : 0; +} + template struct ValErr { T value;