From 338199be127755ebe5dddac8c32878975863a24a Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sun, 19 Aug 2018 00:02:13 -0500 Subject: [PATCH] [ox/std] Further constexpr OxError --- deps/ox/src/ox/std/error.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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;