/
error.hpp
46 lines (40 loc) · 900 Bytes
/
error.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
* 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