1
0
mirror of https://github.com/borgesdan/xn65 synced 2024-12-29 21:54:47 +01:00
xn65/framework/xnaerror.hpp

27 lines
533 B
C++
Raw Normal View History

2024-03-26 10:32:56 -03:00
#ifndef XNA_XNAERROR_HPP
#define XNA_XNAERROR_HPP
namespace xna {
enum class XnaErrorCode {
NONE,
ARGUMENT_OUT_OF_RANGE,
ARGUMENT_IS_NULL,
INVALID_OPERATION,
OVERFLOW_OPERATION,
NULL_CAST,
};
inline void xna_error_apply(XnaErrorCode* source, XnaErrorCode const& value) {
if (source != nullptr)
*source = value;
}
inline bool xna_error_haserros(XnaErrorCode* source) {
return source != nullptr;
}
#define xna_error_nullarg XnaErrorCode* err = nullptr
#define xna_error_ptr_arg XnaErrorCode* err
}
#endif