63f636e7b7
closes #1541
47 lines
900 B
C++
47 lines
900 B
C++
/*
|
|
* Copyright (c) 2015 Andrew Kelley
|
|
*
|
|
* This file is part of zig, which is MIT licensed.
|
|
* See http://opensource.org/licenses/MIT
|
|
*/
|
|
|
|
#ifndef ERROR_HPP
|
|
#define ERROR_HPP
|
|
|
|
#include <assert.h>
|
|
|
|
enum Error {
|
|
ErrorNone,
|
|
ErrorNoMem,
|
|
ErrorInvalidFormat,
|
|
ErrorSemanticAnalyzeFail,
|
|
ErrorAccess,
|
|
ErrorInterrupted,
|
|
ErrorSystemResources,
|
|
ErrorFileNotFound,
|
|
ErrorFileSystem,
|
|
ErrorFileTooBig,
|
|
ErrorDivByZero,
|
|
ErrorOverflow,
|
|
ErrorPathAlreadyExists,
|
|
ErrorUnexpected,
|
|
ErrorExactDivRemainder,
|
|
ErrorNegativeDenominator,
|
|
ErrorShiftedOutOneBits,
|
|
ErrorCCompileErrors,
|
|
ErrorEndOfFile,
|
|
ErrorIsDir,
|
|
ErrorUnsupportedOperatingSystem,
|
|
ErrorSharingViolation,
|
|
ErrorPipeBusy,
|
|
ErrorPrimitiveTypeNotFound,
|
|
};
|
|
|
|
const char *err_str(Error err);
|
|
|
|
static inline void assertNoError(Error err) {
|
|
assert(err == ErrorNone);
|
|
}
|
|
|
|
#endif
|