You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cmkr/src/error.cpp

22 lines
499 B

4 years ago
#include "error.h"
#include <assert.h>
namespace cmkr::error {
Status::Status(Code ec) noexcept : ec_(ec) {}
4 years ago
Status::operator int() const noexcept { return static_cast<int>(ec_); }
Status::Code Status::code() const noexcept { return ec_; }
4 years ago
} // namespace cmkr::error
const char *err_string[] = {
"Success", "Runtime error", "Initialization error", "CMake generation error", "Build error",
};
const char *cmkr_error_status(int i) {
assert(i >= 0 && i < 5);
return err_string[i];
}