[ox/std] Further constexpr OxError

This commit is contained in:
Gary Talent 2018-08-19 00:02:13 -05:00
parent f12de38211
commit 338199be12

View File

@ -11,7 +11,7 @@
#include "types.hpp"
#ifdef DEBUG
#define OxError(x) x ? reinterpret_cast<uint64_t>(__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<uint64_t>(file) | _errorTags(line, errCode) : 0;
}
template<typename T>
struct ValErr {
T value;